discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH] piem-notmuch-known-mid-p: Drop call to with-current-buffer
Date: Sun, 24 Oct 2021 23:55:05 -0400	[thread overview]
Message-ID: <20211025035505.297281-1-kyle@kyleam.com> (raw)

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


                 reply	other threads:[~2021-10-25  3:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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://git.kyleam.com/

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

  git send-email \
    --in-reply-to=20211025035505.297281-1-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    /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://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).