From: James Vasile <james@hackervisions.org>
To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Return maximum of 150 results
Date: Sat, 20 Aug 2011 15:11:00 -0400 [thread overview]
Message-ID: <87vctrq4or.fsf@hackervisions.org> (raw)
In-Reply-To: <87mxf5v43c.fsf@steelpick.2x.cz>
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
On Fri, 19 Aug 2011 17:00:23 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
> If you really want this behavior, I propose to make the default value
> of notmuch-max-results infinity.
I'm attaching a revised patch that does as you suggest. Thanks.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Limit-number-of-threads-returned-by-search-in-emacs.patch --]
[-- Type: text/x-diff, Size: 1508 bytes --]
From d0421e4308473347b31f5537eaec93b137084060 Mon Sep 17 00:00:00 2001
From: James Vasile <james@hackervisions.org>
Date: Sat, 20 Aug 2011 14:58:47 -0400
Subject: [PATCH] Limit number of threads returned by search in emacs
Set notmuch-max-results to the maximum number of results the
client should show. Setting notmuch-max-results to 0 (the
default) does not limit search results (i.e. limits them to
infinity).
This patch requries your version of notmuch to implement the
--last-index parameter. A patch to implement this parameter was
posted to the notmuch mailing list as
id:8739gyw0zh.fsf@opensourcematters.org.
---
emacs/notmuch.el | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f11ec24..887d696 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -882,6 +882,7 @@ characters as well as `_.+-'.
(concat "*notmuch-search-" query "*"))
)))
+(defvar notmuch-max-results 0)
;;;###autoload
(defun notmuch-search (query &optional oldest-first target-thread target-line continuation)
"Run \"notmuch search\" with the given query string and display results.
@@ -913,6 +914,9 @@ The optional parameters are used as follows:
(let ((proc (start-process
"notmuch-search" buffer
notmuch-command "search"
+ (if (> notmuch-max-results 0)
+ (format "--last-index=%d" notmuch-max-results)
+ "")
(if oldest-first
"--sort=oldest-first"
"--sort=newest-first")
--
1.7.5.4
next prev parent reply other threads:[~2011-08-20 20:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 3:15 [PATCH] Return maximum of 150 results James Vasile
2011-08-19 15:00 ` 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 [this message]
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=87vctrq4or.fsf@hackervisions.org \
--to=james@hackervisions.org \
--cc=notmuch@notmuchmail.org \
--cc=sojkam1@fel.cvut.cz \
/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).