Re: [PATCH] emacs: add tag jump menu

Subject: Re: [PATCH] emacs: add tag jump menu

Date: Sun, 18 Sep 2016 10:31:31 -0300

To: Mark Walters, notmuch@notmuchmail.org

Cc:

From: David Bremner


Mark Walters <markwalters1009@gmail.com> writes:

> Add a "jump" style menu for doing tagging operations.
> ---
>
> Jani suggested something like this on irc today. This is a first cut
> to see if people like it. By default the tagging jump menu is bound to
> k (which works in search/show/tree mode), and has the following options
>
> a (Archive) -inbox -unread
> u (Mark Read) -unread
> d (Delete)  +deleted
>
> If you do ctrl-u k the it will do the reverse operation.
>
> To customize you want the variable notmuch-tagging-keys in the group
> notmuch-tag. It is only very lightly tested but seems to work. And the
> docstrings will definitely need some work.

1) I was playing with moving my notmuch patch review workflow to this
setup, and I discovered that most of my tagging combos don't undo very
well. Basically that's because the represent transitions from multiple
states into a single one, e.g.

     ("p"
      ("+pending" "+notmuch::patch" "-notmuch::needs-review"
                  "-notmuch::moreinfo" "-notmuch::pushed"))

So if use "k p" then it's unlikely that the message had all three tags
with "-". To be clear, my current setup doesn't allow undo at all, so
I'm not losing anything.

If we think about the operation as reverse rather than undo, it might be
nice to have non-reversable operations that are ignored when doing the
reverse, e.g.

     ("p" ("+pending" "=notmuch::patch" "#notmuch::needs-review"
           "#notmuch::moreinfo" "#notmuch::pushed"))

meaning unreversed, add pending and notmuch::patch and delete
                    notmuch::(needs-review, moreinfo, pushed)

while reversed only deletes pending.  A simpler implimentation would
have two lists of operations, one that is ignored on reverse.

I'm not sure if people will buy into this idea of non-reversible
operations, and it could be a future enhancement (although changing the
customize structure is a mild hassle).  In any case this distinction
between undo and reverse is worth keeping in mind when working on the
docs.

2) Would it be hard/possible to define submaps ?  I have 9 tagging
commands related to notmuch maintence, and it seems like it would be
nicer to have those as e.g. "k n p" rather than clutter up the top level
"k <letter>" map.

This could also be a future enhancement

Thread: