mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
emacs: tree: use tag-format-tags
Previously tree did not use tag-format-tags: since tree wants to distinguish matching messages from non-matching messages it is not a perfect fit. However, in preparation for allowing tag-changes to be shown (i.e., added or deleted tags to be indicated) it is convenient to make all places displaying tags call the same routines. We modify notmuch-tag-format-tags slightly so that it can take and argument for the default characteristics of the face before the special tag features are applied. This also means that things like the star symbol for flagged messages all work in tree.
This commit is contained in:
parent
3c231e7e49
commit
17e44cd584
2 changed files with 10 additions and 12 deletions
|
@ -148,15 +148,16 @@ This can be used with `notmuch-tag-format-image-data'."
|
||||||
(dolist (format (cdr formats) tag)
|
(dolist (format (cdr formats) tag)
|
||||||
(setq tag (eval format))))))))
|
(setq tag (eval format))))))))
|
||||||
|
|
||||||
(defun notmuch-tag-format-tags (tags)
|
(defun notmuch-tag-format-tags (tags &optional face)
|
||||||
"Return a string representing formatted TAGS."
|
"Return a string representing formatted TAGS."
|
||||||
|
(let ((face (or face 'notmuch-tag-face)))
|
||||||
(notmuch-combine-face-text-property-string
|
(notmuch-combine-face-text-property-string
|
||||||
(mapconcat #'identity
|
(mapconcat #'identity
|
||||||
;; nil indicated that the tag was deliberately hidden
|
;; nil indicated that the tag was deliberately hidden
|
||||||
(delq nil (mapcar #'notmuch-tag-format-tag tags))
|
(delq nil (mapcar #'notmuch-tag-format-tag tags))
|
||||||
" ")
|
" ")
|
||||||
'notmuch-tag-face
|
face
|
||||||
t))
|
t)))
|
||||||
|
|
||||||
(defcustom notmuch-before-tag-hook nil
|
(defcustom notmuch-before-tag-hook nil
|
||||||
"Hooks that are run before tags of a message are modified.
|
"Hooks that are run before tags of a message are modified.
|
||||||
|
|
|
@ -704,10 +704,7 @@ unchanged ADDRESS if parsing fails."
|
||||||
(face (if match
|
(face (if match
|
||||||
'notmuch-tree-match-tag-face
|
'notmuch-tree-match-tag-face
|
||||||
'notmuch-tree-no-match-tag-face)))
|
'notmuch-tree-no-match-tag-face)))
|
||||||
(propertize (format format-string
|
(format format-string (notmuch-tag-format-tags tags face)))))))
|
||||||
(mapconcat #'identity tags " "))
|
|
||||||
'face face))))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun notmuch-tree-format-field-list (field-list msg)
|
(defun notmuch-tree-format-field-list (field-list msg)
|
||||||
"Format fields of MSG according to FIELD-LIST and return string"
|
"Format fields of MSG according to FIELD-LIST and return string"
|
||||||
|
|
Loading…
Reference in a new issue