Re: [PATCH] emacs: add tag jump menu

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

Date: Sun, 18 Sep 2016 19:45:49 +0300

To: Jani Nikula, Mark Walters, notmuch@notmuchmail.org

Cc:

From: Ioan-Adrian Ratiu


On Sun, 18 Sep 2016, Jani Nikula <jani@nikula.org> wrote:
> On Sun, 18 Sep 2016, Ioan-Adrian Ratiu <adi@adirat.com> wrote:
>> On Sun, 18 Sep 2016, Mark Walters <markwalters1009@gmail.com> wrote:
>>> 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.
>>
>> My workflow with the kind of code shown above is as follows:
>>
>> If in notmuch-search then pressing 'd' "deletes" everything selected,
>> including multiple messages in a region and if a thread was selected in
>> that region then the entire thread is deleted.
>
> You are not addressing the toggle case where some of the messages in
> those threads have the tag, and some do not. How should notmuch know
> whether you want to add or remove the deleted tag?

In my usecase when I toggle a tag to a thread in notmuch-search, it is
applied to all mails, obviously, and if I want to do per-mail tagging I
go into notmuch-show. To answer your question I'll give an example:

Suppose I have just some subset of a thread's mails tagged "+inbox" and
I toggle pressing "i", then all the mails in that thread are marked
"+inbox" and if I toggle again all are "-inbox". So removing a tag for a
subset of the thread's mails is just a matter of toggling twice.

I can always go in notmuch-show and do per-email tagging using toggles,
say after I removed the "inbox" tag in the example above by toggling
twice, I open the thread in notmuch-show and press "i" to toggle the tag
back on any specific email.

I'm using this for some time and it works really well :)

>
>> IMO this is the simplest and the clearest workflow.
>
> While working on Notmuch, one of the main lessons I've learned is that
> *everyone* has their own, personal email workflow. We need to try to
> give people discoverable and intuitive *mechanisms* on dealing with
> email, and let people build their own workflows that suit them.

Yes, I agree that it's better to provide mechanism than policy because
workflows are so different. Tag toggling is just another mechanism, it
can be customized, for example, when you toggle on a thread of which
some mails already are tagged, should it add or remove that tag? This
can be configured through a variable.

>
> (That said, I always try to encourage people to rethink their workflows
> when switching to Notmuch. But it's still *their* workflow.)
>
>
> BR,
> Jani.

Thread: