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 07655429E25 for ; Fri, 4 Nov 2011 13:25:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 Q8HKnwP2mkhP for ; Fri, 4 Nov 2011 13:25:19 -0700 (PDT) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 377E7431FB6 for ; Fri, 4 Nov 2011 13:25:19 -0700 (PDT) Received: by faan15 with SMTP id n15so52582faa.26 for ; Fri, 04 Nov 2011 13:25:17 -0700 (PDT) Received: by 10.223.5.201 with SMTP id 9mr27195270faw.5.1320438317715; Fri, 04 Nov 2011 13:25:17 -0700 (PDT) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id f4sm9920871faj.1.2011.11.04.13.25.16 (version=SSLv3 cipher=OTHER); Fri, 04 Nov 2011 13:25:16 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH v3 0/7] lib/cli/emacs: limit number of messages in search results Date: Fri, 4 Nov 2011 22:25:08 +0200 Message-Id: X-Mailer: git-send-email 1.7.5.4 Cc: amdragon@mit.edu 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, 04 Nov 2011 20:25:20 -0000 Hi, here's the third version of my output limiting patches. Changes since v2 (id:"cover.1320093940.git.jani@nikula.org"): * lib: use NOTMUCH_SORT_UNSORTED for notmuch_query_count_threads() query * cli: maxitems=0 doesn't output anything (previously it was unlimited) * cli: add --output=threads support for notmuch count * cli: some minor cleanups * test: add tests for notmuch count and search with limits Unfortunately I noticed patch 7 is BROKEN, but I'm sending these now anyway because I think patches 1-6 are good stuff and I don't have the time to fix 7 for some days. BR, Jani. PS. This is broken in patch 7: + (if (and maxitems (< 0 maxitems)) + (if oldest-first + (format "--first=-%d" maxitems) + (format "--maxitems=%d" maxitems)) + "") It should produce neither nil nor "" when (and maxitems (< 0 maxitems)) is nil. Jani Nikula (7): lib: add function to get the number of threads matching a search cli: add options --first and --maxitems to notmuch search cli: drop unused code from notmuch count cli: add support for --output parameter in notmuch count test: add tests for notmuch count test: add tests for notmuch search --first and --maxitems emacs: support limiting the number of results shown in search results emacs/notmuch-hello.el | 17 +++++++++-- emacs/notmuch.el | 53 ++++++++++++++++++++++++++++++++--- lib/notmuch.h | 14 +++++++++ lib/query.cc | 44 +++++++++++++++++++++++++++++ notmuch-count.c | 44 +++++++++--------------------- notmuch-search.c | 70 +++++++++++++++++++++++++++++++++++++++-------- test/count | 40 +++++++++++++++++++++++++++ test/notmuch-test | 2 + test/search-limiting | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 304 insertions(+), 51 deletions(-) create mode 100755 test/count create mode 100755 test/search-limiting -- 1.7.5.4