diff options
author | Mark Walters <markwalters1009@gmail.com> | 2014-03-22 11:51:08 +0000 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-03-24 19:47:49 -0300 |
commit | d5acfdda5f9a64b934a86e5ec877b6b7d1d80a0f (patch) | |
tree | 06a7df9dad40c40177133caecbb28dc2467073e3 /emacs | |
parent | b9a777e0a3983a5b2062e927c5b426ca669da644 (diff) |
emacs: tag: add customize for deleted/added tag formats
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.
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/notmuch-tag.el | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index a4dea39d..3ae5e62f 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -39,7 +39,7 @@ (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)) @@ -87,6 +87,50 @@ See also `notmuch-tag-format-image', which can help replace tags with images." :group 'notmuch-search :group 'notmuch-show + :group 'notmuch-faces + :type 'notmuch-tag-format-type) + +(defcustom notmuch-tag-deleted-formats + '(("unread" (notmuch-apply-face bare-tag + (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))))) + "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; that is `tag' +passed to the function is the tag with all these previous +formattings applied. The formatted can access the original +unformatted tag as `bare-tag'. + +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 + :group 'notmuch-faces + :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. + +To disable special formatting of added tags, set this variable to +nil. + +See `notmuch-tag-formats' for full documentation." + :group 'notmuch-show + :group 'notmuch-faces :type 'notmuch-tag-format-type) (defun notmuch-tag-format-image-data (tag data) |