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 62E74431FBD for ; Mon, 1 Mar 2010 19:55:10 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.092 X-Spam-Level: X-Spam-Status: No, score=-2.092 tagged_above=-999 required=5 tests=[AWL=0.507, BAYES_00=-2.599] autolearn=ham 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 HTGDCo0wkNLd for ; Mon, 1 Mar 2010 19:55:09 -0800 (PST) Received: from everglades.pioto.org (everglades.pioto.org [207.192.69.249]) by olra.theworths.org (Postfix) with ESMTP id 575C5431FAE for ; Mon, 1 Mar 2010 19:55:09 -0800 (PST) Received: from aether.home.pioto.org (pool-96-236-149-110.pitbpa.fios.verizon.net [96.236.149.110]) (Authenticated sender: pioto) by everglades.pioto.org (Postfix) with ESMTPSA id 63C5A160A29 for ; Mon, 1 Mar 2010 22:54:57 -0500 (EST) Date: Mon, 1 Mar 2010 22:54:50 -0500 From: Mike Kelly To: notmuch@notmuchmail.org Message-ID: <20100301225450.10bdb8a4@aether.home.pioto.org> In-Reply-To: <87aausi3ry.fsf@SSpaeth.de> References: <20100121204201.1C82764A0E@aether.pioto.org> <87tyt3u7er.fsf@yoom.home.cworth.org> <87sk8n0xt1.fsf@aw.hh.sledj.net> <87aausi3ry.fsf@SSpaeth.de> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.18.5; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/cMarcJhLJp9bWdy8Ih4NMQm"; protocol="application/pgp-signature" Subject: Re: [notmuch] A few patches 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: Tue, 02 Mar 2010 03:55:10 -0000 --Sig_/cMarcJhLJp9bWdy8Ih4NMQm Content-Type: multipart/mixed; boundary="MP_/mum+30aW3mXxvzKoNwzfM2P" --MP_/mum+30aW3mXxvzKoNwzfM2P Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 01 Mar 2010 14:13:05 +0100 "Sebastian Spaeth" wrote: > > > to count everything. Anyone have a better option for what the > > > give-me-everything syntax should be? > >=20 > > notmuch count '' > >=20 > > The search patterns limit the matched messages/folders. An empty > > pattern should match everything. >=20 > I agree that '' should work, but then I would expect to have '*' work > as well. Is there a reason not to have both at the same time? Both > make sense. Try out this patch. It works both ways. --=20 Mike Kelly --MP_/mum+30aW3mXxvzKoNwzfM2P Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-Support-notmuch-count-with-no-args-or.patch =46rom 861a52ecaf87da6d95aabad05fd4ed3a2609a246 Mon Sep 17 00:00:00 2001 From: Mike Kelly Date: Mon, 1 Mar 2010 22:51:44 -0500 Subject: [PATCH] Support notmuch-count with no args, '', or '*' All of these will return the total count of messages. --- notmuch-count.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/notmuch-count.c b/notmuch-count.c index cc84a69..97242ab 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -90,7 +90,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[]) fprintf (stderr, "Out of memory.\n"); return 1; } - if (*query_str =3D=3D '\0') { + if (*query_str =3D=3D '\0' || (*query_str =3D=3D '*' && *(query_str+1)= =3D=3D '\0')) { query_str =3D talloc_strdup (ctx, ""); } =20 --=20 1.7.0.1 --MP_/mum+30aW3mXxvzKoNwzfM2P-- --Sig_/cMarcJhLJp9bWdy8Ih4NMQm Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAkuMjAoACgkQokMzJ47YCzqZQwCeMxvM+MfyvJ3tI4o+thWEWgjy OYMAn0UqsiHgEvcpOd3E0nFdJWR+l5A4 =tTm9 -----END PGP SIGNATURE----- --Sig_/cMarcJhLJp9bWdy8Ih4NMQm--