unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Cc: amdragon@mit.edu
Subject: Re: [RFC PATCH v2 0/3] lib/cli/emacs: limit number of messages in search results
Date: Mon, 31 Oct 2011 14:44:29 -0700	[thread overview]
Message-ID: <87fwi86dky.fsf@servo.finestructure.net> (raw)
In-Reply-To: <cover.1320093940.git.jani@nikula.org>

[-- Attachment #1: Type: text/plain, Size: 1836 bytes --]

On Mon, 31 Oct 2011 23:18:07 +0200, Jani Nikula <jani@nikula.org> wrote:
> Hi, this is an iteration of id:"cover.1319833617.git.jani@nikula.org" addressing
> comments on the list and IRC. Main changes:
> 
> * Results are now limited based on threads (not messages) for thread and summary
>   output. This is accomplished with a new lib function to count the number of
>   threads in matching messages.
> 
> * cli part is now inspired by James Vasile's patch
>   id:"8739gyw0zh.fsf@opensourcematters.org", with the additional ability to
>   limit from the end of result set.
> 
> * Bugs reported by Daniel Schoepe fixed.
> 
> * Don't show buttons if everything is visible already.
> 
> I'm still marking it as RFC. It works for me, but patch 1 might be deemed
> unacceptable.

Hi, Jani.  Thanks for working on this.  This should also be valuable for
vim users.

In order to push forward with this, though, I think we really need to
have a complete unit test for this new functionality.  We usually like
to see units tests that describe and then test for the new functionality
you wish to add, followed by the patches that provide the new
functionality.  Lots of good tests for new functionality being proposed
here shouldn't be too difficult to work out ahead of time.

For instance, here's an example of a test that I would like to see:

test_begin_subtest "maxitems does the right thing"
notmuch search tag:foo | head -n 20 >expected
notmuch search --maxitems=20 tag:foo >output
test_expect_equal_file expected output

test_begin_subtest "concatenation of limited searches does the right thing"
notmuch search tag:foo | head -n 20 >expected
notmuch search --maxitems=10 tag:foo >output
notmuch search --maxitems=10 --first=10 tag:foo >>output
test_expect_equal_file expected output


jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

  parent reply	other threads:[~2011-10-31 21:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 21:18 [RFC PATCH v2 0/3] lib/cli/emacs: limit number of messages in search results Jani Nikula
2011-10-31 21:18 ` [RFC PATCH v2 1/3] lib: add function to get the number of threads matching a search Jani Nikula
2011-10-31 21:18 ` [RFC PATCH v2 2/3] cli: add options --first and --maxitems to notmuch search Jani Nikula
2011-10-31 21:18 ` [RFC PATCH v2 3/3] emacs: support limiting the number of results shown in search results Jani Nikula
2011-11-04 20:54   ` Austin Clements
2011-11-06 20:57     ` Jani Nikula
2011-10-31 21:44 ` Jameson Graef Rollins [this message]
2011-10-31 22:07   ` [RFC PATCH v2 0/3] lib/cli/emacs: limit number of messages " Jani Nikula
2011-10-31 22:19     ` Jameson Graef Rollins
2011-11-04 20:21     ` Austin Clements
2011-11-01 12:30 ` David Bremner
2011-11-02  9:27   ` Jani Nikula

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=87fwi86dky.fsf@servo.finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=amdragon@mit.edu \
    --cc=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /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).