mutt: page, key classes, various updates
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 15 May 2009 22:34:25 +0000 (22:34 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 15 May 2009 23:09:03 +0000 (23:09 +0000)
base.css
circus.css
dark.css
mutt.inc.pl
mutt.plp [new file with mode: 0644]
red.css

index 0aee0ed34c58872808e3250380cdaecae29ee319..76f5929a40b7c2484c64a97143b2d589a0dff005 100644 (file)
--- a/base.css
+++ b/base.css
@@ -374,6 +374,8 @@ td.di-a:hover                                      {background: #CF8}
 .mv {background: #ECE}   /* visual mode */
 .me {background: #CCF}   /* key mode */
 
+.pm[onclick]:hover {background: #7E7}
+.po[onclick]:hover {background: #CE6}
 .ci[onclick]:hover {background: #5ED}
 .mi[onclick]:hover {background: #F97}
 .mo[onclick]:hover {background: #F88}
index 160ca54bcf1e5b0ab64e9f46bd18207cc4f12b38..a6e77b79bc099b43d209a14c53290ff0d1bf8b89 100644 (file)
@@ -1,13 +1,15 @@
 .pm {background: #8F8} /* motion */
-.po {background: #CF7} /* window */
-.co {background: #FF7} /* command */
+.po {background: #BF6} /* window */
+.co {background: #FF6} /* command */
 .ci {background: #8FD} /* info */
-.cp {background: #FB7} /* info */
-.mi {background: #FFA070} /* insert mode */
+.cp {background: #FC6}
+.mi {background: #F96} /* insert mode */
 .mo {background: #F77} /* mode */
 .mv {background: #E8E} /* visual mode */
-.me {background: #99F} /* key mode */
+.me {background: #9AF} /* key mode */
 
+.pm[onclick]:hover {background: #000; color: #7E7}
+.po[onclick]:hover {background: #000; color: #CE6}
 .ci[onclick]:hover {background: #000; color: #8FD}
 .co[onclick]:hover {background: #000; color: #FF7}
 .mi[onclick]:hover {background: #000; color: #FFA070}
index dd54f48d0de613ce5578bc0c4f936079b790ad47..9540a7a59b7667abe69c4f83e28443055298eb6c 100644 (file)
--- a/dark.css
+++ b/dark.css
@@ -27,6 +27,8 @@ dl.legend-options dt {background: #333}
 .me {background: #205} /* mode */
 .no {background: #222} /* unassigned */
 
+.pm[onclick]:hover,
+.po[onclick]:hover,
 .ci[onclick]:hover,
 .co[onclick]:hover,
 .mi[onclick]:hover,
index 969aeeeda18f67cdaf010917d1f565b7d2866584..77f920d3825480ce53cc77d85bf00f4d8b0b5bdb 100644 (file)
@@ -5,100 +5,100 @@ my @generic = qw(^l ! * / : ; < = > ? H L M Z [ ] j k n q t z);
 '' => {
        desc => 'index',
 
-       ';' => ["apply to tagged", 'arg'], # tag-prefix
+       ';' => ["apply to tagged", 'mi arg'], # tag-prefix
        '@' => ["display sender", 'ci'], # display-address
-       ':' => ["enter command"], # enter-command
-       '=' => ["first entry"], # first-entry
-       ']' => ["half page down"], # half-down
-       '[' => ["half page up"], # half-up
-       '?' => ["help"], # help
-       '!' => ["invoke shell"], # shell
-       '*' => ["last message"], # last-entry
-       '>' => ["line $sign{down}"], # next-line
-       '<' => ["line $sign{up}"], # previous-line
-       '.' => ["list new mail"], # buffy-list #TODO
-       '|' => ["pipe to shell"], # pipe-message
-       '$' => ["save mailbox"], # sync-mailbox
-       '/' => ["search", 'mode/~'], # search
-       '#' => ["split up thread"], # break-thread
-       '&' => ["thread tagged"], # link-threads
-       '%' => ["toggle readonly"], # toggle-write
+       ':' => ["enter command", 'mi'], # enter-command
+       '=' => ["first entry", 'po'], # first-entry
+       ']' => ["half page down", 'pm'], # half-down
+       '[' => ["half page up", 'pm'], # half-up
+       '?' => ["help", 'ci'], # help
+       '!' => ["invoke shell", 'ci arg'], # shell
+       '*' => ["last message", 'po'], # last-entry
+       '>' => ["line $sign{down}", 'pm'], # next-line
+       '<' => ["line $sign{up}", 'pm'], # previous-line
+       '.' => ["list new mail", 'mv'], # buffy-list #TODO
+       '|' => ["pipe to shell", 'mi'], # pipe-message
+       '$' => ["save mailbox", 'co'], # sync-mailbox
+       '/' => ["search", 'po arg mode/~'], # search
+       '#' => ["split up thread", 'co'], # break-thread
+       '&' => ["thread tagged", 'co'], # link-threads
+       '%' => ["toggle reado$sign{_}nl$sign{_}y", 'co'], # toggle-write
        ' ' => '^m',
 
-       'a' => ["create alias"], # create-alias
-       'b' => ["bounce"], # bounce-message
-       '^b'=> ["url$sign{_}view"],
-       '\b'=> ["search bodies"], # M <search>~b
-       'c' => ["open folder"], # change-folder
-       'C' => ["copy message"], # copy-message
-       '\c'=> ["open readonly"], # change-folder-readonly
-       '\C'=> ["make plain copy"], # decode-copy
-       'd' => ["delete"], # delete-message
-       'D' => ["delete pattern"], # delete-pattern
-       '^d'=> ["delete thread"], # delete-thread
-       '\d'=> ["delete subthread"], # delete-subthread
-       'e' => ["edit"], # edit
-       '^e'=> ["edit con$sign{_}tent type"], # edit-type
-       '\e'=> ["edit+send copy"], # resend-message
-       'f' => ["forward"], # forward-message
-       'F' => ["toggle important"], # flag-message
-       '^f'=> ["forget pass$sign{_}phras$sign{_}e"], # forget-passphrase
-       'g' => ["reply to all", '', 'Group reply'], # group-reply
-       'G' => ["fetch POP", '', 'Gather new mail'], # fetch-mail
-       'h' => ["toggle headers"], # display-toggle-weed
-       'H' => ["screen top"], # top-page
-       '^i'=> ["next unread msg"], # next-new-then-unread
-#      '\tab'=> ["previous unread msg"], # previous-new-then-unread
-       'j' => ["next entry"], # next-entry, next-undeleted
-       'J' => ["next message"], # next-entry
-       'k' => ["previous entry"], # previous-entry, previous-undeleted
-       'K' => ["previous message"], # previous-entry
-       '^k'=> ["extract pub keys"], # extract-keys
-       '\k'=> ["send public key"], # mail-key
-       'l' => ["limit pattern"], # limit
-       'L' => ["reply to list"], # list-reply
-       '^l'=> ["redraw"], # refresh
-       '\l'=> ["show current limit"], # show-limit
-       'm' => ["compose mail"], # mail
-       'M' => ["screen middle"], # middle-page
-       '^m'=> ["select"], # select-entry, display-message
-       'n' => ["search next"], # search-next
-       'N' => ["toggle new"], # toggle-new
-       '^n'=> ["next thread"], # next-thread
-       '\n'=> ["next subthread"], # next-subthread
-       'o' => ["sort"], # sort-mailbox
-       'O' => ["sort reverse"], # sort-reverse
-       'p' => ["print"], # print-message
-       'P' => ["to parent"], # parent-message
-       '^p'=> ["previous thread"], # previous-thread
-       '\p'=> ["previous subthread"], # previous-subthread
-       '\P'=> ["check for pgp"], # check-traditional-pgp
-       'q' => ["exit or quit"], # exit, quit
-       'Q' => ["query for addresses"], # query #TODO
-       'r' => ["reply to sender"], # reply
-       'R' => ["recall postpon$sign{_}e$sign{_}d"], # recall-message
-       '^r'=> ["mark thread read"], # read-thread
-       '\r'=> ["mark sub$sign{_}thread r$sign{_}ead"], # read-subthread
-       's' => ["move"], # save-message
-       '\s'=> ["save and delete"], # decode-save
-       't' => ["tag"], # tag-entry
-       'T' => ["tag pattern"], # tag-pattern
-       '^t'=> ["untag pattern"], # untag-pattern
-       '\t'=> ["tag thread"], # tag-thread
-       'u' => ["undo delete"], # undelete-message
-       'U' => ["undelete pattern"], # undelete-pattern
-       '^u'=> ["undelete thread"], # undelete-pattern
-       '\u'=> ["undelete subthread"], # undelete-subthread
-       'v' => ["attach$sign{_}ments"], # view-attachments
-       'V' => ["version"], # show-version
-       '\v'=> ["(un)collapse thread"], # collapse-thread
-       '\V'=> ["(un)collapse threads"], # collapse-all
-       'w' => ["set flag", 'arg'], # set-flag
-       'W' => ["clear flag", 'arg'], # clear-flag
-       'x' => ["exit menu"], # exit
-       'y' => ["list incoming mailboxes"], # M <change-folder>?<toggle-mailboxes>
-       'z' => ["page $sign{down}"], # next-page
-       'Z' => ["page $sign{up}"], # previous-page
+       '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 message", 'mi'], # copy-message
+       '+c'=> ["open readonly", '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
+       'H' => ["screen top", 'po'], # top-page
+       '^i'=> ["unread msg $sign{down}", 'po'], # next-new-then-unread
+       '+^i'=> ["unread msg $sign{up}"], # previous-new-then-unread
+       'j' => ["entry $sign{down}", 'po'], # next-entry, next-undeleted
+       'J' => ["messag$sign{_}e $sign{down}", 'po'], # next-entry
+       'k' => ["entry $sign{up}", 'po'], # previous-entry, previous-undeleted
+       'K' => ["messag$sign{_}e $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'=> ["redraw", 'ci'], # refresh
+       '+l'=> ["show current limit", 'ci'], # show-limit
+       'm' => ["compo$sign{_}s$sign{_}e mail", 'mo modem'], # mail
+       'M' => ["screen middle", 'po'], # middle-page
+       '^m'=> ["select", 'mi mode^m'], # select-entry, display-message
+       'n' => ["search $sign{down}", 'po'], # search-next
+       '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' => ["exit or quit", 'mv'], # exit, 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", 'co'], # tag-entry
+       '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' => ["exit menu", 'mv'], # exit
+       'y' => ["list incoming mailboxes", 'mv'], # M <change-folder>?<toggle-mailboxes>
+       'z' => ["page $sign{down}", 'pm'], # next-page
+       'Z' => ["page $sign{up}", 'pm'], # previous-page
 }, # index
 
 ' ' => {
diff --git a/mutt.plp b/mutt.plp
new file mode 100644 (file)
index 0000000..7ecf7fc
--- /dev/null
+++ b/mutt.plp
@@ -0,0 +1,113 @@
+<:
+use utf8;
+use strict;
+use warnings;
+no  warnings 'qw';  # you know what you doing
+no  warnings 'uninitialized';  # save some useless checks for more legible code
+
+use Shiar_Sheet::KeySigns qw(%sign);
+
+our $VERSION = 'v1.0';
+
+$header{content_type} = "text/html; charset=$sign{charset}";
+
+:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+<title>mutt cheat sheet</title>
+<meta http-equiv="content-type" content="<:= $header{content_type} :>">
+<link rel="stylesheet" type="text/css" media="all" href="base.css">
+<!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
+<!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
+       my %styles = map {$_ => $_} qw(dark circus mono red terse);
+       our $style = exists $get{style} && $styles{$get{style}} || 'light';
+       printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
+       ) for keys %styles;
+
+       our $showkeys = exists $get{keys} && $get{keys} ne '0';
+       print "\n".'<style type="text/css"> .no {visibility:hidden} </style>' unless $showkeys;
+       print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
+               if $showkeys and $get{keys} eq 'ghost';
+:>
+<script type="text/javascript" src="/keys.js"></script>
+
+<body id="mutt">
+
+<h1>Mutt cheat sheet</h1>
+
+<h2>index (default)</h2>
+
+<ul id="rows">
+
+<li class="row">
+       <ul class="keys omni">
+       <li class="me chr27" onclick="setmode()"><b>Esc</b> +
+               <!-- not as static anymore, but never bothered; just see ^[ -->
+       </ul>
+</li>
+
+<:
+use Shiar_Sheet::Keyboard;
+my $keys = Shiar_Sheet::Keyboard->new({do 'mutt.inc.pl'});
+$keys->map($get{map}) or undef $get{map};
+$keys->print_rows($get{rows});
+:>
+</ul>
+
+<hr>
+
+<div class="help">
+       <div class="left">
+               <dl class="legend legend-types">
+               <dt class="ci">aside
+                       <dd>Temporarily display something without changing state.
+               <dt class="pm">move
+                       <dd>Scroll window, only selecting a different message when necessary.
+               <dt class="po">select
+                       <dd>Select another message entry.
+               <dt class="co">edit
+                       <dd>Modify message flags or contents.
+               <dt class="mi">command
+                       <dd>Any other action which does not alter an existing message.
+               <dt class="mo">send
+                       <dd>Prepare and/or send a (new) message.
+               <dt class="mv">leave
+                       <dd>Exit the opened folder.
+               <dt class="me">display
+                       <dd>Permanently alter/toggle current view.
+               </dl>
+       </div>
+
+       <div class="right">
+               <dl class="legend legend-options">
+               <dt>key<:= $sign{arg} :>
+                       <dd>Commands with a dot need an argument afterwards.
+               </dl>
+
+               <ul class="legend legend-set">
+               <li>keyboard <strong>map</strong> is
+                       <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
+               <li><strong>ascii</strong> mode is
+                       <:= defined $sign{-ascii} && 'forced ' :><em><:=
+                               $sign{-ascii} ? 'on' : 'off' :></em>
+               <li><strong>keys</strong> are
+                       <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
+                               !exists $get{keys} && ' by default' :>
+               <li>default <strong>style</strong> is
+                       <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
+               </ul>
+       </div>
+</div>
+
+<p class="footer">
+       <a href="/" rel="home">sheet.shiar.nl</a>/mutt
+       <a href="git://git.shiar.nl/sheet" rel="vcs-git" title="Git repository"><:= $VERSION :></a>
+       created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
+       <a title="Licensed under the GNU Affero General Public License, version 3" rel="copyright"
+          href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a>
+</p>
+
+</html>
diff --git a/red.css b/red.css
index 5606d38980aef9b9dd6467cde75cee366d0b8e91..af617451e06780bec10f064dd2565b7a36373154 100644 (file)
--- a/red.css
+++ b/red.css
@@ -26,20 +26,33 @@ ul.keys li b {
        font-style: normal;
 }
 
-.ci   {background: none; font-style: italic} /* info */
-.pm   {background: none} .pm b, dt.pm {color: #DD6} /* motion */
-.po   {background: none} .po b, dt.po {color: #6CD} /* window */
-.co   {background: none} .co b, dt.co {color: none} /* command */
-.mi, .cp {background: #300} /* ins */
-.mo   {background: #600} /* state */
-.mv   {background: #600; font-style: italic} .mv b, dt.mv {color: #DD6} /* visual */
-.me   {background: #600; font-style: italic} /* mode */
-dl.legend-options dt,
-.no   {background: none} .no b {color: #000} /* unassigned */
-#vimperator .mi b, #vimperator dt.mi {color: #6CD} /* tab open */
+.no, dl.legend-options dt,
+.ci, .pm, .po, .co {background: none}
+#mutt .co,
+.mi, .cp           {background: #300}
+.mo, .mv, .me      {background: #600}
+#mutt .pm b, #mutt dt.pm,
+#mutt .mv b, #mutt dt.mv,
+dt.co,
+  .co b            {color: inherit}
+#vimperator .mi b, #vimperator dt.mi,
+dt.po,
+  .po b            {color: #6CD}
+#mutt .ci b, #mutt dt.ci,
+#mutt .mi b, #mutt dt.mi,
+#mutt .me b, #mutt dt.me,
+dt.pm, dt.mv,
+  .pm b, .mv b     {color: #DD6}
+.no b              {color: #000} /* unassigned */
+.ci, .mv, .me      {font-style: italic}
+#mutt .ci, #mutt .me,
+.no                {font-style: normal}
 
 .ci[onclick]:hover,
+.pm[onclick]:hover,
+.po[onclick]:hover,
 .co[onclick]:hover,
+.cp[onclick]:hover,
 .mi[onclick]:hover,
 .mo[onclick]:hover,
 .mv[onclick]:hover,