From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id ADVFNWeUu2GWMwAAsNZ9tg (envelope-from ) for ; Thu, 16 Dec 2021 19:32:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8FctMGeUu2GVZQAAbx9fmQ (envelope-from ) for ; Thu, 16 Dec 2021 19:32:55 +0000 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) (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 18DCE2A5EA for ; Thu, 16 Dec 2021 20:32:54 +0100 (CET) Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (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-102.mailbox.org (Postfix) with ESMTPS id 4JFMhg03JrzQjbk; Thu, 16 Dec 2021 20:32:51 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de From: sourcehut@relevant-information.com To: piem@inbox.kyleam.com Cc: Leo Subject: [PATCH v3 2/2] Add user option for specifying path to notmuch-extract-patch Date: Thu, 16 Dec 2021 20:32:34 +0100 Message-Id: <20211216193234.25745-2-sourcehut@relevant-information.com> In-Reply-To: <20211216193234.25745-1-sourcehut@relevant-information.com> References: <87y24mwipm.fsf@kyleam.com> <20211216193234.25745-1-sourcehut@relevant-information.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=1639683175; 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=mcUB+NQUPzIRhov/S67AjJFiUuw88YrP+RVvBrHo5yM=; b=sP+5CYfaM52kYIMhPqfpQxxMwZv+sv+dMKdh9R0lTSOrhBRuay/BTaUe82cvta6hOTrkhx Am/v/tWAFsXAekg7rwEZVKDMRU5Bl0pQakAS5sTFKscn6elYQlUUDkMcZKcV+GEGPrPqgp wNL6WDn1B9pA4gHPy/eCc0sbY7kQ4pc1RDL43nhTHnpN4TmEDqitOQYeGulQ5KMRZCTszG QbwEinWN5gVpN3xDoTXLNy6CQg+PzFd5idRLvE36myeOmJuGGBxjlZVOj1C50xKef20hAr oYOEsEFU8uVqpXdydBAem2p3jPFh1lfGPSMHZga6B0eFFaxf4seG3a2EPKs6KQ== ARC-Seal: i=1; s=key1; d=kyleam.com; t=1639683175; a=rsa-sha256; cv=none; b=KEyHaJGUw34QtmK5f548AAvRb38ixkUXpeA7Vfqu9ZBUOk8ci9ksm/csgldiUXE6IgwVfa egFc0xZBJGRKPgJXdiYnezINI00IQE1wOtvSgJbMGpEJBCJqPvOF4A1HgTurX798WC3GJ0 k1c1niL5wKHQk7T3qxQiTCY9BhYXEVcyKQDIONvcX19UqPRwxmielWaY6Uo2IXQoq8ivZa r5nVGQt2kA2WAhqaH4L/13wNWWVLeY8Da5NFCAoRoU6mC0DBq4gltcDG9ogPSSn17aq5wl Vm21uOEBuPbo7jQxWV8crpW97nWHR/4re1PWP5/znL3nD7MVhOahbN+t7fQCdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of sourcehut@relevant-information.com designates 2001:67c:2050::465:102 as permitted sender) smtp.mailfrom=sourcehut@relevant-information.com X-Migadu-Spam-Score: -0.65 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of sourcehut@relevant-information.com designates 2001:67c:2050::465:102 as permitted sender) smtp.mailfrom=sourcehut@relevant-information.com X-Migadu-Queue-Id: 18DCE2A5EA X-Spam-Score: -0.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: /WmK8Z2XDwcX From: Leo `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. --- My laptop didn't have mailscripts in the package repos so I had to install it from emacsmirror which didn't put the scripts in PATH. I thought this change might be useful for others as well so I decided to include it. piem-notmuch.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piem-notmuch.el b/piem-notmuch.el index 1ee0b37..bc254f5 100644 --- a/piem-notmuch.el +++ b/piem-notmuch.el @@ -107,6 +107,10 @@ (defun piem-notmuch-am-ready-mbox () (insert patch))) "mbox")))))) +(defvar piem-notmuch-extract-patch-path nil + "The path to the executable notmuch-extract path. +If nil try to find it on path.") + (defun piem-notmuch-extract-patch-am-ready-mbox () "Return a function that inserts an am-ready mbox. Use the message itself if it looks like a patch using @@ -120,7 +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")) + (if-let ((cmd (or piem-notmuch-extract-patch-path (executable-find "notmuch-extract-patch"))) (tid ;; Copied from mailscripts.el ;; -- 2.34.1