From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: (setq x (plist-put x :new 'value)) Date: Sat, 22 Aug 2009 00:08:25 +0200 Message-ID: <87hbw0es6e.fsf@x2.delysid.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250892577 29215 80.91.229.12 (21 Aug 2009 22:09:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2009 22:09:37 +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:09:29 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 1MecIa-00012q-TS for ged-emacs-devel@m.gmane.org; Sat, 22 Aug 2009 00:09:29 +0200 Original-Received: from localhost ([127.0.0.1]:49690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MecIa-000326-3t for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2009 18:09:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MecIV-00031j-Ub for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:09:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MecIR-00031L-2s for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:09:23 -0400 Original-Received: from [199.232.76.173] (port=45785 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MecIQ-00031I-VI for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:09:19 -0400 Original-Received: from viefep20-int.chello.at ([62.179.121.40]:30357) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MecIQ-0002VG-9D for emacs-devel@gnu.org; Fri, 21 Aug 2009 18:09:18 -0400 Original-Received: from edge01.upc.biz ([192.168.13.236]) by viefep20-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090821220910.JNK9018.viefep20-int.chello.at@edge01.upc.biz> for ; Sat, 22 Aug 2009 00:09:10 +0200 Original-Received: from x2.delysid.org ([84.115.136.207]) by edge01.upc.biz with edge id XA991c04R4UfZvY01A9Azl; Sat, 22 Aug 2009 00:09:10 +0200 X-SourceIP: 84.115.136.207 Original-Received: from mlang by x2.delysid.org with local (Exim 4.69) (envelope-from ) id 1MecHa-0006sC-9Z for emacs-devel@gnu.org; Sat, 22 Aug 2009 00:08:26 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:114498 Archived-At: Hi. The docstring of plist-put reads: ------ (plist-put PLIST PROP VAL) Change value in PLIST of PROP to VAL. PLIST is a property list, which is a list of the form (PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object. If PROP is already a property on the list, its value is set to VAL, 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? --- a/src/fns.c +++ b/src/fns.c @@ -2005,8 +2005,7 @@ DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, PLIST is a property list, which is a list of the form \(PROP1 VALUE1 PROP2 VALUE2 ...). PROP is a symbol and VAL is any object. If PROP is already a property on the list, its value is set to VAL, -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. +otherwise the new PROP VAL pair is added. The new plist is returned. The PLIST is modified by side effects. */) (plist, prop, val) Lisp_Object plist; --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95