From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 73893429E27 for ; Sat, 20 Aug 2011 13:55:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.363 X-Spam-Level: * X-Spam-Status: No, score=1.363 tagged_above=-999 required=5 tests=[RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MisZBbVevcuH for ; Sat, 20 Aug 2011 13:55:32 -0700 (PDT) Received: from hackervisions.org (67-207-143-141.slicehost.net [67.207.143.141]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id EACDA431FD0 for ; Sat, 20 Aug 2011 13:55:31 -0700 (PDT) Received: from ool-4572d87b.dyn.optonline.net ([69.114.216.123] helo=localhost) by hackervisions.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Qusan-0003eX-Aq; Sat, 20 Aug 2011 16:56:33 -0400 From: James Vasile To: Michal Sojka , notmuch@notmuchmail.org Subject: Re: [PATCH] Return maximum of 150 results In-Reply-To: <87mxf5v43c.fsf@steelpick.2x.cz> References: <87zkj6um50.fsf@opensourcematters.org> <87mxf5v43c.fsf@steelpick.2x.cz> User-Agent: Notmuch/0.6.1-213-ge89ce87 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sat, 20 Aug 2011 15:11:00 -0400 Message-ID: <87vctrq4or.fsf@hackervisions.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2011 20:55:32 -0000 --=-=-= On Fri, 19 Aug 2011 17:00:23 +0200, Michal Sojka 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Limit-number-of-threads-returned-by-search-in-emacs.patch >From d0421e4308473347b31f5537eaec93b137084060 Mon Sep 17 00:00:00 2001 From: James Vasile 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 --=-=-=--