From: Austin Clements Date: Sat, 22 Mar 2014 02:16:09 +0000 (+2000) Subject: Re: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag formats X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f8657f8e052dc4e82bd1ac78c4f599d78cffa8a8;p=notmuch-archives.git Re: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag formats --- diff --git a/20/19125d172c37cd3d40dc6a3100ed0b5fcc5bb2 b/20/19125d172c37cd3d40dc6a3100ed0b5fcc5bb2 new file mode 100644 index 000000000..7543a692f --- /dev/null +++ b/20/19125d172c37cd3d40dc6a3100ed0b5fcc5bb2 @@ -0,0 +1,165 @@ +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 7A33B431FB6 + for ; Fri, 21 Mar 2014 19:16:21 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yTYqH0riq+0I for ; + Fri, 21 Mar 2014 19:16:15 -0700 (PDT) +Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu + [18.9.25.12]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 1A0F0431FAE + for ; Fri, 21 Mar 2014 19:16:14 -0700 (PDT) +X-AuditID: 1209190c-f794a6d000000c27-03-532cf26d60c4 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP + id B2.D7.03111.D62FC235; Fri, 21 Mar 2014 22:16:13 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s2M2GCNZ003617; + Fri, 21 Mar 2014 22:16:13 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s2M2G9Rn019751 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Fri, 21 Mar 2014 22:16:11 -0400 +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1WRBTl-0004Ow-Hn; Fri, 21 Mar 2014 22:16:09 -0400 +Date: Fri, 21 Mar 2014 22:16:09 -0400 +From: Austin Clements +To: Mark Walters +Subject: Re: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag + formats +Message-ID: <20140322021609.GB31187@mit.edu> +References: <1394597397-8486-1-git-send-email-markwalters1009@gmail.com> + <1394597397-8486-5-git-send-email-markwalters1009@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <1394597397-8486-5-git-send-email-markwalters1009@gmail.com> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0c39pBNsMOmqqMXquTwW12/OZHZg + 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4MnqnHmEruC9RcWTWLPYGxhPCXYycHBICJhId + J56wQthiEhfurWfrYuTiEBKYzSTxZvcNFghnI6PE4u7TTBDOaSaJ83/6mCGcJYwSE25+YAHp + ZxFQlej+/YcZxGYT0JDYtn85I4gtIqAjcfvQAnYQm1lAWuLb72YmEFtYIFRi3cYdYPW8QDU3 + X12F2tDOKNHcexYqIShxcuYTFohmLYkb/14CFXGADVr+jwMkzCngKTF/ykk2EFtUQEViyslt + bBMYhWYh6Z6FpHsWQvcCRuZVjLIpuVW6uYmZOcWpybrFyYl5ealFuoZ6uZkleqkppZsYQYHN + Kcmzg/HNQaVDjAIcjEo8vBe4tYOFWBPLiitzDzFKcjApifLefaATLMSXlJ9SmZFYnBFfVJqT + WnyIUYKDWUmEl+ktUI43JbGyKrUoHyYlzcGiJM4rzwE0SSA9sSQ1OzW1ILUIJivDwaEkwRv7 + EahRsCg1PbUiLTOnBCHNxMEJMpwHaLgdSA1vcUFibnFmOkT+FKOilDjvtA9ACQGQREZpHlwv + LPG8YhQHekWYNwqknQeYtOC6XwENZgIazD9VC2RwSSJCSqqB0cN7Z2KBaN0dS/0ijgvrF4S4 + rCi/fm/OSy6tzlOKVV2ah1P/Jf7MTUr8tVTA9M+32uDHJUuan8Z+OM+w1ujBFq+1AfaLUv52 + Tmmvmv/VxeqyJXu4pEh/Yxhv5hwZIaUTiz6W5c3Qi34ZcPTgpJivWeq2ggrHapt8HlQffN7z + 0/Mmt5k3Y5mxEktxRqKhFnNRcSIA7bDkHRcDAAA= +Cc: notmuch@notmuchmail.org +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: Sat, 22 Mar 2014 02:16:22 -0000 + +Quoth Mark Walters on Mar 12 at 4:09 am: +> Add customize options for deleted/added tag formats. These are not +> used yet but will be later in the series. +> +> We switch to using `notmuch-apply-face' rather than `propertize' in +> the defcustom for faces so that the faces for deleted/added tags add +> to the default face attributes for the tag. +> +> We special case deleting the unread tag as that tag is a strong visual +> cue and we don't need that cue when we are just saying it used to be +> unread. Thus, we revert to the normal tag face with strikethough for +> deleted unread tags. +> --- +> emacs/notmuch-tag.el | 37 ++++++++++++++++++++++++++++++++++++- +> 1 files changed, 36 insertions(+), 1 deletions(-) +> +> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el +> index a4dea39..4698856 100644 +> --- a/emacs/notmuch-tag.el +> +++ b/emacs/notmuch-tag.el +> @@ -39,7 +39,7 @@ (define-widget 'notmuch-tag-format-type 'lazy +> (string :tag "Display as") +> (list :tag "Face" :extra-offset -4 +> (const :format "" :inline t +> - (propertize tag 'face)) +> + (notmuch-apply-face tag)) +> (list :format "%v" +> (const :format "" quote) +> custom-face-edit)) +> @@ -89,6 +89,41 @@ (defcustom notmuch-tag-formats +> :group 'notmuch-show +> :type 'notmuch-tag-format-type) +> +> +(defcustom notmuch-tag-deleted-formats +> + '(("unread" (notmuch-apply-face "unread" +> + (if (display-supports-face-attributes-p '(:strike-through "red")) +> + '(:strike-through "red") +> + '(:inverse-video t)))) +> + (".*" (notmuch-apply-face tag +> + (if (display-supports-face-attributes-p '(:strike-through "red")) +> + '(:strike-through "red") +> + '(:inverse-video t))))) + +Aren't the two formatters above the same thing? Is this somehow +different from just having the .* formatter? The indentation also +seems a little odd, though that may just be the diff. + +> + "Custom formats for tags when deleted. +> + +> +For deleted tags the formats in `notmuch-tag-formats` are applied +> +first and then these formats are applied on top. +> + +> +By default this shows deleted tags with strike-through in red, +> +unless strike-through is not available (e.g., emacs is running in +> +a terminal) in which case it uses inverse video. To hide deleted +> +tags completely set this to +> + '((\".*\" nil)) +> + +> +See `notmuch-tag-formats' for full documentation." +> + :group 'notmuch-show +> + :type 'notmuch-tag-format-type) +> + +> +(defcustom notmuch-tag-added-formats +> + '((".*" (notmuch-apply-face tag '(:underline "green")))) +> + "Custom formats for tags when added. +> + +> +For added tags the formats in `notmuch-tag-formats` are applied +> +first and then these formats are applied on top. + +Maybe add + +To disable special formatting of added tags, set this to (). + +to parallel notmuch-tag-deleted-formats? + +> + +> +See `notmuch-tag-formats' for full documentation." +> + :group 'notmuch-show +> + :type 'notmuch-tag-format-type) +> + +> (defun notmuch-tag-format-image-data (tag data) +> "Replace TAG with image DATA, if available. +>