Michal Sojka <sojkam1@fel.cvut.cz> writes: > 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. This doesn't break anything for me, and looks fairly sane. I'm not sure if the indirectrion of notmuch-mua-get-switch-function is still needed, but that can wait for an optional followup patch.