From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id SBUJCOEnwmE1EQAAsNZ9tg (envelope-from ) for ; Tue, 21 Dec 2021 19:15:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OP84A+EnwmGBJAAA1q6Kng (envelope-from ) for ; Tue, 21 Dec 2021 19:15:45 +0000 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5E4E1CB4F for ; Tue, 21 Dec 2021 20:15:41 +0100 (CET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4JJR4X2NqczQjmp; Tue, 21 Dec 2021 20:15:40 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de From: Leo To: piem@inbox.kyleam.com Cc: Leo Subject: [PATCH v4] Add user option for specifying path to notmuch-extract-patch Date: Tue, 21 Dec 2021 20:15:27 +0100 Message-Id: <20211221191527.11819-1-sourcehut@relevant-information.com> In-Reply-To: <87bl1fx0sx.fsf@kyleam.com> References: <87bl1fx0sx.fsf@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1640114144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1MIQDo6bZ1XBOJsDMuYun83PnS+zmyWgnIlmWUXmt1o=; b=J/gT3K2pmPp+m2VLLNrJ31JainsPS83XqAUtPtW0sOJKLpVfIvvMjN/S/szHfZUH/urPHW ugRUFQDTFGnyhhXaAA/GC8oLMx78xyn4Vn9l2VVJInrDpDDyfSwGtPOHpey/feOUwEGH0E CQlEI0sChMb2BUM5aBgSvF8wLSQwaYh09QMeDmYCiHbm46gRSN94rbQY9n67oW4mYIeHC5 en8MNx3gcyP73074p8Q2xTWKcv4h3BzpfqsFj1+BnnHkW54ufc2rZZ1aSJNck1yGaTOQbL 3X3Hq0XS+UPixKWkFO3WVE2hl6qrMXNOwcze8FBKKTpL9Q4/FM4KI7Yg3jr3NA== ARC-Seal: i=1; s=key1; d=kyleam.com; t=1640114144; a=rsa-sha256; cv=none; b=RHRSDOn4cZyuhaST0dNggXllZifn7l82uGx9m8bcAumc6xJ1Eh3CVPoUQ7bOESwUMn1Hnp HM7paNue50OFFJ1X5M2pFh6aRi4+IQDcXj2qzRyGsPv8kGT25yJP2kjWRUxUmoGrRilFH3 SlGHKTrtk3NlWFVoMafwzCQIPeoGfuUVNRRdipIMCZCOOwJ3r+3IDlo7fkx+eBASP20z67 /KPSzqUOKDjH4Kyj6j+E+LDGGp4wfIQqG1TeOMVAiIgK+dvjAZvQ0brWkZxBzCM1uQI/nn PSAhPbbXoSm67FrQ96v6Cim5kNBe+htpvpLZjE41CVJ+ZFx4EMfzKRt7TxED4Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of sourcehut@relevant-information.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=sourcehut@relevant-information.com X-Migadu-Spam-Score: -0.56 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of sourcehut@relevant-information.com designates 80.241.56.171 as permitted sender) smtp.mailfrom=sourcehut@relevant-information.com X-Migadu-Queue-Id: 5E4E1CB4F X-Spam-Score: -0.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1OjOWq0zwS0U `notmuch-extract-patch` might not be available on PATH. This can be the case if the package wasn't installed through the distro package manager. --- piem-notmuch.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piem-notmuch.el b/piem-notmuch.el index b48cf70..34231a5 100644 --- a/piem-notmuch.el +++ b/piem-notmuch.el @@ -38,6 +38,10 @@ (defgroup piem-notmuch nil "Notmuch integration for piem." :group 'piem) +(defcustom piem-notmuch-extract-patch-executable "notmuch-extract-patch" + "Which notmuch-extract-patch executable to use." + :type 'string) + (defmacro piem-notmuch--with-current-message (&rest body) (declare (indent 0) (debug (body))) (let ((rv (make-symbol "rv"))) @@ -120,8 +124,7 @@ (defun piem-notmuch-extract-patch-am-ready-mbox () (mm-dissect-buffer))) 0)) (let ((thread-id notmuch-show-thread-id)) (lambda () - (if-let ((cmd (executable-find "notmuch-extract-patch")) - (tid + (if-let ((tid ;; Copied from mailscripts.el ;; ;; If `notmuch-show' was called with a notmuch query rather @@ -134,7 +137,7 @@ (defun piem-notmuch-extract-patch-am-ready-mbox () (if (string= (substring thread-id 0 7) "thread:") thread-id (concat "thread:{" thread-id "}")))) - (call-process cmd nil t nil + (call-process piem-notmuch-extract-patch-executable nil t nil tid) (user-error "The executable notmuch-extract-patch was not found")))))) base-commit: 3e5535304519c31453ec12037fcd33a4b4095a51 -- 2.34.1