Re: [RFC PATCH v2 0/3] lib/cli/emacs: limit number of messages in search results

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

To: Jani Nikula, notmuch@notmuchmail.org

Cc: amdragon@mit.edu

From: Jameson Graef Rollins


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.
part-000.sig (application/pgp-signature)

Thread: