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

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

Re: multiple load-paths?


From: Mike Mattie
Subject: Re: multiple load-paths?
Date: Wed, 5 Dec 2007 01:58:13 -0800

On Sat, 24 Nov 2007 17:05:15 +0100
address@hidden (Johan Bockgård) wrote:

> someusernamehere <address@hidden> writes:
> 
> > (setq load-path (cons (expand-file-name "~/lisp") load-path))
> > (setq load-path (cons (expand-file-name "~/repos") load-path))
> > (setq load-path (cons (expand-file-name "~/testing") load-path))
> > (setq load-path (cons (expand-file-name "~/elisp") load-path))
> >
> > there is a way to do this more "posh" ?, I mean may be in one line o
> > something similar?
> 
> I'd prefer
> 
>     (add-to-list 'load-path "~/lisp")
>     (add-to-list 'load-path "~/repos")
>     (add-to-list 'load-path "~/testing")
>     (add-to-list 'load-path "~/elisp")
> 
> (add-to-list is shorter and avoids adding duplicates to load-path if
> .emacs is reloaded.  expand-file-name shouldn't be necessary)
> 
> You could use a loop, but having one line per entry is more
> grep-friendly. 
>

this is my flavor. The version above is superior in that it filters dups, but I 
don't see that
as a serious problem for small cases.
 
(setq load-path
  (append
    ;; overide distributed elisp with local modifications by
    ;; inserting a "local" directory at the beginning of the
    ;; load list
    (cons localized-source-dir load-path)

    ;; add the extras to the end of the list.
    (list extras-source-dir)
    ))

in this version anything you want to override emacs goes in 
localized-source-dir, while anything that is an add-on
can simply go in the list at the end.

Attachment: signature.asc
Description: PGP signature


reply via email to

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