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: Kim F. Storm
Subject: Re: let vs. buffer local bindings
Date: 10 May 2002 17:31:58 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Andreas Schwab <address@hidden> writes:

> 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::).
> 

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  <address@hidden>

        * 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  <address@hidden>

        * 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 <address@hidden> http://www.cua.dk




reply via email to

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