mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
emacs: tag split customise option for format-tags into a widget
We will re-use the customize option for format-tags for formattting deleted tags to added tags in the next patch so split it into a widget. There should be no functional change.
This commit is contained in:
parent
7023466ece
commit
b9a777e0a3
1 changed files with 29 additions and 26 deletions
|
@ -28,6 +28,34 @@
|
||||||
(require 'crm)
|
(require 'crm)
|
||||||
(require 'notmuch-lib)
|
(require 'notmuch-lib)
|
||||||
|
|
||||||
|
(define-widget 'notmuch-tag-format-type 'lazy
|
||||||
|
"Customize widget for notmuch-tag-format and friends"
|
||||||
|
:type '(alist :key-type (regexp :tag "Tag")
|
||||||
|
:extra-offset -3
|
||||||
|
:value-type
|
||||||
|
(radio :format "%v"
|
||||||
|
(const :tag "Hidden" nil)
|
||||||
|
(set :tag "Modified"
|
||||||
|
(string :tag "Display as")
|
||||||
|
(list :tag "Face" :extra-offset -4
|
||||||
|
(const :format "" :inline t
|
||||||
|
(propertize tag 'face))
|
||||||
|
(list :format "%v"
|
||||||
|
(const :format "" quote)
|
||||||
|
custom-face-edit))
|
||||||
|
(list :format "%v" :extra-offset -4
|
||||||
|
(const :format "" :inline t
|
||||||
|
(notmuch-tag-format-image-data tag))
|
||||||
|
(choice :tag "Image"
|
||||||
|
(const :tag "Star"
|
||||||
|
(notmuch-tag-star-icon))
|
||||||
|
(const :tag "Empty star"
|
||||||
|
(notmuch-tag-star-empty-icon))
|
||||||
|
(const :tag "Tag"
|
||||||
|
(notmuch-tag-tag-icon))
|
||||||
|
(string :tag "Custom")))
|
||||||
|
(sexp :tag "Custom")))))
|
||||||
|
|
||||||
(defcustom notmuch-tag-formats
|
(defcustom notmuch-tag-formats
|
||||||
'(("unread" (propertize tag 'face '(:foreground "red")))
|
'(("unread" (propertize tag 'face '(:foreground "red")))
|
||||||
("flagged" (propertize tag 'face '(:foreground "blue"))
|
("flagged" (propertize tag 'face '(:foreground "blue"))
|
||||||
|
@ -57,34 +85,9 @@ of a tag to red, use the expression
|
||||||
|
|
||||||
See also `notmuch-tag-format-image', which can help replace tags
|
See also `notmuch-tag-format-image', which can help replace tags
|
||||||
with images."
|
with images."
|
||||||
|
|
||||||
:group 'notmuch-search
|
:group 'notmuch-search
|
||||||
:group 'notmuch-show
|
:group 'notmuch-show
|
||||||
:type '(alist :key-type (regexp :tag "Tag")
|
:type 'notmuch-tag-format-type)
|
||||||
:extra-offset -3
|
|
||||||
:value-type
|
|
||||||
(radio :format "%v"
|
|
||||||
(const :tag "Hidden" nil)
|
|
||||||
(set :tag "Modified"
|
|
||||||
(string :tag "Display as")
|
|
||||||
(list :tag "Face" :extra-offset -4
|
|
||||||
(const :format "" :inline t
|
|
||||||
(propertize tag 'face))
|
|
||||||
(list :format "%v"
|
|
||||||
(const :format "" quote)
|
|
||||||
custom-face-edit))
|
|
||||||
(list :format "%v" :extra-offset -4
|
|
||||||
(const :format "" :inline t
|
|
||||||
(notmuch-tag-format-image-data tag))
|
|
||||||
(choice :tag "Image"
|
|
||||||
(const :tag "Star"
|
|
||||||
(notmuch-tag-star-icon))
|
|
||||||
(const :tag "Empty star"
|
|
||||||
(notmuch-tag-star-empty-icon))
|
|
||||||
(const :tag "Tag"
|
|
||||||
(notmuch-tag-tag-icon))
|
|
||||||
(string :tag "Custom")))
|
|
||||||
(sexp :tag "Custom")))))
|
|
||||||
|
|
||||||
(defun notmuch-tag-format-image-data (tag data)
|
(defun notmuch-tag-format-image-data (tag data)
|
||||||
"Replace TAG with image DATA, if available.
|
"Replace TAG with image DATA, if available.
|
||||||
|
|
Loading…
Reference in a new issue