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 27873431FDA for ; Thu, 28 Jan 2010 07:24:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.866 X-Spam-Level: X-Spam-Status: No, score=-0.866 tagged_above=-999 required=5 tests=[AWL=-0.867, BAYES_50=0.001] 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 gU8bDC4hJ4qQ for ; Thu, 28 Jan 2010 07:24:15 -0800 (PST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by olra.theworths.org (Postfix) with ESMTP id 5CCA7431FD5 for ; Thu, 28 Jan 2010 07:24:15 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by mx.perfora.net (node=mxus2) with ESMTP (Nemesis) id 0MAwiS-1NSmT40Z2S-00A1iP for notmuch@notmuchmail.org; Thu, 28 Jan 2010 10:24:14 -0500 Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 6428A19F33E1; Thu, 28 Jan 2010 16:24:11 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id DJfKmfYQ6mLU; Thu, 28 Jan 2010 16:24:07 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id BF0A219F3340; Thu, 28 Jan 2010 16:24:06 +0100 (CET) Received: from steelpick.localnet (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 5050EFA003; Thu, 28 Jan 2010 16:24:05 +0100 (CET) From: Michal Sojka To: notmuch@notmuchmail.org Date: Thu, 28 Jan 2010 16:24:00 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.31.11-amd64; KDE/4.3.4; x86_64; ; ) References: <200912141421.52561.lists@informa.tiker.net> <87ljfjfsok.fsf@lillypad.riseup.net> In-Reply-To: <87ljfjfsok.fsf@lillypad.riseup.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201001281624.01577.sojkam1@fel.cvut.cz> Cc: Andreas =?iso-8859-15?q?Kl=F6ckner?= Subject: Re: [notmuch] [patch] store folder information 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: Thu, 28 Jan 2010 15:24:16 -0000 On Wednesday 27 of January 2010 16:55:55 micah anderson wrote: > have not seen a reply from you yet. I'm particularly eager to see this > get accepted upstream, and it sounds like the changes necessary to do so > are relatively minor. Hi Micah and others, I wanted to test this patch, so I rebased it to the current HEAD. I had to do it manually since notmuch evolved significantly since the original posting. I'll post in followup mails. > I'm wondering what your plans are for addressing these issues? I've come > to depend on this functionality, and would love to see it incorporated > upstream! > > Specifically these were: > > 1. Unrelated whitespace: Fixed. > 2. An unrelated hunk creeping in: > > On Tue, 15 Dec 2009 13:22:19 -0800, Carl Worth wrote: > > On Mon, 14 Dec 2009 14:21:50 -0500, Andreas Kl=C3=B6ckner > > > tiker.net> wrote: > > > @@ -116,6 +116,8 @@ skip_re_in_subject (const char *subject) > > > s++; > > > if (strncasecmp (s, "re:", 3) =3D=3D 0) > > > s +=3D 3; > > > + else if (strncasecmp (s, "aw:", 3) =3D=3D 0) > > > + s +=3D 3; > > > else > > > break; > > > } Fixed. > 3. Redundant trailing directory name traversal: > > > + gchar *full_folder_name =3D NULL; > > > + gchar *folder_base_name =3D NULL; > > > + > > > + /* Find name of "folder" containing the email. */ > > > + full_folder_name =3D g_strdup(path); > > > + while (1) > > > + { > > > + folder_base_name =3D g_path_get_basename(full_folder_name); > > > > The trailing directory name is available already during the > > traversal. So you don't need to search it back out again. See the patch > > in the following message: > > > > id:87fx8bygi7.fsf@linux.vnet.ibm.com > > > > which simply passes the trailing directory name along, (but skipping a > > name of "cur" or "new" while traversing). > > 4. supporting hierarchical folders (perhaps this is a later improvement > > that does not need to be added before the original patch is accepted?): > > Beyond that, though, I imagine some people have hierarchical folders as > > well, so it probably makes sense to store them as well. > > > > To do that, it's probably just a matter of calling gen_terms on the > > complete filename. I haven't tested, but doing that should allow > > Xapian's phrase searching to do the right thing for something like: > > > > filename:portion/of/the/path/name I leave these two points for later since I do not have time for them now. If somebody want to do it, let me know. Cheers Michal