unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Add support for `--limit=N` to `notmuch show`
@ 2020-05-01 12:28 Ciprian Dorin Craciun
  0 siblings, 0 replies; only message in thread
From: Ciprian Dorin Craciun @ 2020-05-01 12:28 UTC (permalink / raw)
  To: notmuch

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-01 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 12:28 Add support for `--limit=N` to `notmuch show` Ciprian Dorin Craciun

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).