From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A283C431FBF; Tue, 15 Dec 2009 13:22:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 bYvptj4LMOsi; Tue, 15 Dec 2009 13:22:20 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EABE4431FAE; Tue, 15 Dec 2009 13:22:19 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 890B1254306; Tue, 15 Dec 2009 13:22:19 -0800 (PST) From: Carl Worth To: Andreas =?iso-8859-1?q?Kl=F6ckner?= , notmuch@notmuchmail.org In-Reply-To: <200912141421.52561.lists@informa.tiker.net> References: <200912141421.52561.lists@informa.tiker.net> Date: Tue, 15 Dec 2009 13:22:19 -0800 Message-ID: <87zl5k0w6s.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [patch] store folder information X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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, 15 Dec 2009 21:22:20 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, 14 Dec 2009 14:21:50 -0500, Andreas Kl=C3=B6ckner wrote: > I've patched notmuch to retain information on which folder emails are sto= red=20 > in. This makes the transition from a folders-and-procmail model somewhat= =20 > easier. The resulting changes are attached. Very nice. I like this idea very much. (We recently had discussions about automatically adding tags based on the directories in which mail files were found, and I said I'd prefer a solution which allowed the user to search on the directory name instead.) > @@ -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; > } This hunk looks unrelated to the rest. Could you submit that separately, please? > + 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). That kind of approach looks a lot nice to me. 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 think something like that is what I would like to see. =2DCarl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLJ/4L6JDdNq8qSWgRAlqQAJ450V1v9PiBPbdZtBL+LQQUP6xpZgCgnsDT ZAamkCwVBB/VzW5Sg3s0214= =8NFI -----END PGP SIGNATURE----- --=-=-=--