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 3EE426DE26AB for ; Mon, 19 Mar 2018 12:57:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.004 X-Spam-Level: X-Spam-Status: No, score=-0.004 tagged_above=-999 required=5 tests=[AWL=0.005, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, 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 nfGyBSh0So_5 for ; Mon, 19 Mar 2018 12:57:19 -0700 (PDT) Received: from istari.evenmere.org (istari.evenmere.org [136.248.125.194]) by arlo.cworth.org (Postfix) with ESMTP id CAE3E6DE26AA for ; Mon, 19 Mar 2018 12:57:18 -0700 (PDT) Received: by istari.evenmere.org (Postfix, from userid 113) id 06D1B1E0068; Mon, 19 Mar 2018 15:57:13 -0400 (EDT) Received: from [IPv6:2001:4878:a000:3000:6913:27b1:7061:fad7] (unknown [IPv6:2001:4878:a000:3000:6913:27b1:7061:fad7]) by istari.evenmere.org (Postfix) with ESMTPSA id DF53F1E005B; Mon, 19 Mar 2018 15:57:10 -0400 (EDT) Content-Type: multipart/alternative; boundary=Apple-Mail-AA5E9B26-A5BC-4A8B-8932-7C8937F9AD59 Mime-Version: 1.0 (1.0) Subject: Re: tip: how to not forget attachments From: Brian Sniffen X-Mailer: iPhone Mail (15E5216a) In-Reply-To: <87fu4v27hb.fsf@curie.anarc.at> Date: Mon, 19 Mar 2018 15:57:05 -0400 Cc: notmuch@notmuchmail.org Content-Transfer-Encoding: 7bit Message-Id: <64758D7F-2CB7-4D48-ABB9-143C75785CB0@evenmere.org> References: <87d10042pu.fsf@curie.anarc.at> <87woy8vx7i.fsf@tesseract.cs.unb.ca> <87a7v42bv9.fsf@curie.anarc.at> <874llc2bkp.fsf@curie.anarc.at> <87fu4v27hb.fsf@curie.anarc.at> To: =?utf-8?Q?Antoine_Beaupr=C3=A9?= 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: Mon, 19 Mar 2018 19:57:22 -0000 --Apple-Mail-AA5E9B26-A5BC-4A8B-8932-7C8937F9AD59 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable `error` doesn=E2=80=99t do any unwinding; it leaves the program state wherev= er it was for analysis. You probably want throw/catch, as described at http= s://www.gnu.org/software/emacs/manual/html_node/elisp/Catch-and-Throw.html#C= atch-and-Throw --=20 Brian Sniffen > On Mar 19, 2018, at 3:25 PM, Antoine Beaupr=C3=A9 wrote: >=20 >> On 2018-03-19 13:56:54, Antoine Beaupr=C3=A9 wrote: >> PS: don't we have a "you forgot to actually attach the damn file" plugin >> when we detect the word "attachment" and there's no attach? :p >=20 > So I figured that one out, I think. Before adding it to the wiki, I'd > like a review of the code (attached) from more adept elisp programmers. >=20 > I'm particularly surprised that save-excursion doesn't work the way I > expect: when I answer "no" to the question, I go back to the email > buffer, but the point is invariably at the end of the buffer, whereas I > would expect it to be where it was when I send the message. It looks > like something else moves the mark before my hook, but I'm not sure > what... >=20 > How else than (error) or (keyboard-quit) am I supposed to abort email > sending? (message-send) uses the latter but it would seem better to use > an actual error message than to just "beep" our way out here.. >=20 > Other advice? (save-excursion) + (goto-char (point-min)) + > (re-search-forward), is that idiomatic? or is there something more > clever that should be done? >=20 > thanks! >=20 > --=20 > Tu conna=C3=AEtras la v=C3=A9rit=C3=A9 de ton chemin =C3=A0 ce qui te rend= heureux. > - Aristote > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch --Apple-Mail-AA5E9B26-A5BC-4A8B-8932-7C8937F9AD59 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable `error` doesn=E2=80=99t do any unwinding; i= t leaves the program state wherever it was for analysis.  You probably w= ant throw/catch, as described at https:/= /www.gnu.org/software/emacs/manual/html_node/elisp/Catch-and-Throw.html#Catc= h-and-Throw

-- 
Brian Sn= iffen

On Mar 19, 2018, at 3:25 PM, Antoine Beaupr=C3=A9 &= lt;anarcat@orangeseeds.org>= ; wrote:

On 2018-03-19 13:= 56:54, Antoine Beaupr=C3=A9 wrote:
PS: don't we have a "you forgot to actually attach the damn file" plugin
when we detect the word= "attachment" and there's no attach? :p
=
So I figured that one out, I think. Before adding it to the wiki, I= 'd
like a review of the code (attached) from more adept elis= p programmers.

I'm particularly surprised t= hat save-excursion doesn't work the way I
expect: when I ans= wer "no" to the question, I go back to the email
buffer, but= the point is invariably at the end of the buffer, whereas I
would expect it to be where it was when I send the message. It looks=
like something else moves the mark before my hook, but I'm not sur= e
what...

How else than (er= ror) or (keyboard-quit) am I supposed to abort email
sending= ? (message-send) uses the latter but it would seem better to use
<= span>an actual error message than to just "beep" our way out here..
Other advice? (save-excursion) + (goto-char (point-= min)) +
(re-search-forward), is that idiomatic? or is there s= omething more
clever that should be done?

thanks!

--
= Tu conna=C3=AEtras la v=C3=A9rit=C3=A9 de ton chemin =C3=A0 ce qui te rend h= eureux.
        &nb= sp;            &= nbsp; - Aristote
<notmuch-buddha.el>
=
_______________________________________________
n= otmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/not= much
= --Apple-Mail-AA5E9B26-A5BC-4A8B-8932-7C8937F9AD59--