unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <notmuch@notmuchmail.org>
Subject: Feature idea: Emacs 'notmuch-search' "paged" display
Date: Fri, 17 Jan 2020 13:42:01 +0100	[thread overview]
Message-ID: <87muamgspy.fsf@euler.schwinge.homeip.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

             reply	other threads:[~2020-01-17 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 12:42 Thomas Schwinge [this message]
2020-01-18 14:23 ` Feature idea: Emacs 'notmuch-search' "paged" display David Bremner

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=87muamgspy.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.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).