* how can frame-parameter proxy for make-variable-frame-local?
@ 2008-03-28 21:44 Scott Heftler
2008-03-29 4:25 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Scott Heftler @ 2008-03-28 21:44 UTC (permalink / raw)
To: Emacs-devel
I've written an elisp program that depends on frame-local variables.
But now when I compile my module, I get ...
Warning: `make-variable-frame-local' is an obsolete
function (as of Emacs 22.2); use a frame-parameter instead.
OK. So what's the most elegant way to do this? Here's my dumb way:
(1) To init VAR to VAL and make it frame-local for the current frame,
I do
(modify-frame-parameters nil '(VAR . VAL))
And then *every time* I want to reset its value, I have to do this
again?
(2) And *every time* I want to simply access its value, I have to do
(frame-parameter nil 'VAR)
Is this correct? Can you think of a macro that will make this process
as neat as a simple `setq' (to set) and a simple token (to access)?
Or am I just fantasizing? :thinking:
--
View this message in context: http://www.nabble.com/how-can-frame-parameter-proxy-for-make-variable-frame-local--tp16361122p16361122.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: how can frame-parameter proxy for make-variable-frame-local?
2008-03-28 21:44 how can frame-parameter proxy for make-variable-frame-local? Scott Heftler
@ 2008-03-29 4:25 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2008-03-29 4:25 UTC (permalink / raw)
To: Scott Heftler; +Cc: Emacs-devel
> I've written an elisp program that depends on frame-local variables.
> But now when I compile my module, I get ...
> Warning: `make-variable-frame-local' is an obsolete
> function (as of Emacs 22.2); use a frame-parameter instead.
> OK. So what's the most elegant way to do this? Here's my dumb way:
> (1) To init VAR to VAL and make it frame-local for the current frame,
> I do
> (modify-frame-parameters nil '(VAR . VAL))
Try (set-frame-parameter nil 'VAR VAL)
> And then *every time* I want to reset its value, I have to do this
> again?
> (2) And *every time* I want to simply access its value, I have to do
> (frame-parameter nil 'VAR)
> Is this correct? Can you think of a macro that will make this process
> as neat as a simple `setq' (to set) and a simple token (to access)?
No. Why is it a problem?
> Or am I just fantasizing? :thinking:
Of course, you can also live with the warning.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-29 4:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 21:44 how can frame-parameter proxy for make-variable-frame-local? Scott Heftler
2008-03-29 4:25 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).