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: Stefan Monnier
Subject: bug#5371: Priority of different kind of local variable bindings
Date: Wed, 13 Jan 2010 13:45:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

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

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.


        Stefan






reply via email to

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