From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 91DC36DE023C for ; Wed, 26 Sep 2018 18:39:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.002 X-Spam-Level: X-Spam-Status: No, score=0.002 tagged_above=-999 required=5 tests=[AWL=0.013, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zwlkTIY-Cti7 for ; Wed, 26 Sep 2018 18:39:32 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 985056DE01E0 for ; Wed, 26 Sep 2018 18:39:32 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1g5LH9-0007eZ-Pg; Wed, 26 Sep 2018 21:39:31 -0400 Received: (nullmailer pid 3362 invoked by uid 1000); Thu, 27 Sep 2018 01:39:30 -0000 From: David Bremner To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH v1 2/2] emacs: Call `notmuch-mua-send-hook' hooks when sending a message In-Reply-To: <20180925150910.22318-3-dme@dme.org> References: <20180925150910.22318-1-dme@dme.org> <20180925150910.22318-3-dme@dme.org> Date: Wed, 26 Sep 2018 22:39:30 -0300 Message-ID: <87pnwz3ei5.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 01:39:33 -0000 $David Edmondson writes: > Previously any hook functions attached to `notmuch-mua-send-hook' were > ignored. > --- > emacs/notmuch-mua.el | 1 + > test/T310-emacs.sh | 1 - > 2 files changed, 1 insertion(+), 1 deletion(-) > > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el > index fc8ac687..df2ac447 100644 > --- a/emacs/notmuch-mua.el > +++ b/emacs/notmuch-mua.el > @@ -543,6 +543,7 @@ unencrypted. Really send? ")))) >=20=20 > (defun notmuch-mua-send-common (arg &optional exit) > (interactive "P") > + (run-hooks 'notmuch-mua-send-hook) > (when (and (notmuch-mua-check-no-misplaced-secure-tag) > (notmuch-mua-check-secure-tag-has-newline)) > (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-= do-fcc)) > diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh > index d743abb7..5935819f 100755 > --- a/test/T310-emacs.sh > +++ b/test/T310-emacs.sh > @@ -1107,7 +1107,6 @@ output=3D$(test_emacs "(mapcar 'notmuch-escape-bool= ean-term (list > test_expect_equal "$output" '("\"\"" "abc`~!@#$%^&*-=3D_+123" "\"(abc\""= "\")abc\"" "\"\"\"abc\"" "\"'$'\x01''xyz\"" "\"=E2=80=9Cxyz=E2=80=9D\"")' >=20=20 This looks plausible to me, and of course the test passes. I did wonder if this means that people actually using notmuch-user-agent would run the hook twice now? On a related topic, I'd like to stop globally setting mail-user-agent in notmuch.el. Notmuch users are still welcome to customize it, but we don't need this side effect for regular notmuch use. d