aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-10-24 23:55:05 -0400
committerKyle Meyer <kyle@kyleam.com>2021-10-25 22:41:49 -0400
commitc493e338d3ea49422894ecfdcebe4849bb18f8f6 (patch)
treef7b6b3c029ca1c10c5f31bb7c72cc5b5b0fd5fff
parent4122fe3c6e350182d40a527d4392edb08e1dcb92 (diff)
downloadpiem-c493e338d3ea49422894ecfdcebe4849bb18f8f6.tar.gz
piem-notmuch-known-mid-p: Drop call to with-current-buffer
There's no need to switch to the standard-output buffer because it can be passed as a destination for call-process. I go back and forth on whether I prefer (with-output-to-string ...) to (with-temp-buffer ... (buffer-string)), but the main thing I like about with-output-to-string is that the intention of the code is declared at the start. Message-Id: <20211025035505.297281-1-kyle@kyleam.com>
-rw-r--r--piem-notmuch.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/piem-notmuch.el b/piem-notmuch.el
index c712366..8b2a353 100644
--- a/piem-notmuch.el
+++ b/piem-notmuch.el
@@ -64,10 +64,9 @@ have surrounding brackets."
(equal query
(string-trim-right
(with-output-to-string
- (with-current-buffer standard-output
- (call-process notmuch-command
- nil '(t nil) nil
- "search" "--output=messages" query)))))))
+ (call-process notmuch-command
+ nil (list standard-output nil) nil
+ "search" "--output=messages" query))))))
(defun piem-notmuch-mid-to-thread (mid)
"Return a function that inserts an mbox for MID's thread."