From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: 56442@debbugs.gnu.org, notmuch@notmuchmail.org
Subject: Re: bug#56442: gnus-search-run-search: Hits notmuch command line length limits
Date: Sat, 09 Jul 2022 09:11:22 -0700 [thread overview]
Message-ID: <87czeeuuz9.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <875yk850be.fsf__40907.3059143097$1657213041$gmane$org@athena.silentflame.com> (Sean Whitton's message of "Thu, 07 Jul 2022 09:56:05 -0700")
Sean Whitton <spwhitton@spwhitton.name> writes:
> Hello,
>
> I'm running a pretty innocent notmuch query over a fairly small Maildir:
>
> "((List:debian-devel.lists.debian.org) or ... or
> (List:debian-haskell.lists.debian.org) or
> (List:debconf-discuss.lists.debian.org)) and (not path:annex/**)"
>
> but gnus-search-run-search fails to return any results. The reason is
> that Gnus first runs the query with --output=threads to obtain a list of
> thread ids, and then runs another query with --output=files and a query
> constructed from the output of the first query: "thread:000000000000d9d0
> or thread:000000000000d9e0 or thread:000000000000d268 or ..."
>
> The resulting command fails completely:
>
> emacs: /usr/bin/notmuch: Argument list too long
>
> Instead of running two searches like this, we can just surround the
> whole query like this: "thread:{QUERY}". The manual says it's exactly
> equivalent:
>
> ... the user should think of the query thread:{<something>} as
> expanding to all of the thread IDs which match <something>; not‐
> much then performs a second search using the expanded query.
>
> This should be faster, too, with only running a single external command.
> Here is the patch I'm thinking I'll apply, if anyone has comments.
Huh, I tried this a couple months ago with a more complicated query,
like:
thread:{from:bob or from:jane}
and I remember notmuch barking at me about spaces or the "or" or
something -- anyway I got the impression that it couldn't accept
multi-part queries inside the "thread:{}" syntax. But looking at your
patch maybe I just needed to quote differently?
Anyway I'll give this a test this weekend. It would be *very* nice if we
could use this syntax rather than the ugly home-grown one.
Thanks for the report!
Eric\r
next parent reply other threads:[~2022-07-09 18:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <875yk850be.fsf__40907.3059143097$1657213041$gmane$org@athena.silentflame.com>
2022-07-09 16:11 ` Eric Abrahamsen [this message]
2022-07-09 18:01 ` bug#56442: gnus-search-run-search: Hits notmuch command line length limits Sean Whitton
2022-07-09 19:19 ` quoting: (was: Re: bug#56442: gnus-search-run-search: Hits notmuch command line length limits) Tomi Ollila
2022-07-07 16:56 bug#56442: gnus-search-run-search: Hits notmuch command line length limits Sean Whitton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czeeuuz9.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=56442@debbugs.gnu.org \
--cc=notmuch@notmuchmail.org \
--cc=spwhitton@spwhitton.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).