Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C1A83429E25 for ; Thu, 18 Aug 2011 20:16:03 -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 3ao5yi3eT0DW for ; Thu, 18 Aug 2011 20:16:02 -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 0CAC2431FD0 for ; Thu, 18 Aug 2011 20:16:02 -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 1QuFZo-0002ZK-Cn for notmuch@notmuchmail.org; Thu, 18 Aug 2011 23:16:56 -0400 From: James Vasile To: notmuch@notmuchmail.org Subject: [PATCH] Return maximum of 150 results User-Agent: Notmuch/0.6.1-213-ge89ce87 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 18 Aug 2011 23:15:55 -0400 Message-ID: <87zkj6um50.fsf@opensourcematters.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Fri, 19 Aug 2011 03:16:03 -0000 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