I had this following idea, but my Emacs foo is too limited to start
implementing this -- if reasonably possible at all.
Here is -- I suppose, not verified -- what happens if you do a
command-line 'notmuch search [...] | less': the 'notmuch' process creates
some output and the 'less' process reads some. At some point, 'less'
stops reading (let's assume when the screen is full, for simplicity),
then the pipe gets filled up (some few KiB, I think?), and then 'notmuch'
blocks in 'write', so doesn't do any futher work until 'less' reads more
Here is -- I suppose, not verified -- what happens if you do a Emacs
'notmuch-search [...]': the 'notmuch' process creates some output and the
Emacs process reads some. And then some more, and again, and so on,
until 'EOF'. So, 'notmuch' never blocks in 'write', because Emacs reads
Now, I have a number of generic search queries that produce a long list
of search results, so to avoid Emacs building up a huge 'notmuch-search'
buffer I usually quickly do "M-: (ignore-errors (interrupt-process))".
Oftentimes I'm only interested in the first few results, or I'm
immediately going to 'notmuch-search-filter' the results.
Is it possible in Emacs to emulared the "paged" display as explained in
the 'less' example? That is, only read in "a screenful of data", then
let the pipe fill up, then 'notmuch' block, and only once the user moves
the point towards the end of the current Emacs buffer, continue to read
data from the pipe.
I'm willing to try implementing this, but I'd appreciate some
sanity-checking as well as guidance by somebody more familiar with Emacs
> Is it possible in Emacs to emulared the "paged" display as explained in
> the 'less' example? That is, only read in "a screenful of data", then
> let the pipe fill up, then 'notmuch' block, and only once the user moves
> the point towards the end of the current Emacs buffer, continue to read
> data from the pipe.
One concern with a previous attempt is that it doesn't really work with
ssh wrappers of notmuch .
A long time ago Jani Nikula publish a work in progress patch  to
provide buttons to extend an initially limited set of results. Making
that production worthy might be an easier task than messing with