emacs-devel
[Top][All Lists]
Advanced

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

Re: how can frame-parameter proxy for make-variable-frame-local?


From: Stefan Monnier
Subject: Re: how can frame-parameter proxy for make-variable-frame-local?
Date: Sat, 29 Mar 2008 00:25:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> 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




reply via email to

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