Subject: [sup-talk] [PATCH] Add 'a' and 'd' keybindings to thread-view-mode to archive/delete current thread

From: [email-masked] (Carl Worth)
Date: Wed, 26 Aug 2009 15:40:34 -0700

These behave identically to the existing ",a" and ",d" commands, (that
is they archive or delete the current thread and then view the next).
---

I appreciate that within thread-view-mode, sup already supports
explicitly selecting one of three different actions for what do after
the user is done with a thread. And the choice is determined by one of
three different prefix characters. For example:

    . -> return to previous buffer (likely something like
         inbox-mode/search-result-mode)
    , -> advance to next thread (into thread-view-mode)
    ] -> advance to previous thread (into thread-view-mode)

I'm lazy enough to want a single-character command for efficient
processing of mail in thread-view-mode, (just like I already have
while in inbox-mode and search-results-mode). And for two of the
different actions, (archive and delete), the obvious/consistent
keybinding is available. So this patch assigns those, ('a' as a
shortcut for ',a' and 'd' as a shortcut for ',d').

If I seem too lazy here, and it doesn't seem sane to add these
keybindingd by default, just let me know. In that case I'll consign
myself to just using a hook to setup these keybindings for myself
personally.

The perhaps-not-as-obvious piece is what the exit action should be for
these shortcut commands. For my own use, I've found it best to advance
to the next thread. (This supports a workflow where there's one pass
through the inbox to archive as much as possible without reading, and
then another pass through thread-view-mode for everything that's
left.)

One thing this patch doesn't provide is shortcuts for the other three
exit actions, (',s' for mark-as-spam-then-next, ',N' for
mark-as-unread-then-next, and ',n' for simply advancing to the next
thread without changing the current thread).

Of those, the only one I really care about personally is ',n'. It's
obviously not a simple matter of just making 'n' a shortcut for ',n'
since the 'n' keybinding is already used. But actually, I think I
would like the 'n' keybinding to advance to the next thread once I'm
viewing the last open message in the current thread. This would make
for very efficient sessions of just reading mail, where I'd only need
to keep hitting 'n', (and I could hit 'a' whenever bored with any
particular thread). So perhaps I'll look into coding that up next.

 lib/sup/modes/thread-view-mode.rb |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 678b841..0706757 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -64,6 +64,9 @@ EOS
     k.add :unsubscribe_from_list, "Subscribe to/unsubscribe from mailing list", ")"
     k.add :pipe_message, "Pipe message or attachment to a shell command", '|'
 
+    k.add :archive_and_next, "Archive this thread, kill buffer, and view next", 'a'
+    k.add :delete_and_next, "Delete this thread, kill buffer, and view next", 'd'
+
     k.add_multi "(a)rchive/(d)elete/mark as (s)pam/mark as u(N)read:", '.' do |kk|
       kk.add :archive_and_kill, "Archive this thread and kill buffer", 'a'
       kk.add :delete_and_kill, "Delete this thread and kill buffer", 'd'
-- 
1.6.3.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090826/ac261bb3/attachment.bin>

---

From: [email-masked] (William Morgan)
Date: Thu, 03 Sep 2009 11:06:55 -0700

> is they archive or delete the current thread and then view the next).

Sorry it's taken me so long to look at this. Thanks for the patch!

I'm curious what other people think about this. On the one hand, it's
only additional keybindings, so it's not going to adversely affect
anyone. On the other hand, there is a nice balance with the ".", ","
and "]" commands which this disrupts, and it can't be extended to the
other commands from thread-index-mode. And on the third hand, I'm happy
to have keybinding hooks.

I guess if most people primarily closes their thread-view-modes using
",a" and ",d", then I'm fine with this.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Mark Alexander)
Date: Thu, 03 Sep 2009 14:37:34 -0400

> ",a" and ",d", then I'm fine with this.

Those are perhaps my most-commonly used commands in sup, so having
them shortened is a very nice improvement.

---

From: [email-masked] (Nicholas Bergson-Shilcock)
Date: Thu, 03 Sep 2009 14:58:45 -0400

> them shortened is a very nice improvement.

+1. These would be quite helpful for me.

---

From: [email-masked] (Nicolas Pouillard)
Date: Sun, 06 Sep 2009 21:43:06 +0200

> ",a" and ",d", then I'm fine with this.

I personally do prefer ]a and ]d, to read mail in the chronological order.

-- 
Nicolas Pouillard
http://nicolaspouillard.fr

---

From: [email-masked] (Wirt Wolff)
Date: Tue, 08 Sep 2009 09:17:18 -0600

> ",a" and ",d", then I'm fine with this.

Don't mind having 'a' and 'd' around, but likely won't use them.
Generally I pass down index with &, A, S, etc. occaisionally reading
high priority thread, then ]n, ]a etc. back up in thread view.

--
wmw

---

From: [email-masked] (William Morgan)
Date: Tue, 08 Sep 2009 13:08:03 -0700

> Don't mind having 'a' and 'd' around, but likely won't use them.

So far I'm counting 3 yes votes (including patch submitter), 3 "won't
use them" votes (including me), and no one being offended. I think I'm
going to apply this.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Carl Worth)
Date: Tue, 08 Sep 2009 13:26:45 -0700

> I personally do prefer ]a and ]d, to read mail in the chronological order.

What if there were a way to reverse the sort order for the index view?
That would then change the meaning of "next" and "previous" and then
you could use the single letter 'a' and 'd' commands to read your mail
in chronological order.

Would that make sense? Because that is something I would like to do on
occasion.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090908/01fd44fe/attachment.bin>

---

From: [email-masked] (Nicolas Pouillard)
Date: Tue, 08 Sep 2009 22:33:13 +0200

> Would that make sense? Because that is something I would like to do on

Yes it does make sense. This change would both improve this feature and
will reduce the default enforcement.

Regards,

---

From: [email-masked] (William Morgan)
Date: Wed, 09 Sep 2009 07:37:16 -0700

> use them" votes (including me), and no one being offended. I think I'm

Applied to master. Thanks!
-- 
William <wmorgan-sup at masanjin.net>