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 AGC/HEfsXV8TMgAA0tVLHw (envelope-from ) for ; Sun, 13 Sep 2020 09:54:15 +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 cEUVF0fsXV+2bAAAB5/wlQ (envelope-from ) for ; Sun, 13 Sep 2020 09:54:15 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 8B049940215 for ; Sun, 13 Sep 2020 09:54:13 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 05D3529C54; Sun, 13 Sep 2020 05:54:05 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id B42CF29319 for ; Sun, 13 Sep 2020 05:54:01 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 9E3681B00118; Sun, 13 Sep 2020 12:53:57 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1599990837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OSeZA8S0yCYgT7rQxyL4j6QWkNvgSi7qYeKtINMU8vg=; b=H49VjPlWi6X7/+l3+eUZY3ZdVweiUKXlatKnyIupAjZLK4yIOZvN1HkXcANUB86j02GdFh EF8EE+MPQp31BNrmzhcDuHCZvjiBIT9vOgFZCT4puvF1XV/sVrmAKsm57tbGPxP1gtKN7R qxGVh1fJ6q9L93Ji0FVZNEvRe8wuz1obqXWRL6W/59O/A3SdTtma2hNcIE7CatGf+SyQcT Lctql6QkN+pxXxIaArLXkBYV/ptlgnOsPCroOxDy0fDGdWgk/yOCLk8em+jGVzalSgQd9E 9xRR9pRTRG0+w2FbPBYkNjuw2WOqHDqrR6rTCpGTRiEi7mi78BhHpnnloG1ALA== From: Tomi Ollila To: Tim Quelch , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: Remove notmuch-mua-message-send-hook In-Reply-To: <20200912044540.852309-1-tim@tquelch.com> References: <20200912044540.852309-1-tim@tquelch.com> User-Agent: Notmuch/0.31~rc0+3~ge349e17 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1599990837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OSeZA8S0yCYgT7rQxyL4j6QWkNvgSi7qYeKtINMU8vg=; b=U4XUwGWoOmmsAH+QMGRQuI9bdGTGzw6fPsEVNTrqadszot+h3bYjOXWQykJVJcfT4+malZ oTP5JVfIZVA4nUKmD1JEz8PRDRJ8Xi/F8dC7iwSC1q7/Dz3w744rVSPWL69Tg2Yp15BQqi TDCaMbzvuDgmLBVqIJ0v/x10Of+U31vvylAYQV4iVbPnNEjRi4kN3lTiYU7zqc6UJimVDF szZ5EgS8ulnIqsdLJRUNvsjEQMvQpxluf2rBVlaO+NlpCSPOkDBzKX37IBMJtL4JRskkPr FM9UWXmSXbCyr/g31YnHvc3dDmS5CzQw4YHcPxsz1t6I7CSeBGv3Lz+R9I/c1Q== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1599990837; a=rsa-sha256; cv=none; b=PKluiF4g6kU+8LOsoVf1I34YYcUH9/Kf1ABtDA85FmRWt0G7cNm90E6nPH6WT/y4eOeA45 vHrsuRqT+4RI1XLVvbe48AA8zMzTP5UKFfj6LXVoVk5Kjj9Z88yVom/aQvh3hJh92HptXq Nkhbrkp6mAZ/1cgdDn8YbvXZVaGjlgY9FpBcHIenXqr/w/424skA7sXMd79ZRfiUVqDhz6 wtFWw934YHe800mF8Q/h6RMMYgpeutsgTIrsh4c6vUv5pMjTbcqWWe9UIv8rgT7JLY+/cd qCFc0YuQKWC1xeHDY4RtnPkdCjR5viZVUJFI5J9rL0HLBzSGNcS1uH8V9YBBRQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi Message-ID-Hash: IS3OTFZKWLZ4LXKZXRJC43CSGN3ZZPX5 X-Message-ID-Hash: IS3OTFZKWLZ4LXKZXRJC43CSGN3ZZPX5 X-MailFrom: tomi.ollila@iki.fi 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=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=H49VjPlW; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 2.03 X-TUID: W3wT332wyV3s 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