[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
message.el and browse-url.el interaction [was: Re: BUG: notmuch-emacs-mu
message.el and browse-url.el interaction [was: Re: BUG: notmuch-emacs-mua wrong signing MML placement]
Thu, 12 Dec 2019 09:46:28 +0000
On Wednesday, 2019-12-11 at 13:55:16 -05, Robbie Harwood wrote:
> My emacs config contains `(add-hook 'message-setup-hook
> 'mml-secure-sign-pgpmime)` as recommended in the emacstips
> However, when I run (something like):
> notmuch-emacs-mua 'mailto:testto?body=testbody'
> I get an email in which the requested body contents appear *before* the
> signing MML. If I understand correctly how this all fits together, that
> won't do the right thing - but at any rate, it's unexpected.
This is an unfortunate interaction between message.el and browse-url.el
and isn't specific to notmuch or notmuch-emacs-mua.
You can see the same behaviour in “emacs -Q -q” if you execute:
(add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)
Given that, it's not something that we should be fixing in notmuch
itself, as it's an emacs bug.
The problem is that `browse-url-mail' always inserts the body after the
header separator, which in this case happens after
`mml-secure-sign-pgpmime' has already inserted the MML header.
Having `browse-url-mail' insert the body at the end of the message would
work for this case, but would presumably make a mess of situations where
someone inserts their signature block via `message-setup-hook'.
Perhaps `browse-url-mail' should skip past any MML headers before
inserting the body? That's a bit messy, as browse-url.el currently
doesn't know anything about MML.
The nicest fix would perhaps be to have `compose-mail' accept the
initial body as a parameter, which would eventually flow into the
relevant code in message.el which could do the right thing (which I
think would just be to skip past MML headers before inserting the body).
Any advice from emacs-devel on how to move forward? I'm happy to produce
a patch for whatever solution is considered most appropriate.
If the girls start moving the boys will start moving.
- message.el and browse-url.el interaction [was: Re: BUG: notmuch-emacs-mua wrong signing MML placement],
David Edmondson <=