[PATCH v2 1/2] emacs: with-current-notmuch-show-message should return the result of body

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

To: notmuch@notmuchmail.org

Cc: David Edmondson

From: David Edmondson


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
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: