[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add-to-list or setq append...
From: |
Richard Riley |
Subject: |
Re: Add-to-list or setq append... |
Date: |
Wed, 04 Aug 2010 00:41:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Andrea Crotti <andrea.crotti.0@gmail.com> writes:
> Just a curiosity, I was wondering why in so many README and doc they
> suggest to add elements to lists with something like:
>
>
>
> (setq list (append list element))
>
>
>
> instead of doing simply
>
>
> (add-to-list list-va element)
>
>
>
> Is there any good reason or is just historical heritage?
> I think add-to-list is even more smart adding only if not there already,
> then what's the point in using that ugly form?
>
With append you can append a list. e.g
(setq load-path (append load-path '("/usr/local/emacs/site-lisp"
"/usr/share/emacs/site-lisp")))
I don't know if add-to-list can do that?