]> git.notmuchmail.org Git - notmuch/commit
emacs: Improve notmuch-message-mode initialization
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 21 Dec 2015 09:41:15 +0000 (10:41 +0100)
committerDavid Bremner <david@tethera.net>
Fri, 1 Jan 2016 14:58:19 +0000 (10:58 -0400)
commit570c0aeb40bd0c3af8174624a55e968f62c44f09
tree08e46757202534a88f3a24b0235bc65f7a2dff04
parentb645f416059f128ea49991745b648c7ffa045ccc
emacs: Improve notmuch-message-mode initialization

Recent addition of notmuch-message-mode introduced several problems:

1. When message-setup-hook is used to set buffer local variables,
   these settings are not effective, because all buffer local
   variables are immediately erased by notmuch-message-mode
   initialization.

2. message-mode-hook gets invoked twice - first when message-mail
   invokes message-mode and second when notmuch-mua-mail invokes
   notmuch-message-mode.

This commit fixes these problems by replacing a call to message-mail
with notmuch-specific code that is (hopefully) equivalent to
message-mail functionality before introduction of
notmuch-message-mode.

We first initialize notmuch-message-mode with
notmuch-mua-pop-to-buffer, which is a modified version of
message-pop-to-buffer and then call message-setup-1, which is the only
functionality of message-mail that is needed for notmuch.
emacs/notmuch-mua.el