From: David Edmondson <dme@dme.org>
To: Tim Quelch <tim@tquelch.com>, notmuch@notmuchmail.org
Subject: Re: emacs: `message-send-hook` being called twice
Date: Tue, 18 Aug 2020 10:53:05 +0100 [thread overview]
Message-ID: <m2v9hg9t6m.fsf@dme.org> (raw)
In-Reply-To: <87mu2swv37.fsf@quelch.name>
On Tuesday, 2020-08-18 at 12:23:24 +10, Tim Quelch wrote:
> Hi all,
>
> I've been working through a bug that I've been having with org-msg
> (https://github.com/jeremy-compostella/org-msg/issues/58#issuecomment-675177076)
> and it looks like a bug in the internals of notmuch.
>
> It appears as though the `message-send-hooks` are being called twice,
> 1. In `notmuch-mua-send-common` when `notmuch-mua-send-hook` are run
> (which by default is set to `notmuch-mua-message-send-hook`, which just
> runs `message-send-hook`)
> 2. When `notmuch-mua-send-common` delegates sending of the message to
> `message-send` or `message-send-and-exit`. These functions both run `message-send-hook`
>
> The specific issue this was causing in org-msg was that the message was
> being converted to html twice, causing raw html to be included in the
> sent message. This kind of issue could easily pop up again with other
> non-idempotent hook functions.
>
> I was wondering what the design descision was to set up
> `notmuch-mua-send-hook` to delegate to running `message-send-hook` when
> this is already done in `message-send`
Honestly, I don't remember. It was a long time ago.
> If this was not intentional, I don't think `notmuch-mua-send-hook` needs
> to contain `notmuch-mua-message-send-hook` by default.
I agree that it's a bug - `notmuch-mua-message-send-hook' should
probably just die.
dme.
--
Stop the music and go home.
prev parent reply other threads:[~2020-08-18 9:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 2:23 emacs: `message-send-hook` being called twice Tim Quelch
2020-08-18 9:53 ` David Edmondson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2v9hg9t6m.fsf@dme.org \
--to=dme@dme.org \
--cc=notmuch@notmuchmail.org \
--cc=tim@tquelch.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).