From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#9261: `let' behavior is strange Date: Mon, 08 Aug 2011 19:15:53 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1312823828 508 80.91.229.12 (8 Aug 2011 17:17:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2011 17:17:08 +0000 (UTC) Cc: 9261@debbugs.gnu.org To: =?UTF-8?Q?=E5=B0=8F=E6=B1=9F=E6=B2=88?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 08 19:17:04 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QqTRn-00089Z-Fi for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Aug 2011 19:17:03 +0200 Original-Received: from localhost ([::1]:49269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTRn-0003KN-09 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Aug 2011 13:17:03 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTRk-0003Jn-AJ for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2011 13:17:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqTRj-0004bd-3h for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2011 13:17:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqTRj-0004bX-1v for bug-gnu-emacs@gnu.org; Mon, 08 Aug 2011 13:16:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QqTSj-000130-Oc; Mon, 08 Aug 2011 13:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Aug 2011 17:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9261 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9261-submit@debbugs.gnu.org id=B9261.13128238233952 (code B ref 9261); Mon, 08 Aug 2011 17:18:01 +0000 Original-Received: (at 9261) by debbugs.gnu.org; 8 Aug 2011 17:17:03 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QqTRn-00011g-6i for submit@debbugs.gnu.org; Mon, 08 Aug 2011 13:17:03 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QqTRj-00011E-IU for 9261@debbugs.gnu.org; Mon, 08 Aug 2011 13:17:00 -0400 Original-Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 74F9C1C01D83; Mon, 8 Aug 2011 19:15:55 +0200 (CEST) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 47DCE1C000A5; Mon, 8 Aug 2011 19:15:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id rv9xURvhw871; Mon, 8 Aug 2011 19:15:55 +0200 (CEST) Original-Received: from igel.home (ppp-88-217-127-53.dynamic.mnet-online.de [88.217.127.53]) by mail.mnet-online.de (Postfix) with ESMTP; Mon, 8 Aug 2011 19:15:54 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id E87B6CA293; Mon, 8 Aug 2011 19:15:53 +0200 (CEST) X-Yow: I'm not an Iranian!! I voted for Dianne Feinstein!! In-Reply-To: ("=?UTF-8?Q?=E5=B0=8F=E6=B1=9F=E6=B2=88?="'s message of "Mon, 8 Aug 2011 15:49:04 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 08 Aug 2011 13:18:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:49952 Archived-At: 小江沈 writes: > (progn (put 'defun 'x "out") > (let ((old (plist-member (symbol-plist 'defun) 'x))) > (message "old: %s." old) > (put 'defun 'x "in") > (message "old: %s." old) > nil)) > > When I eval this form, I get something like this in *message* buffer: > old: (x out). > old: (x in). > nil This has nothing to do with let. plist-member returns a tail of the property list, and when the value of an existing property is changed only the cdr of the cons cell is overwritten by put, so the reference to the cons cell in `old' will follow the change. > If it is not a bug, how can I save the prev symbol property? Use plist-get or get to extract the property value, or make a copy. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."