GNU bug report logs -
#5371
Priority of different kind of local variable bindings
Previous Next
Full log
Message #11 received at 5371 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jan 13, 2010 at 3:41 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> I can't find a description in the manual of the priority of different
>> kind of local variables. Can that please be added to the manual?
>
> What do you mean by "priority of different kind of local variables"?
I just meant which value is active at a certain point.
I saw a strange thing working with mumamo and the js.el problem, but I
have not understod yet. I have kind of solved it, but I don't know
why. Here is some code that perhaps is related. Look at the value at
"ff". Is not that a bit surprising?
(defun temp-var-display (where)
(message "%s temp-var: u=%s, b=%s d=%s" where
temp-var
(buffer-local-value 'temp-var (current-buffer))
(default-value 'temp-var)))
(defvar temp-var "global")
(set (make-local-variable 'temp-var) "buffer-1")
(temp-var-display "bb")
(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"))
(temp-var-display "gg"))
(temp-var-display "hh")
(kill-local-variable 'temp-var)
(temp-var-display "ii")
bb temp-var: u=buffer-1, b=buffer-1 d=global
cc temp-var: u=buffer-2, b=buffer-2 d=global
dd temp-var: u=let, b=let d=global
ff temp-var: u=global, b=global d=global
gg temp-var: u=global, b=global d=global
hh temp-var: u=buffer-1, b=buffer-1 d=global
ii temp-var: u=global, b=global d=global
This bug report was last modified 15 years and 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.