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 09:22:35 -0600

On Nov 23, 2013, at 8:48 AM, Stefan Monnier <address@hidden> wrote:

>>        (,(or parent 'kill-all-local-variables))   <<<<<<<<<
> [...]
>> Does anyone know why this is there?
> 
> Read the Elisp manual's description of what a major mode should do.
> Buffer-local variables are (in their majority) specific a particular
> major mode, hence they are reset when the major mode changes.

Ok.  Alex suggested a bug report.  I guess I will hold off on that.  I have it
written up ready to send.  Let me know if you would prefer it sent or not.

I got around the issue with:

(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
(and / or) make-local-variable that notes that they are usually killed when
entering a new mode?  It was clear that someone was killing the variables
but it was hard for me to track down who it was.

Thank you again to all who helped me out.

Perry

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

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