From 941e172724188eb0f65bc05035a0a6871a70ba72 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 22 Mar 2014 11:51:09 +0000 Subject: 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. --- test/test-lib.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test-lib.el b/test/test-lib.el index 37fcb3d0..437f83f4 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -165,3 +165,8 @@ nothing." (t (notmuch-test-report-unexpected output expected))))) + +;; For historical reasons, we hide deleted tags by default in the test +;; suite +(setq notmuch-tag-deleted-formats + '((".*" nil))) -- cgit v1.2.3