unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jean-Marc Liotier <jm@liotier.org>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: Alternative to no longer supported folder:foo* wildcard matching ?
Date: Tue, 10 Mar 2015 13:21:38 +0100	[thread overview]
Message-ID: <54FEE1D2.9000108@liotier.org> (raw)
In-Reply-To: <87a8zlxr86.fsf@maritornes.cs.unb.ca>

On 10/03/2015 08:10, David Bremner wrote:
> [..] In fact the NM_myTopLevelFolder doesn't seem useful to me,
> since you don't gain any new queries that way.
>
> So if you have .foo.*  and .bar.*, I would
>
> mkdir foo
> ln -rs .foo.* -t foo

I had forgotten I could make a maildir without initial . just as well - 
thus removing the need for my silly prefix: with dot is a normal 
maildir, without is a top-level Notmuch symlink container.

> in notmuch jargon, the number of _messages_ does not increase but 
> rather the number of _files_.

That makes sense since, from what I read in notmuch-insert.c,  the 
messages are identified by message-id and therefore counted only once 
however many times they are encountered during notmuch new.

> so --remove-dups becomes
> mandatory in any search query
> Based on the name, I'd suspect "remove-dups" corresponds roughly to the
> default behaviour of notmuch in reporting results.

Yes, though --duplicate=N is only supported with --output=files and 
--output=messages, and it is not even appear the default there since { 
NOTMUCH_OPT_INT, &ctx->dupe, "duplicate", 'D', 0  } in notmuch-search.c

Otherwise it does behaves as implicitly removing duplicates, which was 
somewhat confusing me until I understood notmuch's conceptual 
distinction between files and messages.

>          notmuch count not 'path:list/**'
> and
>          notmuch count not 'path:list/**' and from:bremner
>
> work as expected.

Indeed they do - both with notmuch and notmuch-mutt... I just had to 
struggle a bit until I realized that my notmuch-mutt --output-dir is 
inside the maildir indexed by notmuch... So the number of result and 
duplicates varied according to what state the symlink results maildir 
was in when I last indexed the whole thing...

Yes, I do need the --output-dir to be inside the maildir because the 
IMAP server lets me have my search results in any MUA I happen to be 
using (Thunderbird, K-9 or Outlook for example). And by the way, maybe 
notmuch-mutt should be named notmuch-maildir or notmuch-symlinks : the 
mutt part is just about setting the macros in ~/.muttrc - everything 
else is generic to anything that can read a maildir.

So my indexing command is now :

notmuch tag +nmsearchresult 'path:.=Search/**' && notmuch new

With ~/.notmuch-config now containing:

[search]
exclude_tags=deleted;spam;nmsearchresult

And it works.

I would have prefered explicit folder inclusion/exclusion at query time 
and path inclusion/exclusion at indexing time... But I guess I'll get 
used to notmuch's logic of tagging everything and then using the tags.

Thank you for your kind guidance !

  reply	other threads:[~2015-03-10 12:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 19:55 Alternative to no longer supported folder:foo* wildcard matching ? Jean-Marc Liotier
2015-03-09 22:06 ` David Bremner
2015-03-10  0:16   ` Jean-Marc Liotier
2015-03-10  7:10     ` David Bremner
2015-03-10 12:21       ` Jean-Marc Liotier [this message]
2015-03-10 13:25         ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FEE1D2.9000108@liotier.org \
    --to=jm@liotier.org \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).