use utf8;

my %common = (
	'H' => ["screen top", 'pm'], # top-page
	'j' => ["entry $sign{down}", 'pm'], # next-entry, next-undeleted
	'k' => ["entry $sign{up}", 'pm'], # previous-entry, previous-undeleted
	'L' => ["screen bottom", 'pm'], # bottom-page
	'^l'=> ["redraw", 'ci'], # refresh
	'M' => ["screen middle", 'pm'], # middle-page
	'^m'=> ["select", 'mi mode^m'], # select-entry, display-message
	'n' => ["search $sign{down}", 'po'], # search-next
	'q' => ["exit", 'mv mode'], # exit
	't' => ["tag", 'co'], # tag-entry
	'z' => ["page $sign{down}", 'pm'], # next-page
	'Z' => ["page $sign{up}", 'pm'], # previous-page

	'*' => ["last entry", 'pm'], # last-entry
	'=' => ["first entry", 'pm'], # first-entry
	':' => ["enter command", 'mi'], # enter-command
	';' => ["apply to tagged", 'mi arg'], # tag-prefix
	'>' => ["line $sign{down}", 'pm'], # next-line
	'<' => ["line $sign{up}", 'pm'], # previous-line
	']' => ["half page $sign{down}", 'pm'], # half-down
	'[' => ["half page $sign{up}", 'pm'], # half-up
	'?' => ["help", 'ci'], # help
	'!' => ["invoke shell", 'ci arg'], # shell
	'/' => ["search $sign{down}", 'po arg mode/~'], # search
	'+/'=> ["search $sign{up}", 'po arg mode/~'], # search
);

'' => {
	desc => 'index',

	%common,

	'@' => ["display sender", 'ci'], # display-address
	'.' => ["list new mail", 'mv'], # buffy-list #TODO
	'|' => ["pipe to shell", 'mi'], # pipe-message
	'$' => ["save mailbox", 'co'], # sync-mailbox
	'#' => ["split up thread", 'co'], # break-thread
	'&' => ["thread tagged", 'co'], # link-threads
	'%' => ["toggle reado$sign{_}nl$sign{_}y", 'co'], # toggle-write
	' ' => '^m',

	'a' => ["create alias", 'mi'], # create-alias
	'b' => ["bounce", 'mo'], # bounce-message
	'^b'=> ["url$sign{_}view", 'ci'],
	'+b'=> ["search bodies"], # M <search>~b
	'c' => ["open folder", 'mv'], # change-folder
	'C' => ["copy messag$sign{_}e", 'mi'], # copy-message
	'+c'=> ["open reado$sign{_}nly", 'mv'], # change-folder-readonly
	'+C'=> ["make plain copy"], # decode-copy
	'd' => ["delete", 'co'], # delete-message
	'D' => ["delete patt$sign{_}er$sign{_}n", 'co arg'], # delete-pattern
	'^d'=> ["delete thread", 'co'], # delete-thread
	'+d'=> ["delete subthread", 'co'], # delete-subthread
	'e' => ["edit", 'co'], # edit
	'^e'=> ["edit con$sign{_}tent type", 'co'], # edit-type
	'+e'=> ["edit+send copy"], # resend-message
	'f' => ["forward", 'mo modem'], # forward-message
	'F' => ["toggle important", 'co'], # flag-message
	'^f'=> ["forget pass$sign{_}phras$sign{_}e", 'mi'], # forget-passphrase
	'g' => ["reply to all", 'mo modem', 'Group reply'], # group-reply
	'G' => ["fetch POP", 'mi', 'Gather new mail'], # fetch-mail
	'h' => ["toggle headers", 'me'], # display-toggle-weed
	'^i'=> ["unread msg $sign{down}", 'po'], # next-new-then-unread
	'+^i'=> ["unread msg $sign{up}"], # previous-new-then-unread
	'j' => ["messag$sign{_}e $sign{down}", 'pm'], # next-undeleted
	'k' => ["messag$sign{_}e $sign{up}", 'pm'], # previous-undeleted
	'J' => ["any $sign{down}", 'po'], # next-entry
	'K' => ["any $sign{up}", 'po'], # previous-entry
	'^k'=> ["extract pub keys", 'ci'], # extract-keys
	'+k'=> ["send public key", 'mo modem'], # mail-key
	'l' => ["limit pattern", 'me'], # limit
	'L' => ["reply to list", 'mo modem'], # list-reply
	'+l'=> ["show current limit", 'ci'], # show-limit
	'm' => ["compo$sign{_}s$sign{_}e mail", 'mo modem'], # mail
	'N' => ["toggle new", 'co'], # toggle-new
	'^n'=> ["thread $sign{down}", 'po'], # next-thread
	'+n'=> ["subthr$sign{_}ead $sign{down}", 'po'], # next-subthread
	'o' => ["sort", 'me modeo'], # sort-mailbox
	'O' => ["sort reverse", 'me modeo'], # sort-reverse
	'p' => ["print", 'ci'], # print-message
	'P' => ["to parent", 'po'], # parent-message
	'^p'=> ["thread $sign{up}", 'po'], # previous-thread
	'+p'=> ["subthr$sign{_}ead $sign{up}", 'po'], # previous-subthread
	'+P'=> ["check for pgp"], # check-traditional-pgp
	'q' => ["quit", 'mv'], # quit
	'Q' => ["query addr$sign{_}ess$sign{_}es", 'ci arg'], # query
	'r' => ["reply to sender", 'mo modem'], # reply
	'R' => ["recall postpon$sign{_}e$sign{_}d", 'mo modem'], # recall-message
	'^r'=> ["mark thread read", 'co'], # read-thread
	'+r'=> ["mark sub$sign{_}thread r$sign{_}ead", 'co'], # read-subthread
	's' => ["move", 'co'], # save-message
	'+s'=> ["save and delete", 'co'], # decode-save
	'T' => ["tag patt$sign{_}er$sign{_}n", 'co arg'], # tag-pattern
	'^t'=> ["untag pattern", 'co'], # untag-pattern
	'+t'=> ["tag thread", 'co'], # tag-thread
	'u' => ["undo delete", 'co'], # undelete-message
	'U' => ["res$sign{_}tore pat$sign{_}t$sign{_}er$sign{_}n", 'co arg'], # undelete-pattern
	'^u'=> ["restore thread", 'co'], # undelete-thread
	'+u'=> ["restore subthread", 'co'], # undelete-subthread
	'v' => ["attach$sign{_}ments", 'ci'], # view-attachments
	'V' => ["version", 'ci'], # show-version
	'+v'=> ["(un)collapse thread", 'me'], # collapse-thread
	'+V'=> ["(un)collapse threads", 'me'], # collapse-all
	'w' => ["set flag", 'co arg'], # set-flag
	'W' => ["clear flag", 'co arg'], # clear-flag
	'x' => ["abort", 'mv'], # exit
	'y' => ["list incoming mailboxes", 'mv'], # M <change-folder>?<toggle-mailboxes>
}, # index

