[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
frame-local variables weirdness
From: |
Juanma Barranquero |
Subject: |
frame-local variables weirdness |
Date: |
Tue, 5 Dec 2006 14:41:34 +0100 |
After making a variable frame-local, and then buffer-local (with
`make-variable-buffer-local', not `make-local-variable') it is not
possible to set a buffer-local value for the variable:
ELISP> (setq foo 'default)
default
ELISP> (make-variable-frame-local 'foo)
foo
ELISP> (modify-frame-parameters nil '((foo . frame)))
nil
ELISP> foo
frame
ELISP> (make-variable-buffer-local 'foo)
foo
ELISP> (setq foo 'bug)
bug
ELISP> foo
bug
ELISP> (frame-parameter nil 'foo)
bug
ELISP> (local-variable-p 'foo)
nil
However, that doesn't happen if we first make it buffer-local, and
then frame-local:
ELISP> (setq bar 'default)
default
ELISP> (make-variable-buffer-local 'bar)
bar
ELISP> (setq bar 'buffer)
buffer
ELISP> (local-variable-p 'bar)
t
ELISP> (make-variable-frame-local 'bar)
bar
ELISP> (modify-frame-parameters nil '((bar . frame)))
nil
ELISP> bar
buffer
ELISP> (kill-local-variable 'bar)
bar
ELISP> bar
frame
BTW, is there a way to know when a variable is frame local?
`frame-parameter' is not enough (it could be a frame parameter and yet
not a frame local variable).
/L/e/k/t/u
- frame-local variables weirdness,
Juanma Barranquero <=
Re: frame-local variables weirdness, Juanma Barranquero, 2006/12/09
Re: frame-local variables weirdness, Richard Stallman, 2006/12/11