help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding a whole directory subtree to load-path ?


From: Glenn Morris
Subject: Re: adding a whole directory subtree to load-path ?
Date: Tue, 22 Jul 2003 17:36:44 +0100
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Stephan Stahl wrote:

> I would like to add a whole subtree of a directory to the load-path.
> Pretty much the same way subdirs.el in the directory site-lisp
> works. All directories under site-lisp get appended to the load-path
> so it is enough to just drop some emacslisp packages into that
> directory or a subdir of it and one can use that package. Is there a
> easy way to get the same behavior on a user choosen directory? Right
> now i use this but it seems rather ugly...
>
> (if (fboundp 'normal-top-level-add-subdirs-to-load-path)
>     (let* ((my-lisp-dir "~/elisp/")
>          (default-directory my-lisp-dir))
>       (setq load-path (cons my-lisp-dir load-path))
>       (normal-top-level-add-subdirs-to-load-path)))

There is no better way, AFAIK. Personally, I think it would be nice if
the subdirs.el mechanism (which, as you say, is just a wrapper for
what your code does) was available for users to, err, use; but when I
suggested this on emacs-devel not so long ago it found no favour.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]