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

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

Re: mutate list by appending a list (and similar for props)


From: Barry Margolin
Subject: Re: mutate list by appending a list (and similar for props)
Date: Mon, 08 Sep 2014 15:29:17 -0400
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <3710b1bf-1e23-4147-b6ea-40c360fb16b4@googlegroups.com>,
 Sam Halliday <sam.halliday@gmail.com> wrote:

> Hi all,
> 
> I often find that I am repeating calls to add-to-list (mutates) / plist-put 
> (immutable) in my .emacs [1] configuration against the same variable. I'd 
> like to be able to pass a list of elements to be appended/prepended to the 
> variable to save on boilerplate.
> 
> It would be trivial to write a little function that repeats the operation for 
> a list input, but I'd rather use something that is already in the emacs 
> distro (or at least in a very lightweight MELPA package).
> 
> Does such a thing exist?

The append function does it:

(setq list (append additional-list list))

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

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