From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.devel Subject: Re: (setq x (plist-put x :new 'value)) Date: Fri, 21 Aug 2009 18:49:04 -0400 (EDT) Message-ID: <20090821.184904.79662116.hanche@math.ntnu.no> References: <87hbw0es6e.fsf@x2.delysid.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250894970 2587 80.91.229.12 (21 Aug 2009 22:49:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2009 22:49:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 22 00:49:23 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MecvD-0006Tp-4Z for ged-emacs-devel@m.gmane.org; Sat, 22 Aug 2009 00:49:23 +0200 Original-Received: from localhost ([127.0.0.1]:46988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MecvC-0002oO-IP for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2009 18:49:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mecv6-0002o4-53 for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:49:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mecv1-0002nT-Fu for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:49:15 -0400 Original-Received: from [199.232.76.173] (port=56994 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mecv1-0002nL-AE for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:49:11 -0400 Original-Received: from abel.math.ntnu.no ([129.241.15.50]:50053) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mecv0-0008LC-IZ for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:49:10 -0400 Original-Received: (qmail 27590 invoked from network); 21 Aug 2009 22:49:07 -0000 Original-Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.102) by abel.math.ntnu.no with ESMTPA; 21 Aug 2009 22:49:07 -0000 In-Reply-To: <87hbw0es6e.fsf@x2.delysid.org> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.2.51 on Emacs 23.0.94 / Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114500 Archived-At: + Mario Lang : > The docstring of plist-put reads: > > ------ > [...] > otherwise the new PROP VAL pair is added. The new plist is returned; > use `(setq x (plist-put x prop val))' to be sure to use the new value. > The PLIST is modified by side effects. > ------ > > The last two lines seem like they are contradicting each other. > In fact, what plist-put really does if it has to add a new item is > setcdr on the last cons in the list. I kind of feel the second last line > in the docstring should be removed, since (setq x (plist-put x prop val)) > is not necessary. Or am I missing something? Yes: the plist could be empty in the first place. (setq plist nil) (plist-put plist :foo :bar) ; => (:foo :bar) plist ; => nil - Harald