From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.help Subject: Re: mutate list by appending a list (and similar for props) Date: Thu, 18 Sep 2014 02:42:03 -0700 (PDT) Message-ID: <06dfd514-f8d3-496a-9646-e26d0c8ed663@googlegroups.com> References: <3710b1bf-1e23-4147-b6ea-40c360fb16b4@googlegroups.com> <82917bd2-a3dc-4521-b1d3-45680b0a4402@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1411033586 24987 80.91.229.3 (18 Sep 2014 09:46:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 09:46:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 11:46:20 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUYI7-0006Gg-6B for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 11:46:19 +0200 Original-Received: from localhost ([::1]:49452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYI6-0001mA-Mt for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 05:46:18 -0400 X-Received: by 10.50.129.42 with SMTP id nt10mr3965307igb.7.1411033324299; Thu, 18 Sep 2014 02:42:04 -0700 (PDT) X-Received: by 10.182.246.69 with SMTP id xu5mr40635obc.9.1411033324174; Thu, 18 Sep 2014 02:42:04 -0700 (PDT) Original-Path: usenet.stanford.edu!h3no499803igd.0!news-out.google.com!ef6ni14504igb.0!nntp.google.com!h15no840237igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <82917bd2-a3dc-4521-b1d3-45680b0a4402@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.244.128.25; posting-account=kRukCAoAAAANs-vsVh9dFwo5kp5pwnPz Original-NNTP-Posting-Host: 83.244.128.25 User-Agent: G2/1.0 Injection-Date: Thu, 18 Sep 2014 09:42:04 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:207728 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100001 Archived-At: On Thursday, 18 September 2014 10:37:52 UTC+1, Sam Halliday wrote: > On Monday, 8 September 2014 20:29:17 UTC+1, Barry Margolin wrote: > > > Sam Halliday wrote: > > > > 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)) > > > > > > Thanks! But that's not ideal because it involves repeating the list symbol (which can often be quite long). (It also doesn't work when the original list is nil)