aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-tree.el
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2014-03-22 11:51:09 +0000
committerGravatar David Bremner <david@tethera.net>2014-03-24 19:48:04 -0300
commit941e172724188eb0f65bc05035a0a6871a70ba72 (patch)
tree4d3f67f0ee4be145570cd5cd83a7f495275932e5 /emacs/notmuch-tree.el
parentd5acfdda5f9a64b934a86e5ec877b6b7d1d80a0f (diff)
emacs: show: mark tags changed since buffer loaded
This allows (and requires) the original-tags to be passed along with the current-tags to be passed to notmuch-tag-format-tags. This allows the tag formatting to show added and deleted tags.By default a removed tag is displayed with strike-through in red (if strike-through is not available, eg on a terminal, inverse video is used instead) and an added tag is displayed underlined in green. If the caller does not wish to use the new feature it can pass current-tags for both arguments and, at this point, we do exactly that in the three callers of this function. Note, we cannot tidily allow original-tags to be optional because we would need to distinguish nil meaning "we are not specifying original-tags" from nil meaning there were no original-tags (an empty list). We use this in subsequent patches to make it clear when a message was unread when you first loaded a show buffer (previously the unread tag could be removed before a user realised that it had been unread). The code adds into the existing tag formatting code. The user can specify exactly how a tag should be displayed normally, when deleted, or when added. Since the formatting code matches regexps a user can match all deleted tags with a ".*" in notmuch-tag-deleted-formats. For example setting notmuch-tag-deleted-formats to '((".*" nil)) tells notmuch not to show deleted tags at all. All the variables are customizable; however, more complicated cases like changing the face depending on the type of display will require custom lisp. Currently this overrides notmuch-tag-deleted-formats for the tests setting it to '((".*" nil)) so that they get removed from the display and, thus, all tests still pass.
Diffstat (limited to 'emacs/notmuch-tree.el')
-rw-r--r--emacs/notmuch-tree.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index c78d9de5..8bf2fbc5 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -704,7 +704,7 @@ unchanged ADDRESS if parsing fails."
(face (if match
'notmuch-tree-match-tag-face
'notmuch-tree-no-match-tag-face)))
- (format format-string (notmuch-tag-format-tags tags face)))))))
+ (format format-string (notmuch-tag-format-tags tags tags face)))))))
(defun notmuch-tree-format-field-list (field-list msg)
"Format fields of MSG according to FIELD-LIST and return string"