From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id 6EqFFaIqdmFjLAAAsNZ9tg (envelope-from ); Mon, 25 Oct 2021 03:55:14 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kJFjEaIqdmENOwAA1q6Kng (envelope-from ); Mon, 25 Oct 2021 03:55:14 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1635134114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=MxL1++GGMaswzEe0LCM0PD+3chf5/Jqnr9pFoHzGVUE=; b=qkMuGrLiO0Bhf30tgZRTNCnuOWc1U2bBXZ09OvKcktmEIhAkVfaFzcLkj9Mo+uf1Trs5EJ RmX1hOSYQQECj+tGTtAcq5IzKc3cB9nw4x/Rl7q0/QuI1zkMR/pi+CN2V4ixm1BNKnQn72 MdN+LmyeDev6FwR5ltTJcZv6IOmk+uneQGr4rEip5ApqpwLgMpkgNY68Y/i3cqiAdFc4qV c4iKCoyxGkzanbmj1jGbAZmkkzzdlOLcJpu7DX77QkKXCAN4wzCOQMLBE3yk1FYZPvOUwW 9WMrlJV9c1ZkZAsJksKTkToXvJxzXsd1X59RzgehK/m2vzHWPeh4LdQcsEOhyw== From: Kyle Meyer 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 Message-Id: <20211025035505.297281-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: hByPgh+jMiUR 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