<<< Date Index >>>     <<< Thread Index >>>

Faster working with messages



Hi list,

using mutt would be faster if it worked more in a vim way. Giving
commands a count should be supported, so that d3H deletes all messages
from the third one on the screen to the current one, 4CTRL-d deletes
four threads. If a motion command after an operator is typed, it should
be applied on all messages that are moved over.

Here is an incomplete list of how I imagine it could be.

-----------------------------------------------------------
N         number entered before the command
{select}  either a MOTION or PATTERN

MOTION    messages being moved over with a motion command
PATTERN   a message pattern
-----------------------------------------------------------

Note: 1 = motion command

Command            Note Action
-----------------------------------------------------------
{number}%            1  go to N percentage in the mailbox
'{a-zA-Z}            1  go to the message with mark {a-zA-Z}
<CR>                 1  if $return_goto is unset, same as "j"
                        if set, go to message N, default next message
<Space>              1  view message N, default current one
j                    1  go N messages downwards
k                    1  go N messages upwards
=                    1  go to message N, default first message
*                    1  go to message N, default last message
H                    1  go to Nth message from top of screen
L                    1  go to Nth message from bottom of screen
M                    1  go to Nth message in screen, default middle one
C                       copy N messages to a mailbox
s                       save N messages to a mailbox
ll                      limit on N messages
l{select}               limit on {select} messages
t                       toggle tag N messages
T{select}               tag {select} messages
^T^T                    untag N messages
^T{select}              untag {select} messages
<Esc>t                  toggle tag N threads
d                       delete N messages
D{select}               delete {select} messages
^D                      delete N threads
<Esc>d                  delete N subthreads
u                       undelete N messages
U{select}               undelete {select} messages
^U                      undelete N threads
<Esc>u                  undelete N subthreads
~{a-zA-Z}               set mark {a-zA-Z} at current message
^V                      toggle Tag mode which is like Visual mode
Z                       scroll N screens upwards
z                       scroll N screens downwards
CTRL-N                  go N threads downwards
CTRL-P                  go N threads upwards
<Del>                   same as "dd"
{count}<Del>            remove the last digit from {count}
<F1>                    read the manual
<Help>                  same as <Help>
<Home>               1  same as "="
<End>                1  same as "*"
<Down>               1  same as "j"
<Up>                 1  same as "k"
<PageDown>              same as "z"
<PageUp>                same as "Z"
CTRL-X                  scroll N entries upwards
CTRL-Y                  scroll N entries downwards
CTRL-W {char}           window commands

A $vi_style option could be there to make the key bindings like this.

Command                 Action
-----------------------------------------------------------
dd                      delete N messages
d{select}               delete {select} messages
D                       same as "dd"
uu                      undelete N messages
u{select}               undelete {select} messages
U                       same as "uu"
tt                      toggle tag N messages
t{select}               tag {select} messages
T                       same as "tt"

This one would allow to save keys and make ^T a thread operation key.

Command                 Action
-----------------------------------------------------------
tt                      toggle tag N messages
t{select}               tag {select} messages
TT                      untag N messages
T{select}               untag {select} messages
^T^T                    toggle tag N threads
^T{select}              toggle tag {select} threads
dd                      delete N messages
d{select}               delete {select} messages
D                       undelete N messages
D{select}               undelete {select} messages
u                       not used
U                       not used
<Esc>t                  not used

If {select} is a PATTERN it follows the known pattern table.

pattern         description
-----------------------------------------------------------
~A              all messages
~b EXPR         messages which contain EXPR in the message body
~B EXPR         messages which contain EXPR in the whole message
~c USER         messages carbon-copied to USER
~C EXPR         message is either to: or cc: EXPR
~D              deleted messages
and so on, all the patterns.

As {select} there could also be message objects like the vim text
objects. So d4t would delete four threads, 2ts tag two subthreads.

character      object
-----------------------------------------------------------
t              a thread
s              a subthread

Visual mode could be simulated by a Tag mode that works similar and may
use the auto_tag option, so that any motion command changes the tagged
messages region and an operator command then would operate on all of
them at once. Support for multiple windows could be implemented for
working with different mailboxes and switching between them, although
maybe this is not really needed.

A patch for using marks is here.
http://home.uchicago.edu/~dgc/mutt/

These are just suggestions.

Best regards

Jens