From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: let vs. buffer local bindings Date: Fri, 10 May 2002 15:32:08 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <5xy9esxewc.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1021038678 11634 127.0.0.1 (10 May 2002 13:51:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 May 2002 13:51:18 +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 176Anm-00031W-00 for ; Fri, 10 May 2002 15:51:18 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 176Awt-0002YI-00 for ; Fri, 10 May 2002 16:00:44 +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 176Anp-0003uU-00; Fri, 10 May 2002 09:51:21 -0400 Original-Received: from ns.suse.de ([213.95.15.193] helo=Cantor.suse.de) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 176AmU-0003pS-00 for ; Fri, 10 May 2002 09:49:59 -0400 Original-Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id 92B911E65A; Fri, 10 May 2002 15:32:21 +0200 (MEST) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f Original-To: storm@cua.dk (Kim F. Storm) X-Yow: You can't hurt me!! I have an ASSUMABLE MORTGAGE!! In-Reply-To: <5xy9esxewc.fsf@kfs2.cua.dk> (storm@cua.dk's message of "10 May 2002 16:21:07 +0200") Original-Lines: 26 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (ia64-suse-linux) 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:3809 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3809 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::). Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."