bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#5371: Priority of different kind of local variable bindings


From: Lennart Borgman
Subject: bug#5371: Priority of different kind of local variable bindings
Date: Wed, 13 Jan 2010 19:50:11 +0100

On Wed, Jan 13, 2010 at 7:45 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> What do you mean by "priority of different kind of local variables"?
>> I just meant which value is active at a certain point.
>
> It's not based on priorities.
>
>> (with-temp-buffer
>>   (set (make-local-variable 'temp-var) "buffer-2")
>>   (temp-var-display "cc")
>
>>   (let ((temp-var "let"))
>>     (temp-var-display "dd")
>
>>     (kill-local-variable 'temp-var)
>>     (temp-var-display "ff"))
>
> The `let' binding affects the currently "active" slot, so in this case
> it affects the buffer-local slot.  So after kill-local-variable, this
> binding is lost.


Ok, I see.


> Note that mixing let-binding and buffer-local bindings is generally
> discouraged.  The only known reasonably sane semantics for such a mix is
> when the variable is always buffer-local.  If you mix `let' with
> make-local-variable and kill-local-variable you're really asking
> for trouble.


I know ;-)

Is this explained somewhere (except for the code)?






reply via email to

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