From: Perry Smith <pedzsan@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Help needed with defadvice
Date: Sat, 23 Nov 2013 10:24:10 -0600 [thread overview]
Message-ID: <29DD542E-257A-4D4A-B673-134186706B12@gmail.com> (raw)
In-Reply-To: <jwv38mnxh67.fsf-monnier+gmane.emacs.help@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1929 bytes --]
On Nov 23, 2013, at 9:38 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> (defadvice kill-all-local-variables (around inherit activate)
>> "We want inherited variables to survive a call to this function"
>> (let* ((set-list (mapcar (lambda ( v )
>> (cons v (symbol-value v)))
>> inherited-alist)))
>> ad-do-it
>> (mapcar (lambda ( c )
>> (set (car c) (cdr c)))
>> set-list)))
>
>> How about an extra blurb in the documentation for make-variable-buffer-local
>
> Which documentation? The Elisp manual talks about it, as well as about
> the `permanant-local' property, which you might like to use.
I was thinking about this documentation:
> make-variable-buffer-local is an interactive built-in function in `C
> source code'.
>
> (make-variable-buffer-local VARIABLE)
>
> Make VARIABLE become buffer-local whenever it is set.
> At any time, the value for the current buffer is in effect,
> unless the variable has never been set in this buffer,
> in which case the default value is in effect.
> Note that binding the variable with `let', or setting it while
> a `let'-style binding made in this buffer is in effect,
> does not make the variable buffer-local. Return VARIABLE.
>
> In most cases it is better to use `make-local-variable',
> which makes a variable local in just one buffer.
>
> The function `default-value' gets the default value and `set-default' sets it.
I see permanent-local is mentioned in kill-all-local-variables but I don't
know to go to that documentation. I generally use describe-function
and describe-variable inside emacs and rarely go to the elisp manual
although I was using it for help with advice the past few days.
I view the elisp manual as a "book" and go there to read up on entire
topics but if I *think* I know what I'm doing, I don't use it. Perhaps I
need to change that habit.
Perry
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2013-11-23 16:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 2:45 Help needed with defadvice Perry Smith
2013-11-22 6:27 ` Eric Abrahamsen
2013-11-22 7:09 ` Alex Kost
2013-11-22 15:50 ` Perry Smith
2013-11-22 21:56 ` Alex Kost
2013-11-23 1:41 ` Perry Smith
2013-11-23 7:00 ` Alex Kost
2013-11-23 14:48 ` Stefan Monnier
2013-11-23 15:22 ` Perry Smith
2013-11-23 15:38 ` Stefan Monnier
2013-11-23 16:24 ` Perry Smith [this message]
2013-11-24 18:21 ` Stefan Monnier
2013-11-23 15:43 ` Alex Kost
[not found] ` <mailman.6834.1385135422.10748.help-gnu-emacs@gnu.org>
2013-11-23 8:35 ` jack-mac
2013-11-22 14:44 ` Stefan Monnier
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=29DD542E-257A-4D4A-B673-134186706B12@gmail.com \
--to=pedzsan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.