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 13ED5431FBC for ; Wed, 13 Jan 2010 05:11:48 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.323 X-Spam-Level: X-Spam-Status: No, score=0.323 tagged_above=-999 required=5 tests=[AWL=-0.297, BAYES_50=0.001, RCVD_IN_SORBS_WEB=0.619] autolearn=no 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 nPqamiVpGnGw for ; Wed, 13 Jan 2010 05:11:47 -0800 (PST) Received: from mail-ew0-f220.google.com (mail-ew0-f220.google.com [209.85.219.220]) by olra.theworths.org (Postfix) with ESMTP id 6F896431FAE for ; Wed, 13 Jan 2010 05:11:47 -0800 (PST) Received: by ewy20 with SMTP id 20so3790087ewy.0 for ; Wed, 13 Jan 2010 05:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=xQYpPRlBGs360YF8YIWWOq5GYtauUj1BRiF4ZNT717k=; b=rgLTeli+kK4S4f/zCs9pkq93bD6LdlfWcD+HFMEgQMLMzTIImF0N+0tl2yJRPWpTLK Sosm7rR6gX5RmgIV4DOnK6fPTyL6OjhGeJVD8+mHxRcP5jBZ6dDUAnpeQGyXlnvDsgwu LYHVTFJGf+Bz03w9c4aduaPdv0VV7iXa4ksdo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=bpVwfpX+JQCeOAT5JqK1LbyjiNWCERP9EpjmAjopdSunU4KSEai18IkvASeQDqH02P cg/4gBqw3G9hRsgs+ElvEk+mUB3Xv3T2bgeDmDHY10eqZzUC5DgRipe8CARm3+9wDH2D fUVOEEaeawNBY6zcvlHQl5IuUFiEsM1oSSQhw= Received: by 10.213.109.146 with SMTP id j18mr1138573ebp.32.1263388306368; Wed, 13 Jan 2010 05:11:46 -0800 (PST) Received: from harikalardiyari ([78.179.54.193]) by mx.google.com with ESMTPS id 7sm5102520eyg.9.2010.01.13.05.11.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Jan 2010 05:11:44 -0800 (PST) Sender: Ali Polatel Date: Wed, 13 Jan 2010 15:11:27 +0200 From: Ali Polatel To: Fernando Carrijo Message-ID: <20100113131127.GA14681@harikalardiyari> References: <874omq6up2.fsf@yahoo.com.br> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <874omq6up2.fsf@yahoo.com.br> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] [RFC/PATCH] Add search-files command 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: Wed, 13 Jan 2010 13:11:48 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=iso-8859-9 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fernando Carrijo yazm=FD=FE: > Hi Ali, Hey Fernando, > On Wed, 13 Jan 2010 12:24:22 +0200, Ali Polatel wrote: > > diff --git a/notmuch-search-files.c b/notmuch-search-files.c > > new file mode 100644 > > index 0000000..b48783a > > --- /dev/null > > +++ b/notmuch-search-files.c > > @@ -0,0 +1,107 @@ > > +/* notmuch - Not much of an email program, (just index and search) > > + * > > + * Copyright =A9 2009 Carl Worth >=20 > I almost certainly should not be speaking in the name of Carl, but a > few weeks ago he replied with the following words to a message which > somehow raised the discussion of copyright holding in notmuch source > code: >=20 > "Please feel free to retain your own copyright. I certainly don't > deserve anything being assigned to me." >=20 > The message-id of his reply is: 873a34tf8b.fsf@yoom.home.cworth.org, > just in the case you want to check the context in which it occurred. >=20 Thanks, I don't really care about who owns the copyright as long as it's open source but I'll change it if that's what Carl wishes. > > + if (*query_str =3D=3D '\0') { > > + fprintf (stderr, "Error: notmuch search-files requires at least one s= earch term.\n"); >=20 > Could we break this line so that it did not go beyond the column limit > set by the coding conventions? Maybe we should go one step further and > import the file CODING_STYLE from cairo into notmuch's repository. >=20 Sure, I didn't know much about the coding style and as you said there's no document about it in notmuch's repository. > > + return 1; > > + } > > + > > + query =3D notmuch_query_create (notmuch, query_str); > > + if (query =3D=3D NULL) { > > + fprintf (stderr, "Out of memory\n"); > > + return 1; > > + } > > + > > + notmuch_query_set_sort (query, sort); > > + > > + do_search_files (query); > > + > > + notmuch_query_destroy (query); > > + notmuch_database_close (notmuch); >=20 > It is not something of major importance, but I realized that the > function notmuch_config_close is only being called when notmuch is > executed with no arguments. As we know, the kernel shall close all > open file descriptors upon program termination, but wouldn't it be > better if we did it explicitly? Or did I overlook something? >=20 Nope, it's good coding practise to free all resources before exit, I didn't do it for config because neither the search command does it. I'll send an updated patch soonish and I'll also send a separate patch for notmuch-search.c as well. > Kind regards, > Fernando Carrijo. >=20 --=20 Regards, Ali Polatel --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEABECAAYFAktNxn8ACgkQQU4yORhF8iASsgCfcCzyBvQxJOTkalZjq8BKDEjm iuoAnilccpg0Yw56QEmLZVvmqODkMDGC =PHNC -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO--