[PATCH] lib: Add a new prefix "list" to the search-terms syntax

Alexey I. Froloff raorn at raorn.name
Tue Apr 30 02:52:14 PDT 2013


On Mon, Apr 29, 2013 at 10:12:16PM -0300, David Bremner wrote:
> > +    begin_list_id = 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". 
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 = 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

-- 
Regards,    --
Sir Raorn.   --- http://thousandsofhate.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20130430/e8d93c2d/attachment-0001.pgp>


More information about the notmuch mailing list