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

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

Date: Fri, 09 Sep 2016 21:38:03 -0300

To: Steven Allen, notmuch@notmuchmail.org

Cc:

From: David Bremner


Steven Allen <steven@stebalien.com> writes:

> This sets up and runs all the correct hooks and reduces some redundancy.
> ---
>  emacs/notmuch-hello.el | 8 +-------
>  emacs/notmuch-show.el  | 7 +------
>  emacs/notmuch-tree.el  | 7 +------
>  emacs/notmuch.el       | 7 +------
>  4 files changed, 4 insertions(+), 25 deletions(-)
>
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 75ccf57..d582bff 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -671,7 +671,7 @@ with `notmuch-hello-query-counts'."
>    "Keymap for \"notmuch hello\" buffers.")
>  (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
>  
> -(defun notmuch-hello-mode ()
> +(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
>   "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.

The idea seems sane, but shouldn't we derive from special-mode?

d

Thread: