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 EE1A2431FB6 for ; Fri, 3 May 2013 17:54:45 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 hDTuBELEsqJV for ; Fri, 3 May 2013 17:54:41 -0700 (PDT) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DDE4A431FAF for ; Fri, 3 May 2013 17:54:40 -0700 (PDT) Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id r440se3Y032767; Fri, 3 May 2013 21:54:40 -0300 Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net ([156.34.82.78] helo=zancas.localnet) by tesseract.cs.unb.ca with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1UYQkF-0005UT-Hg; Fri, 03 May 2013 21:54:39 -0300 Received: from bremner by zancas.localnet with local (Exim 4.80) (envelope-from ) id 1UYQk9-0005K7-Uk; Fri, 03 May 2013 21:54:29 -0300 From: David Bremner To: "Alexey I. Froloff" Subject: Re: [PATCH] lib: Add a new prefix "list" to the search-terms syntax In-Reply-To: <20130430095213.GA2861@raorn.name> References: <20130409083010.GA27675@raorn.name> <1365549369-12776-1-git-send-email-raorn@raorn.name> <87vc74vn2n.fsf@zancas.localnet> <20130430095213.GA2861@raorn.name> User-Agent: Notmuch/0.15.2+84~g12d5e4e (http://notmuchmail.org) Emacs/24.2.1 (x86_64-pc-linux-gnu) Date: Fri, 03 May 2013 21:54:29 -0300 Message-ID: <871u9nva2i.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-Spam_bar: - 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: Sat, 04 May 2013 00:54:46 -0000 "Alexey I. Froloff" writes: > >> > + void *local = talloc_new (message); >> we should handle ENOMEM here, I think. > There are 16 talloc_new() calls and ENOMEM is not handled > anywhere. This makes me a bit sad but I agree it's not your fault ;). > >> > + /* _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. There is, but only for the public status values. I guess the most correct thing would be to check for equality with NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG, print an appropriate error message if so, and otherwise use notmuch_status_to_string(COERCE_STATUS(private_status)) d