From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: let vs. buffer local bindings Date: 10 May 2002 17:31:58 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xlmasxbm9.fsf@kfs2.cua.dk> References: <5xy9esxewc.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1021041194 16827 127.0.0.1 (10 May 2002 14:33:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 May 2002 14:33:14 +0000 (UTC) Cc: emacs-devel@gnu.org, Dave Pearson , Gareth Owen Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 176BSM-0004NI-00 for ; Fri, 10 May 2002 16:33:14 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 176BbU-0003TJ-00 for ; Fri, 10 May 2002 16:42:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 176BSF-0006Nt-00; Fri, 10 May 2002 10:33:08 -0400 Original-Received: from fepe.post.tele.dk ([195.41.46.137]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 176BQO-0006Cl-00 for ; Fri, 10 May 2002 10:31:12 -0400 Original-Received: from kfs2.cua.dk.cua.dk ([194.239.225.46]) by fepE.post.tele.dk (InterMail vM.4.01.03.23 201-229-121-123-20010418) with SMTP id <20020510143111.HALQ6079.fepE.post.tele.dk@kfs2.cua.dk.cua.dk>; Fri, 10 May 2002 16:31:11 +0200 Original-To: Andreas Schwab In-Reply-To: Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3812 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3812 Andreas Schwab writes: > storm@cua.dk (Kim F. Storm) writes: > > |> Gareth Owen has found a peculiar > |> interference between let and buffer local bindings. > > *Note Introduction to Buffer-Local Variables: (elisp)Intro to > Buffer-Local. > > *Warning:* When a variable has buffer-local values in one or more > buffers, you can get Emacs very confused by binding the variable with > `let', changing to a different current buffer in which a different > binding is in effect, and then exiting the `let'. This can scramble > the values of the buffer-local and default bindings. > > To preserve your sanity, avoid using a variable in that way. If you > use `save-excursion' around each piece of code that changes to a > different current buffer, you will not have this problem (*note > Excursions::). > I see. But I had got the impression that the following changes to specbind were supposed to remove that limitation.... I'm obviously mistaken: 2001-07-05 Gerd Moellmann * eval.c (specbind): Additionally record the buffer that was current when a buffer-local or frame-local variable was bound. 2001-07-03 Gerd Moellmann * eval.c (specbind): If SYMBOL has a frame-local binding, record the frame on the binding stack. Change format of entries for local bindings on the binding stack to '(SYMBOL . WHERE)'. (unbind_to): Handle unbinding a frame-local variable. -- Kim F. Storm http://www.cua.dk