'm' => {
	desc => 'compose (m)',

	%common,

	'|' => ["pipe attach$sign{_}m$sign{_}ent", 'co'],
	'a' => ["attach file", 'mi'],
	'A' => ["attach messag$sign{_}e", 'mi'],
	'b' => ["edit bcc", 'co'],
	'c' => ["edit cc", 'co'],
	'C' => ["copy file", 'mi'],
	'D' => ["delete entry", 'co'],
	'^d'=> ["dispo$sign{_}sition tog$sign{_}gle", 'co'],
	'd' => ["desc$sign{_}ribe attach$sign{_}m$sign{_}ent", 'co'],
	'e' => ["edit body", 'co linkvi'],
	'E' => ["edit all", 'co linkvi'],
	'^e'=> ["edit encoding", 'co'],
	'f' => ["edit fcc", 'co'],
	'^f'=> ["forget pass$sign{_}phrase", 'mi'],
	'+f'=> ["edit from", 'co'],
	'F' => ["filter attach$sign{_}m$sign{_}ent", 'co'],
	'G' => ["get attach$sign{_}m$sign{_}ent", 'ci'],
	'h' => ["display message", 'ci'],
	'i' => ["run ispell", 'mi'],
	'l' => ["print attach$sign{_}m$sign{_}ent", 'ci'],
	'm' => ["edit attach$sign{_}m$sign{_}ent", 'co', 'Mime-appropriate open'],
	'M' => ["edit mix", 'co'],
	'^m'=> ["view attach$sign{_}m$sign{_}ent", 'ci'],
	'n' => ["new attach$sign{_}m$sign{_}ent", 'mi'],
	'P' => ["post$sign{_}pone", 'mv mode'],
	'r' => ["edit reply$sign{_}-to", 'co'],
	'R' => ["rename attach$sign{_}m$sign{_}ent", 'co'],
	's' => ["edit subject", 'co'],
	'S' => ["s/mime options", 'co menumS'],
	't' => ["edit to", 'co'],
	'^t'=> ["ctype attach$sign{_}m$sign{_}ent", 'co'],
	'w' => ["copy to folder", 'mi'],
	'u' => ["unlink toggle", 'mi'],
	'U' => ["encode attach$sign{_}m$sign{_}ent", 'co'],
	'y' => ["send", 'mo'],
}, # compose

'/~' => {
	desc => 'search flags (/~)',

	A => ["all"],
	b => ["msg body", 'X arg'],
	B => ["whole msg", 'arg'],
	c => ["cc address", 'arg'],
	C => ["to or cc address", 'arg'],
	d => ["date sent ran$sign{_}g$sign{_}e", 'arg'],
	D => ["deleted"],
	e => ["sender", 'arg'],
	E => ["expired"],
	f => ["from", 'arg'],
	F => ["flagged"],
	g => ["signed"],
	G => ["encryp$sign{_}ted"],
	h => ["header", 'arg'],
	H => ["spam attr$sign{_}ib$sign{_}ute", 'arg'],
	i => ["msg id", 'arg'],
	k => ["pgp key"],
	L => ["receiv$sign{_}d by", 'arg'],
	l => ["mailing list"],
	m => ["num$sign{_}ber ran$sign{_}g$sign{_}e", 'arg'],
	n => ["score range", 'arg'],
	N => ["new"],
	O => ["old"],
	p => ["to you"],
	P => ["by you"],
	Q => ["replies"],
	r => ["receive date ran$sign{_}ge", 'arg'],
	R => ["read"],
	s => ["subject"],
	S => ["super$sign{_}seded"],
	t => ["to address", 'arg'],
	T => ["tagged"],
	u => ["subscr$sign{_}ibed list"],
	U => ["unread"],
	v => ["collapsed thread"],
	V => ["verified"],
	x => ["refer$sign{_}ence", 'arg'],
	X => ["attach$sign{_}ments", 'arg'],
	y => ["x-label", 'arg'],
	z => ["size range", 'arg'],
	'=' => ["dupli$sign{_}cate"],
	'$' => ["unrefer$sign{_}enced"],
	'(' => ["in thread", 'arg'],
}, # search option

