aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
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 /test
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 'test')
-rw-r--r--test/test-lib.el5
1 files changed, 5 insertions, 0 deletions
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)))