use utf8;
-my %common = (
+my %commonkey = (
'H' => "screen top",
- 'j' => "entry $sign{down}",
- 'k' => "entry $sign{up}",
+ 'j' => "entry <down>",
+ 'k' => "entry <up>",
'L' => "screen bottom",
'^l'=> "redraw",
'M' => "screen middle",
'^m'=> "select",
- 'n' => "search $sign{down}",
+ 'n' => "search <down>",
'q' => "exit",
't' => "tag",
- 'z' => "page $sign{down}",
- 'Z' => "page $sign{up}",
+ 'z' => "page <down>",
+ 'Z' => "page <up>",
+
'*' => "last entry",
'=' => "first entry",
':' => "enter command",
';' => "apply to tagged",
- '>' => "line $sign{down}",
- '<' => "line $sign{up}",
- ']' => "half page $sign{down}",
- '[' => "half page $sign{up}",
+ '>' => "line <down>",
+ '<' => "line <up>",
+ ']' => "half page <down>",
+ '[' => "half page <up>",
'?' => "help",
'!' => "invoke shell",
- '/' => "search $sign{down}",
- '+/'=> "search $sign{up}",
+ '/' => "search <down>",
+ '+/'=> "search <up>",
+);
+
+my %commondef = (
+ "\e"=> 'g9 mode',
+
+ 'H' => 'g2', # top-page
+ 'j' => 'g2', # next-entry, next-undeleted
+ 'k' => 'g2', # previous-entry, previous-undeleted
+ 'L' => 'g2', # bottom-page
+ '^l'=> 'g1', # refresh
+ 'M' => 'g2', # middle-page
+ '^m'=> 'g6 mode^m', # select-entry, display-message
+ 'n' => 'g3', # search-next
+ 'q' => 'g8 mode', # exit
+ 't' => 'g4', # tag-entry
+ 'z' => 'g2', # next-page
+ 'Z' => 'g2', # previous-page
+
+ '*' => 'g2', # last-entry
+ '=' => 'g2', # first-entry
+ ':' => 'g6', # enter-command
+ ';' => 'g6 arg', # tag-prefix
+ '>' => 'g2', # next-line
+ '<' => 'g2', # previous-line
+ ']' => 'g2', # half-down
+ '[' => 'g2', # half-up
+ '?' => 'g1', # help
+ '!' => 'g1 arg', # shell
+ '/' => 'g3 arg mode/~', # search
+ '+/'=> 'g3 arg mode/~', # search
);
{
key => {
- %common,
+ %commonkey,
'@' => "display sender",
'.' => "list new mail",
'$' => "save mailbox",
'#' => "split up thread",
'&' => "thread tagged",
- '%' => "toggle reado$sign{_}nl$sign{_}y",
+ '%' => "toggle reado<>nl<>y",
'a' => "create alias",
'b' => "bounce",
- '^b'=> "url$sign{_}view",
+ '^b'=> "url<>view",
'+b'=> "search bodies",
'c' => "open folder",
- 'C' => "copy messag$sign{_}e",
- '+c'=> "open reado$sign{_}nly",
+ 'C' => "copy messag<>e",
+ '+c'=> "open reado<>nly",
'+C'=> "make plain copy",
'd' => "delete",
- 'D' => "delete patt$sign{_}er$sign{_}n",
+ 'D' => "delete patt<>er<>n",
'^d'=> "delete thread",
'+d'=> "delete subthread",
'e' => "edit",
- '^e'=> "edit con$sign{_}tent type",
+ '^e'=> "edit con<>tent type",
'+e'=> "edit+send copy",
'f' => "forward",
'F' => "toggle important",
- '^f'=> "forget pass$sign{_}phras$sign{_}e",
+ '^f'=> "forget pass<>phras<>e",
'g' => "reply to all\nGroup reply",
'G' => "fetch POP\nGather new mail",
'h' => "toggle headers",
- '^i'=> "unread msg $sign{down}",
- '+^i'=> "unread msg $sign{up}",
- 'j' => "messag$sign{_}e $sign{down}",
- 'k' => "messag$sign{_}e $sign{up}",
- 'J' => "any $sign{down}",
- 'K' => "any $sign{up}",
+ '^i'=> "unread msg <down>",
+ '+^i'=> "unread msg <up>",
+ 'j' => "messag<>e <down>",
+ 'k' => "messag<>e <up>",
+ 'J' => "any <down>",
+ 'K' => "any <up>",
'^k'=> "extract pub keys",
'+k'=> "send public key",
'l' => "limit pattern",
'L' => "reply to list",
'+l'=> "show current limit",
- 'm' => "compo$sign{_}s$sign{_}e mail",
+ 'm' => "compo<>s<>e mail",
'N' => "toggle new",
- '^n'=> "thread $sign{down}",
- '+n'=> "subthr$sign{_}ead $sign{down}",
+ '^n'=> "thread <down>",
+ '+n'=> "subthr<>ead <down>",
'o' => "sort",
'O' => "sort reverse",
'p' => "print",
'P' => "to parent",
- '^p'=> "thread $sign{up}",
- '+p'=> "subthr$sign{_}ead $sign{up}",
+ '^p'=> "thread <up>",
+ '+p'=> "subthr<>ead <up>",
'+P'=> "check for pgp",
'q' => "quit",
- 'Q' => "query addr$sign{_}ess$sign{_}es",
+ 'Q' => "query addr<>ess<>es",
'r' => "reply to sender",
- 'R' => "recall postpon$sign{_}e$sign{_}d",
+ 'R' => "recall postpon<>e<>d",
'^r'=> "mark thread read",
- '+r'=> "mark sub$sign{_}thread r$sign{_}ead",
+ '+r'=> "mark sub<>thread r<>ead",
's' => "move",
'+s'=> "save and delete",
- 'T' => "tag patt$sign{_}er$sign{_}n",
+ 'T' => "tag patt<>er<>n",
'^t'=> "untag pattern",
'+t'=> "tag thread",
'u' => "undo delete",
- 'U' => "res$sign{_}tore pat$sign{_}t$sign{_}er$sign{_}n",
+ 'U' => "res<>tore pat<>t<>er<>n",
'^u'=> "restore thread",
'+u'=> "restore subthread",
- 'v' => "attach$sign{_}ments",
+ 'v' => "attach<>ments",
'V' => "version",
'+v'=> "(un)collapse thread",
'+V'=> "(un)collapse threads",
'x' => "abort",
'y' => "list incoming mailboxes",
- (map { 'm'.$_ => $common{$_} } keys %common),
+ (map { 'm'.$_ => $commonkey{$_} } keys %commonkey),
- 'm|' => "pipe attach$sign{_}m$sign{_}ent",
+ 'm|' => "pipe attach<>m<>ent",
'ma' => "attach file",
- 'mA' => "attach messag$sign{_}e",
+ 'mA' => "attach messag<>e",
'mb' => "edit bcc",
'mc' => "edit cc",
'mC' => "copy file",
- 'md' => "desc$sign{_}ribe attach$sign{_}m$sign{_}ent",
- 'mD' => "delete attach$sign{_}m$sign{_}ent",
- 'm^d'=> "dispo$sign{_}sition tog$sign{_}gle",
+ 'md' => "desc<>ribe attach<>m<>ent",
+ 'mD' => "delete attach<>m<>ent",
+ 'm^d'=> "dispo<>sition tog<>gle",
'me' => "edit body",
'mE' => "edit all",
'm^e'=> "edit encoding",
'mf' => "edit fcc",
- 'm^f'=> "forget pass$sign{_}phrase",
+ 'm^f'=> "forget pass<>phrase",
'm+f'=> "edit from",
- 'mF' => "filter attach$sign{_}m$sign{_}ent",
- 'mG' => "get attach$sign{_}m$sign{_}ent",
+ 'mF' => "filter attach<>m<>ent",
+ 'mG' => "get attach<>m<>ent",
'mh' => "display message",
'mi' => "run ispell",
- 'ml' => "print attach$sign{_}m$sign{_}ent",
- 'mm' => "edit attach$sign{_}m$sign{_}ent\nMime-appropriate open",
+ 'ml' => "print attach<>m<>ent",
+ 'mm' => "edit attach<>m<>ent\nMime-appropriate open",
'mM' => "edit mix",
- 'm^m'=> "view attach$sign{_}m$sign{_}ent",
- 'mn' => "new attach$sign{_}m$sign{_}ent",
- 'mP' => "post$sign{_}pone",
- 'mr' => "edit reply$sign{_}-to",
- 'mR' => "rename attach$sign{_}m$sign{_}ent",
+ 'm^m'=> "view attach<>m<>ent",
+ 'mn' => "new attach<>m<>ent",
+ 'mP' => "post<>pone",
+ 'mr' => "edit reply<>-to",
+ 'mR' => "rename attach<>m<>ent",
'ms' => "edit subject",
'mS' => "s/mime options",
'mt' => "edit to",
- 'm^t'=> "ctype attach$sign{_}m$sign{_}ent",
+ 'm^t'=> "ctype attach<>m<>ent",
'mw' => "copy to folder",
'mu' => "unlink toggle",
- 'mU' => "encode attach$sign{_}m$sign{_}ent",
+ 'mU' => "encode attach<>m<>ent",
'my' => "send",
'wD' => "deleted",
'/~B' => "whole msg",
'/~c' => "cc address",
'/~C' => "to or cc address",
- '/~d' => "date sent ran$sign{_}g$sign{_}e",
+ '/~d' => "date sent ran<>g<>e",
'/~D' => "deleted",
'/~e' => "sender",
'/~E' => "expired",
'/~f' => "from",
'/~F' => "flagged",
'/~g' => "signed",
- '/~G' => "encryp$sign{_}ted",
+ '/~G' => "encryp<>ted",
'/~h' => "header",
- '/~H' => "spam attr$sign{_}ib$sign{_}ute",
+ '/~H' => "spam attr<>ib<>ute",
'/~i' => "msg id",
'/~k' => "pgp key",
- '/~L' => "receiv$sign{_}d by",
+ '/~L' => "receiv<>d by",
'/~l' => "mailing list",
- '/~m' => "num$sign{_}ber ran$sign{_}g$sign{_}e",
+ '/~m' => "num<>ber ran<>g<>e",
'/~n' => "score range",
'/~N' => "new",
'/~O' => "old",
'/~p' => "to you",
'/~P' => "by you",
'/~Q' => "replies",
- '/~r' => "receive date ran$sign{_}ge",
+ '/~r' => "receive date ran<>ge",
'/~R' => "read",
'/~s' => "subject",
- '/~S' => "super$sign{_}seded",
+ '/~S' => "super<>seded",
'/~t' => "to address",
'/~T' => "tagged",
- '/~u' => "subscr$sign{_}ibed list",
+ '/~u' => "subscr<>ibed list",
'/~U' => "unread",
'/~v' => "collapsed thread",
'/~V' => "verified",
- '/~x' => "refer$sign{_}ence",
- '/~X' => "attach$sign{_}ments",
+ '/~x' => "refer<>ence",
+ '/~X' => "attach<>ments",
'/~y' => "x-label",
'/~z' => "size range",
- '/~=' => "dupli$sign{_}cate",
- '/~$' => "unrefer$sign{_}enced",
+ '/~=' => "dupli<>cate",
+ '/~$' => "unrefer<>enced",
'/~(' => "in thread",
+
+ # globally label escape as meta key
+ "\e"=> "+",
+ "m\e"=> "+",
+ "w\e"=> "+",
+ "/~\e"=> "+",
},
mode => {
},
flag => {
- ci => [aside => "Temporarily display something without changing state."],
- pm => [select => "Scroll list and/or select a different line."],
- po => [search => "Go to a specific message entry."],
- co => [edit => "Modify message flags or contents."],
- mi => [command => "Any other action which does not alter an existing message."],
- mo => [send => "Prepare and/or send a (new) message."],
- mv => [leave => "Exit the opened folder."],
- me => [display => "Permanently alter/toggle current view."],
-
- arg => ["key$sign{arg}" => "Commands with a dot need an argument afterwards."],
+ g1 => [aside => "Temporarily display something without changing state."],
+ g2 => [select => "Scroll list and/or select a different line."],
+ g3 => [search => "Go to a specific message entry."],
+ g4 => [edit => "Modify message flags or contents."],
+ g6 => [command => "Any other action which does not alter an existing message."],
+ g7 => [send => "Prepare and/or send a (new) message."],
+ g8 => [leave => "Exit the opened folder."],
+ g9 => [display => "Permanently alter/toggle current view."],
+
+ arg => ["key<arg>" => "Commands with a dot need an argument afterwards."],
},
+def => {
+ '' => {
+ %commondef,
+
+ '@' => 'g1', # display-address
+ '.' => 'g8', # buffy-list #TODO
+ '|' => 'g6', # pipe-message
+ '$' => 'g4', # sync-mailbox
+ '#' => 'g4', # break-thread
+ '&' => 'g4', # link-threads
+ '%' => 'g4', # toggle-write
+ ' ' => '=^m',
+
+ 'a' => 'g6', # create-alias
+ 'b' => 'g7', # bounce-message
+ '^b'=> 'g1',
+ '+b'=> undef, # M <search>~b
+ 'c' => 'g8', # change-folder
+ 'C' => 'g6', # copy-message
+ '+c'=> 'g8', # change-folder-readonly
+ '+C'=> undef, # decode-copy
+ 'd' => 'g4', # delete-message
+ 'D' => 'g4 arg', # delete-pattern
+ '^d'=> 'g4', # delete-thread
+ '+d'=> 'g4', # delete-subthread
+ 'e' => 'g4 linkvi', # edit
+ '^e'=> 'g4', # edit-type
+ '+e'=> undef, # resend-message
+ 'f' => 'g7 modem', # forward-message
+ 'F' => 'g4', # flag-message
+ '^f'=> 'g6', # forget-passphrase
+ 'g' => 'g7 modem', # group-reply
+ 'G' => 'g6', # fetch-mail
+ 'h' => 'g9', # display-toggle-weed
+ '^i'=> 'g3', # next-new-then-unread
+ '+^i'=> undef, # previous-new-then-unread
+ 'j' => 'g2', # next-undeleted
+ 'k' => 'g2', # previous-undeleted
+ 'J' => 'g3', # next-entry
+ 'K' => 'g3', # previous-entry
+ '^k'=> 'g1', # extract-keys
+ '+k'=> 'g7 modem', # mail-key
+ 'l' => 'g9', # limit
+ 'L' => 'g7 modem', # list-reply
+ '+l'=> 'g1', # show-limit
+ 'm' => 'g7 modem', # mail
+ 'N' => 'g4', # toggle-new
+ '^n'=> 'g3', # next-thread
+ '+n'=> 'g3', # next-subthread
+ 'o' => 'g9 modeo', # sort-mailbox
+ 'O' => 'g9 modeo', # sort-reverse
+ 'p' => 'g1', # print-message
+ 'P' => 'g3', # parent-message
+ '^p'=> 'g3', # previous-thread
+ '+p'=> 'g3', # previous-subthread
+ '+P'=> undef, # check-traditional-pgp
+ 'q' => 'g8', # quit
+ 'Q' => 'g1 arg', # query
+ 'r' => 'g7 modem', # reply
+ 'R' => 'g7 modem', # recall-message
+ '^r'=> 'g4', # read-thread
+ '+r'=> 'g4', # read-subthread
+ 's' => 'g4', # save-message
+ '+s'=> 'g4', # decode-save
+ 'T' => 'g4 arg', # tag-pattern
+ '^t'=> 'g4', # untag-pattern
+ '+t'=> 'g4', # tag-thread
+ 'u' => 'g4', # undelete-message
+ 'U' => 'g4 arg', # undelete-pattern
+ '^u'=> 'g4', # undelete-thread
+ '+u'=> 'g4', # undelete-subthread
+ 'v' => 'g1', # view-attachments
+ 'V' => 'g1', # show-version
+ '+v'=> 'g9', # collapse-thread
+ '+V'=> 'g9', # collapse-all
+ 'w' => 'g4 arg modew', # set-flag
+ 'W' => 'g4 arg modew', # clear-flag
+ 'x' => 'g8', # exit
+ 'y' => 'g8', # M <change-folder>?<toggle-mailboxes>
+ }, # index
+
+ 'm' => {
+ %commondef,
+
+ '|' => 'g4',
+ 'a' => 'g6',
+ 'A' => 'g6',
+ 'b' => 'g4',
+ 'c' => 'g4',
+ 'C' => 'g6',
+ 'd' => 'g4',
+ 'D' => 'g4',
+ '^d'=> 'g4',
+ 'e' => 'g4 linkvi',
+ 'E' => 'g4 linkvi',
+ '^e'=> 'g4',
+ 'f' => 'g4',
+ '^f'=> 'g6',
+ '+f'=> 'g4',
+ 'F' => 'g4',
+ 'G' => 'g1',
+ 'h' => 'g1',
+ 'i' => 'g6',
+ 'l' => 'g1',
+ 'm' => 'g4',
+ 'M' => 'g4',
+ '^m'=> 'g1',
+ 'n' => 'g6',
+ 'P' => 'g8 mode',
+ 'r' => 'g4',
+ 'R' => 'g4',
+ 's' => 'g4',
+ 'S' => 'g4 menumS',
+ 't' => 'g4',
+ '^t'=> 'g4',
+ 'w' => 'g6',
+ 'u' => 'g6',
+ 'U' => 'g4',
+ 'y' => 'g7',
+ }, # compose
+
+ w => {
+ "\e"=> 'g9 mode',
+ 'D' => 'g4',
+ 'd' => '=wD',
+ 'N' => 'g4',
+ 'n' => '=wN',
+ 'O' => 'g4',
+ 'o' => '=wO',
+ 'r' => 'g4',
+ 'R' => '=wr',
+ '*' => 'g4',
+ '!' => 'g4',
+ }, # flag
+
+ '/~' => {
+ "\e"=> 'g9 mode',
+ A => 'g3',
+ b => 'g3 arg',
+ B => 'g3 arg',
+ c => 'g3 arg',
+ C => 'g3 arg',
+ d => 'g3 arg',
+ D => 'g3',
+ e => 'g3 arg',
+ E => 'g3',
+ f => 'g3 arg',
+ F => 'g3',
+ g => 'g3',
+ G => 'g3',
+ h => 'g3 arg',
+ H => 'g3 arg',
+ i => 'g3 arg',
+ k => 'g3',
+ L => 'g3 arg',
+ l => 'g3',
+ m => 'g3 arg',
+ n => 'g3 arg',
+ N => 'g3',
+ O => 'g3',
+ p => 'g3',
+ P => 'g3',
+ Q => 'g3',
+ r => 'g3 arg',
+ R => 'g3',
+ s => 'g3',
+ S => 'g3',
+ t => 'g3 arg',
+ T => 'g3',
+ u => 'g3',
+ U => 'g3',
+ v => 'g3',
+ V => 'g3',
+ x => 'g3 arg',
+ X => 'g3 arg',
+ y => 'g3 arg',
+ z => 'g3 arg',
+ '=' => 'g3',
+ '$' => 'g3',
+ '(' => 'g3 arg',
+ }, # search option
+},
}