From c493e338d3ea49422894ecfdcebe4849bb18f8f6 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 24 Oct 2021 23:55:05 -0400 Subject: 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> --- piem-notmuch.el | 7 +++---- 1 file 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." -- cgit v1.2.3