emacs: make the remaining faces configurable.

I believe this moves all "anonymous" face specifications in notmuch
code into a configurable defface.
This commit is contained in:
Matt Armstrong 2016-08-14 15:17:42 -07:00 committed by David Bremner
parent 3856286e21
commit d25d33ff2d
2 changed files with 38 additions and 15 deletions

8
NEWS
View file

@ -6,10 +6,10 @@ Emacs
Face customization is easier Face customization is easier
New faces `notmuch-search-flagged-face` and New faces `notmuch-tag-unread`, `notmuch-tag-flagged`,
`notmuch-search-unread-face` are used by default by `notmuch-tag-deleted`, `notmuch-tag-added`,
`notmuch-search-line-faces`. Customize `notmuch-faces` to modify `notmuch-search-flagged-face` and `notmuch-search-unread-face` are
them. now used by default. Customize `notmuch-faces` to modify them.
Ruby Bindings Ruby Bindings
------------- -------------

View file

@ -56,9 +56,23 @@
(string :tag "Custom"))) (string :tag "Custom")))
(sexp :tag "Custom"))))) (sexp :tag "Custom")))))
(defface notmuch-tag-unread
'((t :foreground "red"))
"Default face used for the unread tag.
Used in the default value of `notmuch-tag-formats`."
:group 'notmuch-faces)
(defface notmuch-tag-flagged
'((t :foreground "blue"))
"Face used for the flagged tag.
Used in the default value of `notmuch-tag-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-formats (defcustom notmuch-tag-formats
'(("unread" (propertize tag 'face '(:foreground "red"))) '(("unread" (propertize tag 'face 'notmuch-tag-unread))
("flagged" (propertize tag 'face '(:foreground "blue")) ("flagged" (propertize tag 'face 'notmuch-tag-flagged)
(notmuch-tag-format-image-data tag (notmuch-tag-star-icon)))) (notmuch-tag-format-image-data tag (notmuch-tag-star-icon))))
"Custom formats for individual tags. "Custom formats for individual tags.
@ -90,15 +104,17 @@ with images."
:group 'notmuch-faces :group 'notmuch-faces
:type 'notmuch-tag-format-type) :type 'notmuch-tag-format-type)
(defface notmuch-tag-deleted
'((((class color) (supports :strike-through)) :strike-through "red")
(t :inverse-video t))
"Face used to display deleted tags.
Used in the default value of `notmuch-tag-deleted-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-deleted-formats (defcustom notmuch-tag-deleted-formats
'(("unread" (notmuch-apply-face bare-tag '(("unread" (notmuch-apply-face bare-tag `notmuch-tag-deleted))
(if (display-supports-face-attributes-p '(:strike-through "red")) (".*" (notmuch-apply-face tag `notmuch-tag-deleted)))
'(: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. "Custom formats for tags when deleted.
For deleted tags the formats in `notmuch-tag-formats` are applied For deleted tags the formats in `notmuch-tag-formats` are applied
@ -118,8 +134,15 @@ See `notmuch-tag-formats' for full documentation."
:group 'notmuch-faces :group 'notmuch-faces
:type 'notmuch-tag-format-type) :type 'notmuch-tag-format-type)
(defface notmuch-tag-added
'((t :underline "green"))
"Default face used for added tags.
Used in the default value for `notmuch-tag-added-formats`."
:group 'notmuch-faces)
(defcustom notmuch-tag-added-formats (defcustom notmuch-tag-added-formats
'((".*" (notmuch-apply-face tag '(:underline "green")))) '((".*" (notmuch-apply-face tag 'notmuch-tag-added)))
"Custom formats for tags when added. "Custom formats for tags when added.
For added tags the formats in `notmuch-tag-formats` are applied For added tags the formats in `notmuch-tag-formats` are applied