1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 88DAB431FBC
\r
6 for <notmuch@notmuchmail.org>; Wed, 14 Nov 2012 01:43:02 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 64B90LtQKL4m for <notmuch@notmuchmail.org>;
\r
16 Wed, 14 Nov 2012 01:43:01 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 7408E431FAF
\r
19 for <notmuch@notmuchmail.org>; Wed, 14 Nov 2012 01:43:01 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 19C4D1000E2;
\r
22 Wed, 14 Nov 2012 11:43:01 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>,
\r
25 Damien Cassou <damien.cassou@gmail.com>,
\r
26 notmuch mailing list <notmuch@notmuchmail.org>
\r
27 Subject: Re: emacs: Handling external dependencies
\r
28 In-Reply-To: <87pq3h56d5.fsf@betacantrips.com>
\r
30 <CA+y5ggiGrAcicQLeskaXFoxYyJQVVXZ1VRX=XS8zPFR9_mBFxA@mail.gmail.com>
\r
31 <87pq3h56d5.fsf@betacantrips.com>
\r
32 User-Agent: Notmuch/0.14+84~g8a199bf (http://notmuchmail.org) Emacs/24.2.1
\r
33 (x86_64-unknown-linux-gnu)
\r
34 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
35 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
36 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
37 Date: Wed, 14 Nov 2012 11:43:00 +0200
\r
38 Message-ID: <m2obj034gr.fsf@guru.guru-group.fi>
\r
40 Content-Type: text/plain
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 14 Nov 2012 09:43:02 -0000
\r
55 On Wed, Nov 14 2012, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
\r
57 > Damien Cassou <damien.cassou@gmail.com> writes:
\r
59 >> 4) distribute the dependency with the rest of notmuch (in a separate
\r
60 >> "fallback-libs/" directory) and load it only when requiring the
\r
61 >> library with the standard load-path does not work. Jonas Bernoulli
\r
62 >> gave me a way to do that:
\r
65 >> | (or (require 'THE-LIB nil t)
\r
66 >> | (let ((load-path
\r
67 >> | (cons (expand-file-name
\r
68 >> | "fallback-libs"
\r
69 >> | (file-name-directory (or load-file-name buffer-file-name)))
\r
71 >> | (require 'THE-LIB)))
\r
74 >> What do you think?
\r
76 > Why not just append it to the *end* of load-path? Then it won't shadow
\r
79 The scope of the load-path change is for just this one require -- if
\r
80 header-button required some other modules, the fallback-libs version
\r
81 should be preferred (in case exists) over loading elsewehere in this case
\r
82 header-button is loaded from fallback-libs.
\r
84 But, maybe we should be more spesific there and use something like:
\r
86 (let ((dir (expand-file-name
\r
88 (file-name-directory (or load-file-name buffer-file-name)))))
\r
89 (unless (require 'header-button (concat dir "/header-button.elc") t)
\r
90 (require 'header-button (concat dir "/header-button.el") nil)))
\r
93 (if we ever agree to do either kind of loading...)
\r