[PATCH] don't show x-foo tags in search view

James Vasile james at hackervisions.org
Mon Oct 29 11:57:41 PDT 2012


My filters create tags like x-bogotrained-spam that are for internal
bookkeeping.  I don't mind seeing them in the 'show' view, but I didn't
want them cluttering my 'search' view.  This patch omits x-foo and X-foo
tags from the 'search' view.

---
 emacs/notmuch.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index f9454d8..90fafbf 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -793,7 +793,12 @@ non-authors is found, assume that all of the authors match."
     (notmuch-search-insert-authors format-string (plist-get result :authors)))
 
    ((string-equal field "tags")
-    (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))
+    (let ((tags-str (mapconcat 'identity
+                              (delq nil
+                                    (mapcar (lambda (x) (if (equal (upcase (truncate-string-to-width  x 2)) "X-")
+                                                            nil
+                                                            (identity x))) (plist-get result :tags)))
+                              " ")))
       (insert (propertize (format format-string tags-str)
                          'face 'notmuch-tag-face))))))
 
-- 
1.7.10.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20121029/15060333/attachment.pgp>


More information about the notmuch mailing list