On Sun, 18 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote: > Hi > > I have implemented something similar in my tree and I really like the > idea. I have one issue though. > > On Sat, 17 Sep 2016, Mark Walters <markwalters1009@gmail.com> wrote: >> 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. > > I know C-u is default emacs behaviour but I find very cumbersone to do > C-u for unapplying the tag. What I do and want is to simply apply the > tag when pressing "d" then unapply it when pressing "d" again if the > mail/thread already contains the deleted tag (basically it's a toggle). I agree that C-u is a little cumbersome -- I think I would be happy for a toggle for single messages (with a single tag change), but for multiple messages like a thread I think it would be very unclear what it was doing. In your example I think d on a thread with a deleted message would undelete the thread, rather than deleting the other messages in the thread. But whichever of the two we chose I could see people being unsure which it was going to do. It would be plausible to modify my patch so that k u does the same as Ctrl-u k (i.e. takes you to the reverse tag operations) which would avoid the awkward ctrl-u. (I don't want to add another key to the top level maps as we are really very short on free keys) Best wishes Mark > Here's an example of code I'm using: > > (define-key notmuch-show-mode-map "d" > (lambda () > "toggle deleted tag for message" > (interactive) > (if (member "deleted" (notmuch-show-get-tags)) > (notmuch-show-tag (list "-deleted")) > (notmuch-show-tag (list "+deleted"))))) > > (define-key notmuch-search-mode-map "d" > (lambda (&optional beg end) > "toggle deleted tag for message" > (interactive (notmuch-search-interactive-region)) > (if (member "deleted" (notmuch-search-get-tags)) > (notmuch-search-tag (list "-deleted") beg end) > (notmuch-search-tag (list "+deleted") beg end)))) > > It works really well for me :). "inbox" and other tags work similarly. >