X-Git-Url: https://git.notmuchmail.org/git?p=notmuch-wiki;a=blobdiff_plain;f=faq.mdwn;h=bb0efaa90c2b458ca5e6ec9ea1486e52d7da072a;hp=d6112132148a0c9682c702b73c2ff4c3c9669a7b;hb=a88f545ad6b18eb609ace3f0fd3412bdaebe99ce;hpb=fa6a1c33a3f78d16cbcc15f3b17a00abdf801a32 diff --git a/faq.mdwn b/faq.mdwn index d611213..bb0efaa 100644 --- a/faq.mdwn +++ b/faq.mdwn @@ -26,3 +26,30 @@ See [[excluding]]. (setq message-citation-line-function 'message-insert-formatted-citation-line) See help for `message-citation-line-format` for details. + +## How do I search for messages that have no tags? + +Unfortunately, there is no way to do this directly. + +However, it's possible to accomplish this using two searches in shell. First, +you need to query all tags in the database, and transform the result into a +query that matches messages that have none of those tags: + + $ notmuch search --output=tags \* | sed 's/^/not tag:/;2~1s/^/and /' + +Next, use that to query the messages: + + $ notmuch search $(notmuch search --output=tags \* | \ + sed 's/^/not tag:/;2~1s/^/and /') + +## How do I search for punctuation, specific special characters, or regexp? + +Please see the [[notmuch-search-terms manual +page|manpages/notmuch-search-terms-7]] first. + +The main thing to understand is that Xapian, and therefore Notmuch, searches are +closer to natural language searches than regular expression +searches. Punctuation is mostly ignored. + +The boolean prefix searches (see Boolean and Probabilistic Prefixes in the man +page), such as tag: or path: searches, need an exact match.