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 SGlCEbIevGECNAAAsNZ9tg (envelope-from ) for ; Fri, 17 Dec 2021 05:22:58 +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 KAYfDbIevGFAYQAA1q6Kng (envelope-from ) for ; Fri, 17 Dec 2021 05:22:58 +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=1639718577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2lJpanCXvRYq+9xy54cb+899M1D97avA875NLMzq7Hg=; b=vyvcaabdtzdd+Td/ScFaXyCrpJHzRPQlnT/959Gqry1GoB/PMCl4tQGLs4GcFr8JOABVK6 6RfkeiHHL8DUoUJ1mwdXJelk7mOWG3UlsUGkkCDmv+E6I1Ftx5xLIgBjvuGr3+M/Dx8+QR 9syIrJdRSYacl4muwJ0ElmyIGEFSgjOV6/f+9BGOc5NtvZrTSrRoF6biUMFvym8Gf3YdFr gbkcUh5lPv9c+rje1qvao9x4a7v1RQL/+uUsdsr6cahEhRAp2GATjMTJRZRSpYa6hajcKa gOLWmwK4B98S1nk5pflrEQ6JValQ8VUEQY4mKmpnysUCUgA3PqMjN3rmmqjo4Q== From: Kyle Meyer To: sourcehut@relevant-information.com Cc: piem@inbox.kyleam.com Subject: Re: [PATCH v3 2/2] Add user option for specifying path to notmuch-extract-patch In-Reply-To: <20211216193234.25745-2-sourcehut@relevant-information.com> References: <87y24mwipm.fsf@kyleam.com> <20211216193234.25745-1-sourcehut@relevant-information.com> <20211216193234.25745-2-sourcehut@relevant-information.com> Date: Fri, 17 Dec 2021 00:22:54 -0500 Message-ID: <87bl1fx0sx.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: QWLdVG8FqCXQ sourcehut@relevant-information.com writes: > 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. I okay with the general idea, but I held off on pushing this to propose that instead you add a notmuch-extract-patch-executable defcustom consistent with other spots in piem (piem-git-executable, piem-b4-b4-executable, piem-lei-lei-executable). That can be set to "notmuch-extract-patch" by default then ... > (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"))) ... instead of worrying about the executable-find call here, just pass notmuch-extract-patch-executable to call-process as is. If call-process can't find it, it will signal a clear enough error: Searching for program: No such file or directory, notmuch-extract-patch