<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">`error` doesn’t do any unwinding; it leaves the program state wherever it was for analysis.  You probably want throw/catch, as described at <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Catch-and-Throw.html#Catch-and-Throw">https://www.gnu.org/software/emacs/manual/html_node/elisp/Catch-and-Throw.html#Catch-and-Throw</a><div><br><div id="AppleMailSignature">-- <div>Brian Sniffen</div></div><div><br>On Mar 19, 2018, at 3:25 PM, Antoine Beaupré <<a href="mailto:anarcat@orangeseeds.org">anarcat@orangeseeds.org</a>> wrote:<br><br></div><blockquote type="cite"><div><span>On 2018-03-19 13:56:54, Antoine Beaupré wrote:</span><br><blockquote type="cite"><span>PS: don't we have a "you forgot to actually attach the damn file" plugin</span><br></blockquote><blockquote type="cite"><span>when we detect the word "attachment" and there's no attach? :p</span><br></blockquote><span></span><br><span>So I figured that one out, I think. Before adding it to the wiki, I'd</span><br><span>like a review of the code (attached) from more adept elisp programmers.</span><br><span></span><br><span>I'm particularly surprised that save-excursion doesn't work the way I</span><br><span>expect: when I answer "no" to the question, I go back to the email</span><br><span>buffer, but the point is invariably at the end of the buffer, whereas I</span><br><span>would expect it to be where it was when I send the message. It looks</span><br><span>like something else moves the mark before my hook, but I'm not sure</span><br><span>what...</span><br><span></span><br><span>How else than (error) or (keyboard-quit) am I supposed to abort email</span><br><span>sending? (message-send) uses the latter but it would seem better to use</span><br><span>an actual error message than to just "beep" our way out here..</span><br><span></span><br><span>Other advice? (save-excursion) + (goto-char (point-min)) +</span><br><span>(re-search-forward), is that idiomatic? or is there something more</span><br><span>clever that should be done?</span><br><span></span><br><span>thanks!</span><br><span></span><br><span>-- </span><br><span>Tu connaîtras la vérité de ton chemin à ce qui te rend heureux.</span><br><span>                        - Aristote</span><br></div></blockquote><blockquote type="cite"><div><notmuch-buddha.el></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>notmuch mailing list</span><br><span><a href="mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a></span><br><span><a href="https://notmuchmail.org/mailman/listinfo/notmuch">https://notmuchmail.org/mailman/listinfo/notmuch</a></span><br></div></blockquote></div></body></html>