[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: two ways of adding a path to the list variable load-path. equivalent
From: |
Nikolaj Schumacher |
Subject: |
Re: two ways of adding a path to the list variable load-path. equivalent? |
Date: |
Wed, 20 May 2009 14:50:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (darwin) |
Nobuko Three <nbko3@yahoo.com> wrote:
> 1.
> (setq load-path (cons "~/elisp/" load-path))
>
> 2.
> (add-to-list 'load-path "~/elisp/")
>
> Are there any situation where one would prefer one over another?
As you probably know from the documentation of add-to-list, it will test
whether the directory is already included before adding it another time.
The downside of add-to-list is, adding the path will be slightly slower (and
increasingly slower with the size of the list). The downside of consing
is that duplicates might slow down loading a bit.
I'd suggest add-to-list, but the difference is negligible.
regards,
Nikolaj Schumacher