[PATCH] emacs: Fix regression in (notmuch-)message-mode initialization

David Bremner david at tethera.net
Mon Nov 9 04:17:44 PST 2015


Michal Sojka <sojkam1 at fel.cvut.cz> writes:

> This commit uses advice mechanism to call notmuch-message-mode instead
> of message-mode. This way, a call to message-mail initializes directly
> notmuch-message-mode rather than message-mode which is later changed
> to notmuch-message-mode. The advice is constructed in such a way, that
> it is effective only once and when called by notmuch. The second call
> to message-mode (from notmuch-message-mode) calls the original
> message-mode.

I wanted to answer this with an alternative patch, but I haven't had
time.

I admit to being somewhat prejudiced against shipping code with advice
in it (IMHO it's fine for user specific customization, but not very
maintainable).

I think we might be better off in the long run replacing the call to
message-mail. Code duplication is obviously not great, but perhaps some
of the complexity of message-mail / message-pop-to-buffer can be
eliminated, since we don't need to support all of the use cases of
message-mail.

> This implementation uses the new advice mechanism introduced in Emacs
> 24.4. If we want to support older version, this must be changed.

We do try to support Emacs 23 still (except for some optional
features). Unfortunately old advice is even nastier.

d



More information about the notmuch mailing list