[Top][All Lists]

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

Re: Help needed with defadvice

From: Alex Kost
Subject: Re: Help needed with defadvice
Date: Sat, 23 Nov 2013 11:00:26 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Perry Smith (2013-11-23 05:41 +0400) wrote:

> Thanks... I attacked this from the opposite direction adding debug trying to 
> narrow down when the locals got killed.  I finally bumped into these lines:
> (defmacro define-derived-mode (child parent name &optional docstring &rest 
> body)
> ...
>        (interactive)
>                                       ; Run the parent.
>        (delay-mode-hooks
>         (,(or parent 'kill-all-local-variables))   <<<<<<<<<
>                                       ; Identify the child mode.
>         (setq major-mode (quote ,child))
>         (setq mode-name ,name)
> ...)
> I'm going to drive home and play with this some more but I predict that that 
> is what is killing my local variables.
> Does anyone know why this is there?
> I somewhat assumed I had this in some of my poop but this is stock emacs code 
> (24.3).

As for me, i don't see a reason for killing local variables there.  For
example i have some local variables and after "M-x text-mode" they all
die as text-mode is a derived-mode.  This behaviour doesn't seem right
to me.

Will you "M-x report-emacs-bug" about it? (to clarify why that is there)

reply via email to

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