]> git.notmuchmail.org Git - notmuch/commit
emacs: show: mark tags changed since buffer loaded
authorMark Walters <markwalters1009@gmail.com>
Sat, 22 Mar 2014 11:51:09 +0000 (11:51 +0000)
committerDavid Bremner <david@tethera.net>
Mon, 24 Mar 2014 22:48:04 +0000 (19:48 -0300)
commit941e172724188eb0f65bc05035a0a6871a70ba72
tree4d3f67f0ee4be145570cd5cd83a7f495275932e5
parentd5acfdda5f9a64b934a86e5ec877b6b7d1d80a0f
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.
emacs/notmuch-show.el
emacs/notmuch-tag.el
emacs/notmuch-tree.el
emacs/notmuch.el
test/test-lib.el