emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] new single file package: mpdired.el


From: Philip Kaludercic
Subject: Re: [ELPA] new single file package: mpdired.el
Date: Sun, 10 Mar 2024 18:15:38 +0000

Manuel Giraud <manuel@ledu-giraud.fr> writes:

> Manuel Giraud <manuel@ledu-giraud.fr> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>> [...]
>>
>>>> (defun mpdired-mode ()
>>>
>>> Why not use `define-derived-mode'?
>>
>> I have tried to do so but for whatever reason this completely messes up
>> the way I'm saving state in buffer local variables.  FWIW, I have tried
>> with parent as nil and special-mode with the same result.

This is because nil will just call `kill-all-local-variables',
and if you specify, special-mode it will call `kill-all-local-variables'
for you.

> It seems to be because `define-derived-mode' calls
> `kill-all-local-variables' (line 254 of derived.el).  Maybe this could
> be optional.  WDYT?

Theoretically you can do this by setting PARENT to `ignore', but I
wouldn't advise doing this.  Feels wrong...  The other solution would be
to use dynamic variables and bind them before calling `mpdired-mode'.

-- 
        Philip Kaludercic on icterid



reply via email to

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