unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Cc: David Edmondson <dme@dme.org>
Subject: [PATCH v2 1/2] emacs: with-current-notmuch-show-message should return the result of body
Date: Sun, 21 Feb 2021 15:21:31 +0000	[thread overview]
Message-ID: <20210221152132.2302112-2-dme@dme.org> (raw)
In-Reply-To: <20210221152132.2302112-1-dme@dme.org>

Rather than returning the result of kill-buffer,
with-current-notmuch-show-message should return the result of calling
the passed body.
---
 emacs/notmuch-show.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index ba93febb..761be252 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -273,11 +273,12 @@ position of the message in the thread."
   `(save-excursion
      (let ((id (notmuch-show-get-message-id)))
        (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
-	 (with-current-buffer buf
-	   (let ((coding-system-for-read 'no-conversion))
-	     (call-process notmuch-command nil t nil "show" "--format=raw" id))
-	   ,@body)
-	 (kill-buffer buf)))))
+	 (prog1
+	  (with-current-buffer buf
+	    (let ((coding-system-for-read 'no-conversion))
+	      (call-process notmuch-command nil t nil "show" "--format=raw" id))
+	    ,@body)
+	  (kill-buffer buf))))))
 
 (defun notmuch-show-turn-on-visual-line-mode ()
   "Enable Visual Line mode."
-- 
2.30.0

  reply	other threads:[~2021-02-21 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 15:21 [PATCH v2 0/2] scaffolding for autocrypt support David Edmondson
2021-02-21 15:21 ` David Edmondson [this message]
2021-02-21 15:21 ` [PATCH v2 2/2] emacs: Add notmuch-show-insert-msg-hook David Edmondson
2021-02-23  2:02 ` [PATCH v2 0/2] scaffolding for autocrypt support Daniel Kahn Gillmor
2021-04-16 12:05   ` David Bremner
2021-04-19  8:53     ` David Edmondson
2021-07-07 11:02     ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210221152132.2302112-2-dme@dme.org \
    --to=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).