unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Tim Quelch <tim@tquelch.com>, notmuch@notmuchmail.org
Cc: Tim Quelch <tim@tquelch.com>
Subject: Re: [PATCH] emacs: Remove notmuch-mua-message-send-hook
Date: Sun, 13 Sep 2020 12:53:54 +0300	[thread overview]
Message-ID: <m2zh5uc899.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20200912044540.852309-1-tim@tquelch.com>

On Sat, Sep 12 2020, Tim Quelch wrote:

> Currently `message-send-hook` functions are being called twice: In
> notmuch send common when `notmuch-mua-send-hook` functions are
> run (which by default includes `notmuch-mua-message-send-hook`) and in
> `message-send` itself.
>
> Because `message-send-hook` functions are run in `message-send` itself,
> we don't need also need to run them before we delegate to `message-send`
>
> Calling `notmuch-mua-message-send-hook` resulted in functions in
> `message-send-hook` to be called twice. This causes bugs in
> non-idempotent hook functions.

Looks good to me. everyone who rewrote notmuch-mua-message-send-hook
(i hope none) have to find better solution (or just...)

Hmm, this is defcustom. If that (old default) is stored in 
custom-set-variables have to remove it -- at least my  
custom-set-variables does not reference to this hook variable, so
most probably the effect (if any) is small...

Tomi

> ---
>  emacs/notmuch-mua.el | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index dcddca76..03c7cc97 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -40,7 +40,7 @@
>  
>  ;;
>  
> -(defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
> +(defcustom notmuch-mua-send-hook nil
>    "Hook run before sending messages."
>    :type 'hook
>    :group 'notmuch-send
> @@ -601,11 +601,6 @@ unencrypted.  Really send? "))))
>    (interactive)
>    (message-kill-buffer))
>  
> -(defun notmuch-mua-message-send-hook ()
> -  "The default function used for `notmuch-mua-send-hook', this
> -simply runs the corresponding `message-mode' hook functions."
> -  (run-hooks 'message-send-hook))
> -
>  ;;
>  
>  (define-mail-user-agent 'notmuch-user-agent
> -- 
> 2.28.0
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

  reply	other threads:[~2020-09-13  9:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12  4:45 [PATCH] emacs: Remove notmuch-mua-message-send-hook Tim Quelch
2020-09-13  9:53 ` Tomi Ollila [this message]
2020-09-13 23:56   ` Tim Quelch
2020-09-19  9:56   ` David Bremner

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=m2zh5uc899.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --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).