From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +LSlNFxSXF8NGQAA0tVLHw (envelope-from ) for ; Sat, 12 Sep 2020 04:45:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id AufSLlxSXF8OVwAAB5/wlQ (envelope-from ) for ; Sat, 12 Sep 2020 04:45:16 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2140B940653 for ; Sat, 12 Sep 2020 04:45:14 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id BF8E229C4E; Sat, 12 Sep 2020 00:45:05 -0400 (EDT) Received: from smtprelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by mail.notmuchmail.org (Postfix) with ESMTPS id A2B9129C29 for ; Sat, 12 Sep 2020 00:45:02 -0400 (EDT) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id A248F180AA519; Sat, 12 Sep 2020 04:45:01 +0000 (UTC) X-Session-Marker: 74696D40747175656C63682E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,,,RULES_HIT:41:355:379:541:973:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:4321:5007:6261:7903:9592:10004:10848:11658:11914:12043:12109:12114:12297:12555:12679:12895:13069:13095:13311:13357:13894:14181:14384:14394:14721:14777:21064:21080:21212:21433:21627:21660:21795:30054:30083,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cap90_49099fd270f4 X-Filterd-Recvd-Size: 1938 Received: from localhost (180-150-39-252.b49627.bne.nbn.aussiebb.net [180.150.39.252]) (Authenticated sender: tim@tquelch.com) by omf14.hostedemail.com (Postfix) with ESMTPA; Sat, 12 Sep 2020 04:45:00 +0000 (UTC) From: Tim Quelch To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Remove notmuch-mua-message-send-hook Date: Sat, 12 Sep 2020 14:45:40 +1000 Message-Id: <20200912044540.852309-1-tim@tquelch.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Message-ID-Hash: EQ3QG6IWZ4CKMCI6PLW3OPGAF6VYIPNC X-Message-ID-Hash: EQ3QG6IWZ4CKMCI6PLW3OPGAF6VYIPNC X-MailFrom: tim@tquelch.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Tim Quelch X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=tquelch.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.63 X-TUID: M0NrXIk1MzAG 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. --- 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