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: jack-mac
Subject: Re: Help needed with defadvice
Date: Sat, 23 Nov 2013 00:35:03 -0800 (PST)
User-agent: G2/1.0

Le vendredi 22 novembre 2013 16:50:02 UTC+1, Perry Smith a écrit :
> On perhaps a side note, the documentation for make-variable-buffer-local 
> has this curious sentence:
> 
>> Note that binding the variable with `let', 
>> does not make the variable buffer-local.
> 
> I think I'm doing the 2nd phrase -- right?

I don't think so!

They probably mean:
>> or setting it while a `let'-style binding OF THIS SAME VARIABLE
>> made in this buffer is in effect,

Something like:
(with-current-buffer (current-buffer)
  (let ((my-var 'foo))
    (set (make-local-variable 'my-var) 'bar)
    (message "inside let, my-var is %s" my-var))
  (message "outside let, my-var is %s" (if (boundp 'my-var) my-var '_undef_)))

> But then I get confused and
> I don't understand why my other example works because it is inside
> a let binding a well.  Even if I remove my let, I am likely going to be
> inside a let but whoever is calling down to the function I am advising.

HTH
)jack(


reply via email to

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