From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Edmondson Subject: Re: Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query Date: Tue, 26 Nov 2019 22:52:54 +0000 Message-ID: References: <87h82wrjvb.fsf@iris.silentflame.com> <87r21u1et3.fsf@iris.silentflame.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: In-Reply-To: <87r21u1et3.fsf-TDhmT+1V6bdypu2/aTzxt1aTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: notmuch-bounces-gxuj+Tv9EO5zyzON3hdc1g@public.gmane.org Sender: "notmuch" To: Sean Whitton , emacs-orgmode-mXXj517/zsQ@public.gmane.org Cc: notmuch-gxuj+Tv9EO5zyzON3hdc1g@public.gmane.org List-Id: emacs-orgmode.gnu.org --=-=-= Content-Type: text/plain On Tuesday, 2019-11-26 at 14:57:28 -07, Sean Whitton wrote: > On Tue 26 Nov 2019 at 08:05PM +00, David Edmondson wrote: > >> Could you explain how you were using `notmuch-show-thread-id' in a way >> that was broken by the presence of an arbitrary query? > > I've observed that the standard notmuch command > `notmuch-show-filter-thread' doesn't work in a buffer opened by > `org-notmuch-follow-link'. The poor behaviour is just a side effect of the way that queries are composed to implement the filter functionality. Does the attached patch help? > Further, my package 'mailscripts' tries to pass the current value of > `notmuch-show-thread-id' to notmuch-extract-patch(1). > > https://git.spwhitton.name/mailscripts/tree/mailscripts.el#n72 > > https://manpages.debian.org/notmuch-extract-patch > > If `notmuch-show-thread-id' contains a query which returns a single > message, the wrong value is passed to notmuch-extract-patch(1), such > that it may not extract all of the patches in the thread. It's not clear to me that this is broken. notmuch-extract-patch seems to be properly extracting patches from the messages that match the query. If the current `notmuch-show' buffer query doesn't match the entire thread, why should `notmuch-extract-thread-patches' be expected to apply patches from the whole thread? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=query-composition.patch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index e13ca3d7..ecbc03d2 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1311,7 +1311,7 @@ and THREAD. The next query is THREAD alone, and serves as a fallback if the prior matches no messages." (let (queries) (push (list thread) queries) - (if context (push (list thread "and (" context ")") queries)) + (if context (push (list "(" thread ") and (" context ")") queries)) queries)) (defun notmuch-show--build-buffer (&optional state) --=-=-= Content-Type: text/plain dme. -- I can't explain, you would not understand. This is not how I am. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --=-=-=--