unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 0/2] Jump tagging
Date: Sun, 18 Sep 2016 18:04:29 +0100	[thread overview]
Message-ID: <1474218271-8312-1-git-send-email-markwalters1009@gmail.com> (raw)

This is version 2 of the patch
id:1474146583-28476-1-git-send-email-markwalters1009@gmail.com

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
yet.

Changes are

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

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


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(-)

-- 
2.1.4

             reply	other threads:[~2016-09-18 17:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 17:04 Mark Walters [this message]
2016-09-18 17:04 ` [PATCH v2 1/2] emacs: add tag jump menu Mark Walters
2016-09-20  1:18   ` David Bremner
2016-09-18 17:04 ` [PATCH v2 2/2] emacs: tag: allow non-automatically-reversible tag operations Mark Walters
2017-03-11 14:45   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474218271-8312-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).