discussion and development of piem
 help / color / mirror / code / Atom feed
* [PATCH] piem-notmuch-known-mid-p: Drop call to with-current-buffer
@ 2021-10-25  3:55 Kyle Meyer
  0 siblings, 0 replies; only message in thread
From: Kyle Meyer @ 2021-10-25  3:55 UTC (permalink / raw)
  To: piem

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.
---
 piem-notmuch.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/piem-notmuch.el b/piem-notmuch.el
index c7123665..8b2a3537 100644
--- a/piem-notmuch.el
+++ b/piem-notmuch.el
@@ -64,10 +64,9 @@ (defun piem-notmuch-known-mid-p (mid)
     (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."

base-commit: 4122fe3c6e350182d40a527d4392edb08e1dcb92
-- 
2.33.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-25  3:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25  3:55 [PATCH] piem-notmuch-known-mid-p: Drop call to with-current-buffer Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.kyleam.com/piem/

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).