unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] don't show x-foo tags in search view
@ 2012-10-29 18:57 James Vasile
  2012-10-29 19:22 ` David Bremner
  2012-10-30  9:41 ` Damien Cassou
  0 siblings, 2 replies; 11+ messages in thread
From: James Vasile @ 2012-10-29 18:57 UTC (permalink / raw)
  To: notmuch mailing list

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-07 14:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 18:57 [PATCH] don't show x-foo tags in search view James Vasile
2012-10-29 19:22 ` David Bremner
2012-10-29 19:47   ` James Vasile
2012-10-29 21:19   ` James Vasile
2012-10-30  0:57     ` Austin Clements
2012-10-30 14:57       ` James Vasile
2012-11-07 12:44         ` David Bremner
2012-11-07 14:15           ` James Vasile
2012-11-07 14:37         ` Austin Clements
2012-10-30  9:41 ` Damien Cassou
2012-10-30 16:42   ` James Vasile

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).