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

Jameson Graef Rollins jrollins at finestructure.net
Mon Oct 31 14:44:29 PDT 2011


On Mon, 31 Oct 2011 23:18:07 +0200, Jani Nikula <jani at nikula.org> wrote:
> Hi, this is an iteration of id:"cover.1319833617.git.jani at 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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20111031/9c2abeb3/attachment.pgp>


More information about the notmuch mailing list