emacs: Handling external dependencies

Ethan Glasser-Camp ethan.glasser.camp at gmail.com
Tue Nov 13 17:19:02 PST 2012


Damien Cassou <damien.cassou at gmail.com> writes:

> 4) distribute the dependency with the rest of notmuch (in a separate
> "fallback-libs/" directory) and load it only when requiring the
> library with the standard load-path does not work. Jonas Bernoulli
> gave me a way to do that:
>
> ,----
> | (or (require 'THE-LIB nil t)
> |     (let ((load-path
> |           (cons (expand-file-name
> |                  "fallback-libs"
> |                  (file-name-directory (or load-file-name buffer-file-name)))
> |                 load-path)))
> |       (require 'THE-LIB)))
> `----
>
> What do you think?

Why not just append it to the *end* of load-path? Then it won't shadow
anything.

Ethan


More information about the notmuch mailing list