Feature idea: Emacs 'notmuch-search' "paged" display

classic Classic list List threaded Threaded
2 messages Options
Thomas Schwinge-2 Thomas Schwinge-2
Reply | Threaded
Open this post in threaded view
|

Feature idea: Emacs 'notmuch-search' "paged" display

Hi!

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

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
it all.

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


Grüße
 Thomas

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch

signature.asc (671 bytes) Download Attachment
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Feature idea: Emacs 'notmuch-search' "paged" display

Thomas Schwinge <[hidden email]> writes:

>
> 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 [1].

A long time ago Jani Nikula publish a work in progress patch [2] to
provide buttons to extend an initially limited set of results. Making
that production worthy might be an easier task than messing with
internals.

[1]: https://www.mail-archive.com/notmuch@.../msg47184.html
[2]: https://mid.mail-archive.com/1327692900-22926-1-git-send-email-jani@...
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch