[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`append' vs. `nconc' (was: Re: Error: Setting the shell in sh-mode via a
From: |
Emanuel Berg |
Subject: |
`append' vs. `nconc' (was: Re: Error: Setting the shell in sh-mode via a local variable does not work) |
Date: |
Wed, 30 Dec 2015 16:41:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Teemu Likonen <tlikonen@iki.fi> writes:
> There you create a list MODES and then APPEND copies
> the whole list and joins it to AUTO-MODE-ALIST.
> The original list is discarded. No problem, it's
> just a configuration code. But in some other
> situation it might be good idea to construct the
> list only once and use NCONC which only traverses
> the lists through and modifies last conses to join
> it to the next list:
>
> (let ((modes (list '(a . b) ;; ... ))) (setq
> auto-mode-alist (nconc modes auto-mode-alist)))
So what you are saying, if `append' is replaced by
`nconc', the same thing happens, only one less list
has to be created?
I have several appends in my source, is there
a rule-of-thumb when to use `append' and when to use
`nconc'?
> The PROGN is redundant because LAMBDA has an implicit
> PROGN
OK, cool.
--
underground experts united
http://user.it.uu.se/~embe8573
- Error: Setting the shell in sh-mode via a local variable does not work, Johannes Kastl, 2015/12/28
- Re: Error: Setting the shell in sh-mode via a local variable does not work, Teemu Likonen, 2015/12/30
- `append' vs. `nconc' (was: Re: Error: Setting the shell in sh-mode via a local variable does not work),
Emanuel Berg <=
- Re: `append' vs. `nconc', Teemu Likonen, 2015/12/30
- Re: `append' vs. `nconc', Emanuel Berg, 2015/12/30
- Message not available
- Re: `append' vs. `nconc', Pascal J. Bourguignon, 2015/12/30
- Re: `append' vs. `nconc', Emanuel Berg, 2015/12/30
- Re: `append' vs. `nconc', tomas, 2015/12/31
- Re: `append' vs. `nconc', Emanuel Berg, 2015/12/31
- Message not available
- Re: `append' vs. `nconc', Pascal J. Bourguignon, 2015/12/31
- Re: `append' vs. `nconc', Emanuel Berg, 2015/12/30
- Message not available
- Re: `append' vs. `nconc', Pascal J. Bourguignon, 2015/12/31
- Re: `append' vs. `nconc', Emanuel Berg, 2015/12/31