From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Scott Heftler <lovecraftian@mac.com>
Cc: Emacs-devel@gnu.org
Subject: Re: how can frame-parameter proxy for make-variable-frame-local?
Date: Sat, 29 Mar 2008 00:25:11 -0400 [thread overview]
Message-ID: <jwvod8y88gn.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <16361122.post@talk.nabble.com> (Scott Heftler's message of "Fri, 28 Mar 2008 14:44:49 -0700 (PDT)")
> 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
next prev parent reply other threads:[~2008-03-29 4:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:44 how can frame-parameter proxy for make-variable-frame-local? Scott Heftler
2008-03-29 4:25 ` Stefan Monnier [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-03-28 20:01 lovecraftian
2008-03-29 10:37 ` Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvod8y88gn.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=Emacs-devel@gnu.org \
--cc=lovecraftian@mac.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.