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

Tomi Ollila tomi.ollila at iki.fi
Mon Nov 9 12:52:39 PST 2015


On Mon, Nov 09 2015, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:

> On Mon, Nov 09 2015, David Bremner wrote:
>> 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.
>
> OK. I'll try implement notmuch-message-mail as a simpler alternative to
> message-mail. Let's see how it will look like.

that might be better than my vague thought of let-binding that particular
hook (to nil) and run-hooks it later...

Tomi (sending from my N9)
 
>
>>
>>> 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.
>
> Hopefully, advises won't be needed then.
>
> Thanks,
> -Michal
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list