From: James Vasile <james@hackervisions.org>
To: notmuch@notmuchmail.org
Subject: [PATCH] Return maximum of 150 results
Date: Thu, 18 Aug 2011 23:15:55 -0400 [thread overview]
Message-ID: <87zkj6um50.fsf@opensourcematters.org> (raw)
Display a maximum of 150 results when searching for messages. This
prevents client lag when searches return thousands of results you'll
never look at (use the Filter command to cut down results that exceed
150).
Number of results can be changed by setting notmuch-max-results.
This patch depends on notmuch supporting the --last-index option, a
patch for which I emailed to the list earlier this evening.
---
emacs/notmuch.el | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 2f36bbd..b928680 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -1944,6 +1944,7 @@ characters as well as `_.+-'.
(apply 'notmuch-enqueue-asynch "tag"
(append action-split (list notmuch-search-query-string) nil))))
+(defvar notmuch-max-results 150)
;;;###autoload
(defun notmuch-search (query &optional oldest-first target-thread target-line continuation)
"Run \"notmuch search\" with the given query string and display results.
@@ -1975,6 +1976,7 @@ The optional parameters are used as follows:
(let ((proc (start-process
"notmuch-search" buffer
notmuch-command "search"
+ (concat "--last-index=" (number-to-string notmuch-max-results))
(if oldest-first
"--sort=oldest-first"
"--sort=newest-first")
--
1.7.5.4
next reply other threads:[~2011-08-19 3:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 3:15 James Vasile [this message]
2011-08-19 15:00 ` [PATCH] Return maximum of 150 results Michal Sojka
2011-08-19 15:37 ` James Vasile
2011-08-19 16:00 ` Michal Sojka
2011-08-19 16:30 ` James Vasile
2011-08-19 18:30 ` Jameson Graef Rollins
2011-08-20 19:11 ` James Vasile
2011-08-22 23:46 ` Daniel Schoepe
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=87zkj6um50.fsf@opensourcematters.org \
--to=james@hackervisions.org \
--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).