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 SCpgLcWBuGEcFQAAsNZ9tg (envelope-from ) for ; Tue, 14 Dec 2021 11:36:37 +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 uMOSKMWBuGGzagAA1q6Kng (envelope-from ) for ; Tue, 14 Dec 2021 11:36:37 +0000 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) (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 6FAE53BE44 for ; Tue, 14 Dec 2021 12:36:34 +0100 (CET) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (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-101.mailbox.org (Postfix) with ESMTPS id 4JCxCy6qQNzQkJ6; Tue, 14 Dec 2021 12:36:30 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de From: Leo To: Kyle Meyer Cc: piem@inbox.kyleam.com, Sean Whitton Subject: Re: [PATCH 1/1] Use notmuch-extract-patch if available In-Reply-To: <87mtl66ckv.fsf@kyleam.com> References: <20211209204319.168897-1-sourcehut@relevant-information.com> <20211209204319.168897-2-sourcehut@relevant-information.com> <87mtl66ckv.fsf@kyleam.com> Date: Tue, 14 Dec 2021 12:36:21 +0100 Message-ID: <871r2f770q.fsf@student-228-110.eduroam.uu.se> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 6FAE53BE44 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: KcZL/0Onu+L7 Kyle Meyer writes: > sourcehut@relevant-information.com writes: >> + (if-let ((cmd (executable-find "notmuch-extract-patch")) >> + (tid >> + ;; If `notmuch-show' was called with a notmuch query rather >> + ;; than a thread ID, as `org-notmuch-follow-link' in >> + ;; org-notmuch.el does, then `notmuch-show-thread-id' might >> + ;; be an arbitrary notmuch query instead of a thread ID. We >> + ;; need to wrap such a query in thread:{} before passing it >> + ;; to notmuch-extract-patch(1), or we might not get a whole >> + ;; thread extracted (e.g. if the query is just id:foo) >> + (if (string= (substring thread-id 0 7) "thread:") >> + thread-id >> + (concat "thread:{" thread-id "}")))) > > I believe this comment and (if ...) is coming straight from > mailscripts.el. You note in the cover letter that some of this is > copied from mailscripts.el, but I think there should be a code comment > as well. > > However, I don't really understand why the condition is necessary. > Wouldn't always using > > thread:{notmuch-show-get-message-id return value} > > work? I don't actually know, maybe Sean Whitton knows?