emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: let vs. buffer local bindings


From: Andreas Schwab
Subject: Re: let vs. buffer local bindings
Date: Fri, 10 May 2002 15:32:08 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (ia64-suse-linux)

address@hidden (Kim F. Storm) writes:

|> Gareth Owen <address@hidden> 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, address@hidden
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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]