This is version 2 of the patch

I have tried to respond to most of the feedback. Most of the changes
are folded in to the first patch, which does the basic jump
tagging. The second patch is an attempt at allowing non-automatically
reversed tagging operations. Note neither patch is properly documented

Changes are

1) I added some more default operations in the tagging jump map, for spam and 

2) You can now specify the tag changes either as a list, or as a
variable name which is the list of tag changes. For example "a" in the
tagging jumpmap is now bound to the notmuch-archive-tags so
automatically picks up the users choice of archive tags.

3) As ctrl-u is often cumbersome, and as you may decide you want to
reverse a tag operation once you are already in the tag jump map, "r"
jumps to the reverse tag map (r again returns you to the forward map)

4) The jump tag list now appears in the order they are listed in the
variable (rather than the reverse order).

5) Omit the tick box option for the name, and just have it always used,
but if the user leaves it empty the tag changes (or the variable name)
will be used as the name.

The main change I did not make was to make any of these a toggle: I
think r as reverse is sufficient and a toggle will do weird things in
too many cases. This way it is clear that "k d" *always* add the
deleted tag, whereas "k r d" always removes it.

Finally, bremner asked about non-reversible changes. I have
implemented it as follows. When you specify the tag changes you can
use any of +tag -tag #tag and =tag. The latter two mean +tag and -tag
when done forward but are omitted when reversed.

Thus, for example, "d" for deleted is set (by default) as +deleted
=inbox which means "k d" does "+deleted -inbox" but the reverse
operation "k r d" just does "-deleted" (i.e., it does not do +inbox).

The final code is a little ugly, because it has several cases to
consider, I think for a user it is all quite straightforward. Indeed,
if a user doesn't know about #,= prefixes then they lose nothing.

(There is one potential breakage: if people have any of the automatic
tags (unread,archive etc) setup so that they include tags starting =
or # and they don't specify the + or - for them (we default to +) then
the unarchive function will break. Given the benefits, and the pretty
unusual nature of this setup, this is probably acceptable)

Best wishes


Mark Walters (2):
  emacs: add tag jump menu
  emacs: tag: allow non-automatically-reversible tag operations

 emacs/notmuch-lib.el  |  4 +++
 emacs/notmuch-show.el |  1 +
 emacs/notmuch-tag.el  | 99 ++++++++++++++++++++++++++++++++++++++++++++++-----
 emacs/notmuch-tree.el |  1 +
 emacs/notmuch.el      |  1 +
 5 files changed, 97 insertions(+), 9 deletions(-)


notmuch mailing list

Reply via email to