1 Return-Path: <james@hackervisions.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 73893429E27
\r
6 for <notmuch@notmuchmail.org>; Sat, 20 Aug 2011 13:55:32 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=1.363 tagged_above=-999 required=5
\r
12 tests=[RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=1] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id MisZBbVevcuH for <notmuch@notmuchmail.org>;
\r
16 Sat, 20 Aug 2011 13:55:32 -0700 (PDT)
\r
17 Received: from hackervisions.org (67-207-143-141.slicehost.net
\r
18 [67.207.143.141]) (using TLSv1 with cipher AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id EACDA431FD0
\r
21 for <notmuch@notmuchmail.org>; Sat, 20 Aug 2011 13:55:31 -0700 (PDT)
\r
22 Received: from ool-4572d87b.dyn.optonline.net ([69.114.216.123]
\r
23 helo=localhost) by hackervisions.org with esmtpsa
\r
24 (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from
\r
25 <james@hackervisions.org>) id 1Qusan-0003eX-Aq; Sat, 20 Aug 2011 16:56:33
\r
27 From: James Vasile <james@hackervisions.org>
\r
28 To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org
\r
29 Subject: Re: [PATCH] Return maximum of 150 results
\r
30 In-Reply-To: <87mxf5v43c.fsf@steelpick.2x.cz>
\r
31 References: <87zkj6um50.fsf@opensourcematters.org>
\r
32 <87mxf5v43c.fsf@steelpick.2x.cz>
\r
33 User-Agent: Notmuch/0.6.1-213-ge89ce87 (http://notmuchmail.org) Emacs/23.3.1
\r
34 (x86_64-pc-linux-gnu)
\r
35 Date: Sat, 20 Aug 2011 15:11:00 -0400
\r
36 Message-ID: <87vctrq4or.fsf@hackervisions.org>
\r
38 Content-Type: multipart/mixed; boundary="=-=-="
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Sat, 20 Aug 2011 20:55:32 -0000
\r
55 On Fri, 19 Aug 2011 17:00:23 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
\r
56 > If you really want this behavior, I propose to make the default value
\r
57 > of notmuch-max-results infinity.
\r
59 I'm attaching a revised patch that does as you suggest. Thanks.
\r
63 Content-Type: text/x-diff
\r
64 Content-Disposition: inline;
\r
65 filename=0001-Limit-number-of-threads-returned-by-search-in-emacs.patch
\r
67 >From d0421e4308473347b31f5537eaec93b137084060 Mon Sep 17 00:00:00 2001
\r
68 From: James Vasile <james@hackervisions.org>
\r
69 Date: Sat, 20 Aug 2011 14:58:47 -0400
\r
70 Subject: [PATCH] Limit number of threads returned by search in emacs
\r
72 Set notmuch-max-results to the maximum number of results the
\r
73 client should show. Setting notmuch-max-results to 0 (the
\r
74 default) does not limit search results (i.e. limits them to
\r
77 This patch requries your version of notmuch to implement the
\r
78 --last-index parameter. A patch to implement this parameter was
\r
79 posted to the notmuch mailing list as
\r
80 id:8739gyw0zh.fsf@opensourcematters.org.
\r
82 emacs/notmuch.el | 4 ++++
\r
83 1 files changed, 4 insertions(+), 0 deletions(-)
\r
85 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
86 index f11ec24..887d696 100644
\r
87 --- a/emacs/notmuch.el
\r
88 +++ b/emacs/notmuch.el
\r
89 @@ -882,6 +882,7 @@ characters as well as `_.+-'.
\r
90 (concat "*notmuch-search-" query "*"))
\r
93 +(defvar notmuch-max-results 0)
\r
95 (defun notmuch-search (query &optional oldest-first target-thread target-line continuation)
\r
96 "Run \"notmuch search\" with the given query string and display results.
\r
97 @@ -913,6 +914,9 @@ The optional parameters are used as follows:
\r
98 (let ((proc (start-process
\r
99 "notmuch-search" buffer
\r
100 notmuch-command "search"
\r
101 + (if (> notmuch-max-results 0)
\r
102 + (format "--last-index=%d" notmuch-max-results)
\r
105 "--sort=oldest-first"
\r
106 "--sort=newest-first")
\r