From: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
To: notmuch@notmuchmail.org
Subject: Add support for `--limit=N` to `notmuch show`
Date: Fri, 1 May 2020 15:28:27 +0300 [thread overview]
Message-ID: <CA+Tk8fxmRX5=NVP92PJwSvRPQp8h0wnQg6K72kKfgcziC_cAGw@mail.gmail.com> (raw)
In a previous email (about `thread:...` field in JSON output of
`notmuch show`), I described one of my use-cases for notmuch.
Now extending upon that, if one would to implement an email client
that provides the user with search, there are two approaches:
* use `notmuch search -- {query}` and based on that output display a
thread list like GMail does;
* use `notmuch show -- {query}` and based on that display a page with
all emails that matched, grouping them by thread; (I prefer this
variant, as it gives me a quicker glance if I search for something
specific;)
Now the problem with `notmuch show` is that if I give it a too "broad"
query like `*` it will chew a lot of CPU and RAM (and in my case
eventually crash).
`notmuch search` does have a `--limit=N` argument that limits the
search output only to the first `N` items. My feature request is to
add such a flag also to `notmuch show` that should:
* limit the number of threads in all cases except `--format=raw`;
* not be allowed in case of `--format=raw` or `--part=P`;
As a work-around I could use `notmuch search --output=threads
--limit={limit} -- {query}`, then take those thread ID's and issue an
`notmuch show -- thread:... thread:...`. But this has the following
problems:
* it requires two `notmuch` CLI calls;
* and most importantly it renders the `--entire-thread=false` feature
useless; (as not the entire threads are matched by `notmuch show` as
opposed only to those matched by `notmuch search`;)
Thanks,
Ciprian.
reply other threads:[~2020-05-01 12:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CA+Tk8fxmRX5=NVP92PJwSvRPQp8h0wnQg6K72kKfgcziC_cAGw@mail.gmail.com' \
--to=ciprian.craciun@gmail.com \
--cc=notmuch@notmuchmail.org \
/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).