From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: plist-put: destructive? Date: Sun, 22 Jan 2017 05:10:02 -0800 Message-ID: <87shobw89h.fsf@ericabrahamsen.net> References: <87mvelzgrr.fsf@ericabrahamsen.net> <8737gcxt4e.fsf@ericabrahamsen.net> <87tw8rx6he.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485096738 28746 195.159.176.226 (22 Jan 2017 14:52:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2017 14:52:18 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 22 15:52:14 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVJUz-0006Um-CM for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 15:52:05 +0100 Original-Received: from localhost ([::1]:36646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVJV4-0004ns-A6 for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 09:52:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVHut-0004wL-QP for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 08:10:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVHuq-0000ZA-KL for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 08:10:43 -0500 Original-Received: from [195.159.176.226] (port=48284 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cVHuq-0000Yy-Dd for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 08:10:40 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cVHuT-0004uY-L9 for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 14:10:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:lt91BABL7UOcrai3Ax93SIFjGjY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sun, 22 Jan 2017 09:49:31 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:112145 Archived-At: Philipp Stephani writes: > Eric Abrahamsen schrieb am So., 22. Jan. 2017 um > 01:57 Uhr: > >> Drew Adams writes: >> >> >> Thanks to you both. I'm working with existing plists, so I'll drop >> >> the setqs, that's a relief. >> > >> > Why is it a relief - a relief from what? What if something reset your >> "existing plist" to nil behind your back? >> >> The code I'm working has many repeated clauses looking like: >> >> (when thing1 >> (setq the-plist (plist-put the-plist :thing thing1))) >> >> A little more complicated than that, but there will be like seven of >> those in a row. Probably I should just write myself a custom >> bulk-conditional-plist-setter macro, probably using the gv setter, but >> for the time being just being able to remove all the "(setq the-plist" >> makes everything easier to read. >> > > You could also write > (cl-callf plist-put the-plist :thing thing1) Thanks, that was a new one for me!