Re: emacs: Handling external dependencies
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 14 Nov 2012 09:43:00 +0000 (11:43 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:33 +0000 (09:50 -0800)
e2/e6a3b36216ab6c7e94fce174005ec542f303c2 [new file with mode: 0644]

diff --git a/e2/e6a3b36216ab6c7e94fce174005ec542f303c2 b/e2/e6a3b36216ab6c7e94fce174005ec542f303c2
new file mode 100644 (file)
index 0000000..916fd2e
--- /dev/null
@@ -0,0 +1,97 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 88DAB431FBC\r
+       for <notmuch@notmuchmail.org>; Wed, 14 Nov 2012 01:43:02 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 64B90LtQKL4m for <notmuch@notmuchmail.org>;\r
+       Wed, 14 Nov 2012 01:43:01 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7408E431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 14 Nov 2012 01:43:01 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 19C4D1000E2;\r
+       Wed, 14 Nov 2012 11:43:01 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>,\r
+       Damien Cassou <damien.cassou@gmail.com>,\r
+       notmuch mailing list <notmuch@notmuchmail.org>\r
+Subject: Re: emacs: Handling external dependencies\r
+In-Reply-To: <87pq3h56d5.fsf@betacantrips.com>\r
+References:\r
+ <CA+y5ggiGrAcicQLeskaXFoxYyJQVVXZ1VRX=XS8zPFR9_mBFxA@mail.gmail.com>\r
+       <87pq3h56d5.fsf@betacantrips.com>\r
+User-Agent: Notmuch/0.14+84~g8a199bf (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Wed, 14 Nov 2012 11:43:00 +0200\r
+Message-ID: <m2obj034gr.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 14 Nov 2012 09:43:02 -0000\r
+\r
+On Wed, Nov 14 2012, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:\r
+\r
+> Damien Cassou <damien.cassou@gmail.com> writes:\r
+>\r
+>> 4) distribute the dependency with the rest of notmuch (in a separate\r
+>> "fallback-libs/" directory) and load it only when requiring the\r
+>> library with the standard load-path does not work. Jonas Bernoulli\r
+>> gave me a way to do that:\r
+>>\r
+>> ,----\r
+>> | (or (require 'THE-LIB nil t)\r
+>> |     (let ((load-path\r
+>> |           (cons (expand-file-name\r
+>> |                  "fallback-libs"\r
+>> |                  (file-name-directory (or load-file-name buffer-file-name)))\r
+>> |                 load-path)))\r
+>> |       (require 'THE-LIB)))\r
+>> `----\r
+>>\r
+>> What do you think?\r
+>\r
+> Why not just append it to the *end* of load-path? Then it won't shadow\r
+> anything.\r
+\r
+The scope of the load-path change is for just this one require -- if\r
+header-button required some other modules, the fallback-libs version\r
+should be preferred (in case exists) over loading elsewehere in this case\r
+header-button is loaded from fallback-libs.\r
+\r
+But, maybe we should be more spesific there and use something like:\r
+\r
+(let ((dir (expand-file-name \r
+            "notmuch-deps" \r
+            (file-name-directory (or load-file-name buffer-file-name)))))\r
+  (unless (require 'header-button (concat dir "/header-button.elc") t)\r
+          (require 'header-button (concat dir "/header-button.el") nil)))\r
+\r
+\r
+(if we ever agree to do either kind of loading...)\r
+\r
+> Ethan\r
+\r
+Tomi\r