help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Help needed with defadvice


From: Perry Smith
Subject: Re: Help needed with defadvice
Date: Sat, 23 Nov 2013 10:24:10 -0600

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: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

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