Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 92C5B431FAF for ; Mon, 29 Oct 2012 14:19:46 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.01 X-Spam-Level: X-Spam-Status: No, score=0.01 tagged_above=-999 required=5 tests=[T_MIME_NO_TEXT=0.01] autolearn=disabled 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 mLplxX8ylsxa for ; Mon, 29 Oct 2012 14:19:46 -0700 (PDT) Received: from mail.sflc.info (mail.sflc.info [207.86.247.70]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 124C4431FBC for ; Mon, 29 Oct 2012 14:19:46 -0700 (PDT) Received: from localhost (ool-457af02d.dyn.optonline.net [69.122.240.45]) by mail.sflc.info (Postfix) with ESMTPSA id 07F35B4C018; Mon, 29 Oct 2012 21:19:44 +0000 (UTC) From: James Vasile To: David Bremner , notmuch mailing list Subject: Re: [PATCH] don't show x-foo tags in search view In-Reply-To: <87liepw0b4.fsf@convex-new.cs.unb.ca> References: <87fw4x3y3e.fsf@hackervisions.org> <87liepw0b4.fsf@convex-new.cs.unb.ca> User-Agent: Notmuch/0.12+139~g3c998ca (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Mon, 29 Oct 2012 17:19:42 -0400 Message-ID: <87625tc6xd.fsf@hackervisions.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 29 Oct 2012 21:19:46 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable This patch hides any tags in search view that match the regex specified in `notmuch-search-hide-tag-regex`. That variable can be set via setq or the customize interface. To hide all tags that begin with "x-" or "X-", set `notmuch-search-hide-tag-regex` to "^X-". =2D-- emacs/notmuch.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f9454d8..4bff538 100644 =2D-- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -775,6 +775,14 @@ non-authors is found, assume that all of the authors m= atch." (overlay-put overlay 'isearch-open-invisible #'delete-overlay))) (insert padding)))) =20 +(defcustom notmuch-search-hide-tag-regex "" + "Regex specifying tags to hide in search view. + +Leave blank to disable hiding of tags in search view. +Note: elisp regexes are case-insensitive" + :type 'string + :group 'notmuch-search) + (defun notmuch-search-insert-field (field format-string result) (cond ((string-equal field "date") @@ -793,7 +801,13 @@ non-authors is found, assume that all of the authors m= atch." (notmuch-search-insert-authors format-string (plist-get result :author= s))) =20 ((string-equal field "tags") =2D (let ((tags-str (mapconcat 'identity (plist-get result :tags) " "))) + (let ((tags-str (mapconcat 'identity + (delq nil + (mapcar (lambda (x) (if (and (not (equ= al notmuch-search-hide-tag-regex "")) + (string-m= atch notmuch-search-hide-tag-regex x)) + nil + x)) (plist-get= result :tags))) + " "))) (insert (propertize (format format-string tags-str) 'face 'notmuch-tag-face)))))) =20 =2D-=20 1.7.10.4 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJQjvLuAAoJECaDklOuuidYj5QH/0WgJ07LYYJIxQDpD+hATRSs ls20AgzzvZvDK0EWWb9I+3YR+PgxirDvmmGtMFqWNKUCOk/s7LZmRffMVHUdR1i1 3QLj8R9XqOn6UPNCGC5Bd5bYc01svIcwvgR2lPWkT+lv91I6IH0sr624RcriVDYT y8CB26gPfK+5oMbiDQ2kWGSnCF6gNxYol6VWgGEwmCtkTkwkEQqfuTspBfqQtj0V EvhRHiKF0KlgB4x+Ro/vVL5xK2LVPPdccRiirzv61cdpev+mV+0V+dw0n+vn+ei7 AR7r34B0Z8XmVc8pyUcb7lbt8Y0954g9an9jlX+DFflNDzOOpWMkvk5DE6UDBkM= =sQkK -----END PGP SIGNATURE----- --=-=-=--