Re: [PATCH] emacs: use define-derived-mode for defining modes.

Subject: Re: [PATCH] emacs: use define-derived-mode for defining modes.

Date: Sat, 10 Sep 2016 11:08:57 +0300

To: Steven Allen, David Bremner, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Sat, Sep 10 2016, Steven Allen <steven@stebalien.com> wrote:

> [ Unknown signature status ]
>
> David Bremner <david@tethera.net> writes:
>> Steven Allen <steven@stebalien.com> writes:
>>
>>> This sets up and runs all the correct hooks and reduces some redundancy.
>>> ---
>>
>> The idea seems sane, but shouldn't we derive from special-mode?
>
> Special mode pre-defines some keybindings (although they appear to be
> similar, I haven't really looked into it). For precedent, gnus derives
> From fundamental-mode.

I patched the patch and changed fundamental-mode to special-mode --
read-only hello buffer prevented me to write custom search
(M-x toggle-read-only helped there)

I grepped emacs 24.5 sources derived-mo.*special-mo,
derived-mo.*fundamental-mo and derived-mo.*nil and line counts
were 48, 54 and 28, respectively.

all gnus modes (that use define-derived-mode) derive from fundamental
mode -- but perhaps gnus precedes special-mode (or not, it may be that
special mode were there before big bang (like all other stuff not created
by humans), who knows ;)

Anyway, I think it is safer choice to use fundamental-mode (don't know
about nil) than special-mode -- as there are so many corners in manual
testing that would need to be covered...

Tests passed using the original patch.

Tomi


>
> -- 
> Steven Allen
> ((Do Not Email <honeypot@stebalien.com>))
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

Thread: