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 7B739431FBC for ; Tue, 30 Apr 2013 02:52:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.363 X-Spam-Level: X-Spam-Status: No, score=0.363 tagged_above=-999 required=5 tests=[RDNS_DYNAMIC=0.363] 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 2T4VW-4anzlh for ; Tue, 30 Apr 2013 02:52:11 -0700 (PDT) Received: from mail.raorn.name (c2-81-23-10-117.elastic.cloud.croc.ru [81.23.10.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E538E431FAF for ; Tue, 30 Apr 2013 02:52:10 -0700 (PDT) Received: by mail.raorn.name (Postfix, from userid 500) id 340C219A; Tue, 30 Apr 2013 13:52:14 +0400 (MSK) Date: Tue, 30 Apr 2013 13:52:14 +0400 From: "Alexey I. Froloff" To: David Bremner Subject: Re: [PATCH] lib: Add a new prefix "list" to the search-terms syntax Message-ID: <20130430095213.GA2861@raorn.name> References: <20130409083010.GA27675@raorn.name> <1365549369-12776-1-git-send-email-raorn@raorn.name> <87vc74vn2n.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <87vc74vn2n.fsf@zancas.localnet> User-Agent: Mutt/1.5.21 (2010-12-30) Cc: notmuch@notmuchmail.org 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, 30 Apr 2013 09:52:15 -0000 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2013 at 10:12:16PM -0300, David Bremner wrote: > > + begin_list_id =3D strrchr (list_id_header, '<'); > > + if (!begin_list_id) { > > + fprintf (stderr, "Warning: Not indexing mailformed List-Id tag.\n"); > > + return; > > + } > - I guess this should say "malformed".=20 My bad. English is not my native language ;-) > - I got about 1800 lines of such messages when indexing 280k > messages. That might strike some people as excessive. On the otherhand > I guess we need to re-think error reporting overall. If I understand correctly, this code belongs to library and should not print anything neither on stderr nor stdout. OTOH, surrounding functions do print messages on error, so I just did as other do. > What do you think about printing filename or message-id here its > easier to double check that it is not a bug? Giving Message-Id makes sense. > > + void *local =3D talloc_new (message); > we should handle ENOMEM here, I think. There are 16 talloc_new() calls and ENOMEM is not handled anywhere. > > + /* _notmuch_message_add_term() may return > > + * NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG here. We can't fix it, but > > + * this is not a reason to exit with error... */ > > + if (_notmuch_message_add_term (message, "list", list_id)) > > + fprintf (stderr, "Warning: Not indexing List-Id: <%s>\n", list_id); > This should say why the indexing failed. There should be strerror-like function, then can give description for a given status code. > - We need a couple tests for this code; tests/search should give some > hints how to proceed. OK > - We need a patch for NEWS, explaining what people need to do take > advantage of the new functionality. I think that adding new prefixes > to an existing database is OK, but I'd welcome confirmation. OK --=20 Regards, -- Sir Raorn. --- http://thousandsofhate.blogspot.com/ --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJRf5RKAAoJEBd6rh2Yq9Fr+3oIAMSFO6LGdtIkmsZ0z9PSRMFP txbmq0ZIfyHrfUpre/UGDHUPhjX3n9lBMeKYcNMEO4OiswbeCr071+2AK81ZCK4a e9cBK3VdjX9Gqi58RNqfzCw4IZJfveumeQskxx9z4PFDEgl9uBQbfuc51bEj/KAA YpazoXtnhisG2UT0bO+WndbxvnGHgRb9jY1bukMjwHYVLV4f5gZ06ZGRMtXkBBjm r76BNRMx/G/h173R0t89whRsECug3HW7raPOnaeZGrKbY3e9gGn+6+4x08YynXwJ PyBjREDykmLHHEXAziDq9AjxoirdF8Er2M5dvMec0VYqSv7VmEYpXaw9ohOE0us= =kGWo -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH--