From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#9469: buffer-local variables seem to remember previous values Date: Sun, 11 Sep 2011 10:56:29 -0700 Message-ID: <95CFAF98BEBE4DFAB885B85F02126C57@us.oracle.com> References: <70AD30BE45C847BE828A3E8A71280A8E@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1315763814 28731 80.91.229.12 (11 Sep 2011 17:56:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2011 17:56:54 +0000 (UTC) Cc: 9469@debbugs.gnu.org To: "'Le Wang'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 19:56:50 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 1R2oGv-0006ME-MW for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 19:56:50 +0200 Original-Received: from localhost ([::1]:46029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2oGv-0004rn-CA for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 13:56:49 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2oGt-0004ri-0G for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 13:56:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R2oGr-0006Hx-MS for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 13:56:46 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2oGr-0006Ht-Kt for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 13:56:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R2oKz-0005nS-Oi; Sun, 11 Sep 2011 14:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2011 18:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9469 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9469-submit@debbugs.gnu.org id=B9469.131576405522269 (code B ref 9469); Sun, 11 Sep 2011 18:01:01 +0000 Original-Received: (at 9469) by debbugs.gnu.org; 11 Sep 2011 18:00:55 +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 1R2oKr-0005n7-Uy for submit@debbugs.gnu.org; Sun, 11 Sep 2011 14:00:54 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R2oKp-0005mz-6E for 9469@debbugs.gnu.org; Sun, 11 Sep 2011 14:00:52 -0400 Original-Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p8BHuVCq010518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 Sep 2011 17:56:33 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p8BHuUv0019003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Sep 2011 17:56:31 GMT Original-Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p8BHuPgI002830; Sun, 11 Sep 2011 12:56:25 -0500 Original-Received: from dradamslap1 (/10.159.62.110) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 11 Sep 2011 10:56:25 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acxwo/PZUIwvfUMzSLyvyv5X+2jP/wAAe2jw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090204.4E6CF651.00D7,ss=1,re=0.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 11 Sep 2011 14:01: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:50945 Archived-At: > > No, they should not be identical. BTW, I should have said "It is not the case that they should be = identical." Not quite the same thing. There is no "should" here. AFAIK, most Lisps do = not prescribe the behavior in this regard - it is up to the implementation. = But I'm no expert on just what various Lisps define wrt this. > >=A0This is a classic Lisp gotcha. > Thanks for the pointer, Drew. >=20 > I was unable to google up any information regarding this as being a > classic gotcha. Do you have any references? No, I would have to google also. I said it's "classic", which probably = really means that I was bitten by the same gotcha many, many moon ago, and I = learned my lesson then, in discussion with people who knew Lisp well. Well, a quick google of "lisp quote list" brings me to this: http://stackoverflow.com/questions/134887/when-to-use-quote-in-lisp Search that page for "DO NOT USE QUOTE TO CREATE LISTS THAT YOU WILL = LATER MODIFY". It says, "The spec allows the compiler to treat quoted lists = as constants." I guess it might be referring to the Common Lisp spec; = dunno. Scroll down further to the explanation by Matthias Benkard. He points = out that when you use (quote (a b c)) the list (a b c) is created (the first = time) by the Lisp loader or reader, not by `quote'. `quote' just returns that = already existing list. `quote' does not create new list structure (or new = symbols or new strings or...). You can probably find other, similar explanations by googling. The real lesson, I think, is what I said earlier, which works for all = Lisps: Do not expect `quote' to create new list structure. > If this is in fact "by design", then the manual should definitely say > so in the quoting section. Do I have to follow a different procedure > to file a documentation bug? I don't think the Elisp manual should say anything about it, but I'll = let others decide that. The takeaway is, I think, that you should not depend on '(...) to create = new list structure each time it is evaluated. I suppose the manual could = say that. Or it could perhaps clarify that `quote' does not create new Lisp = objects; it just returns the object that is its argument, unevaluated. What can = confuse people is that the object already exists; it is provided by the reader = (or the loader). I guess you could say that the reader treats list notation it encounters similarly to what it does for symbol notation: if a symbol with the = encountered name already exists then it uses ("returns") that symbol. Otherwise, it = first creates a symbol with that name. IOW, the reader `intern's names it = encounters. Similarly, it handles list notation it encounters by either creating a = new list or returning an existing one. Again, I'm no expert on this. Perhaps someone else can explain it = better.