keys: common generation of flags legend from includes
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Apr 2012 15:55:37 +0000 (17:55 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 10 Apr 2012 01:03:24 +0000 (03:03 +0200)
12 files changed:
less.eng.inc.pl
less.plp
mplayer.eng.inc.pl
mplayer.plp
mutt.eng.inc.pl
mutt.plp
nethack.eng.inc.pl
nethack.plp
readline.eng.inc.pl
readline.plp
vimperator.eng.inc.pl
vimperator.plp

index c0afb11041332c222eea20f8d3b41d904d7ebfc5..99c05456fd47734de02ff167b881cc9e0ca77f0f 100644 (file)
@@ -110,4 +110,16 @@ mode => {
        ':'  => 'colon commands',
 },
 
+flag => {
+       ci => [info   => 'Temporary message display (or related option).'],
+       pm => [move   => 'Regular file position panning (or option).'],
+       po => [jump   => 'Other file position manipulation (").'],
+       co => [search => 'Go to matching content (").'],
+       mo => [file   => 'Alter open file buffer (").'],
+       mv => [misc   => 'Other commands and options.'],
+
+       arg  => ["key$sign{arg}" => "Commands with a dot need a char argument afterwards."],
+       more => [more => "A small subset is compatible with `more`."],
+},
+
 }
index 1b427237e66d59d7bf623280df2845a00b0e4bd5..f701ca8f3434e67bc9f3dcbe4e8fe4d5947be909 100644 (file)
--- a/less.plp
+++ b/less.plp
@@ -34,29 +34,11 @@ $keys->print_rows($get{rows}, [1,0]);
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="ci">info
-                       <dd>Temporary message display (or related option).
-               <dt class="pm">move
-                       <dd>Regular file position panning (or option).
-               <dt class="po">jump
-                       <dd>Other file position manipulation (").
-               <dt class="co">search
-                       <dd>Go to matching content (").
-               <dt class="mo">file
-                       <dd>Alter open file buffer (").
-               <dt class="mv">misc
-                       <dd>Other commands and options.
-               </dl>
+<: $keys->print_legend('legend-types', [qw( ci pm po co mo mv )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need a char argument afterwards.
-               <dt class="more">more
-                       <dd>A small subset is compatible with `more`.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg more )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is
index c6de943c06d2c970be4f99f4c5ec228feedfdd85..7431994ce1af80a159d67789318017f97bf64e66 100644 (file)
@@ -55,4 +55,16 @@ mode => {
        '' => "interactive control",
 },
 
+flag => {
+       ci => [osd       => "Print information or change display."],
+       pm => [subtitles => "Alter subtitle selection and settings."],
+       co => [video     => "Video output adjustment."],
+       mi => [audio     => "Sound (track) configuration."],
+       mo => [playback  => "Playback control."],
+       me => [general   => "Other MPlayer features."],
+
+       arg => ["key$sign{arg}" => "Commands with a dot need an argument afterwards."],
+       ext => ["optional"      => "Some features depend on setup and/or parameters."],
+},
+
 }
index 200b355a433d5c309e8844277cec040289821006..5b53ded991f856e06bb97ae384d3cae90928af94 100644 (file)
@@ -33,29 +33,11 @@ $keys->print_rows($get{rows}, [1,0]);
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="ci">osd
-                       <dd>Print information or change display.
-               <dt class="pm">subtitles
-                       <dd>Alter subtitle selection and settings.
-               <dt class="co">video
-                       <dd>Video output adjustment.
-               <dt class="mi">audio
-                       <dd>Sound (track) configuration.
-               <dt class="mo">playback
-                       <dd>Playback control.
-               <dt class="me">general
-                       <dd>Other MPlayer features.
-               </dl>
+<: $keys->print_legend('legend-types', [qw( ci pm co mi mo me )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need an argument afterwards.
-               <dt class="ext">optional
-                       <dd>Some features depend on setup and/or parameters.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg ext )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is
index 44f0392c9b80041b41fc2df5135ac7899e3fd9a9..f12dce69434242139852742e826040e8917ce6b0 100644 (file)
@@ -203,4 +203,17 @@ mode => {
        '/~' => 'search flags (/~)',
 },
 
+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."],
+},
+
 }
index 40959656e4bd8cdd79507f0e0664cdcee5047894..62c2fc11451dc0a1ae04149a44d3fb67dbffeb66 100644 (file)
--- a/mutt.plp
+++ b/mutt.plp
@@ -33,31 +33,11 @@ $keys->print_rows($get{rows});
 
 <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">select
-                       <dd>Scroll list and/or select a different line.
-               <dt class="po">search
-                       <dd>Go to a specific 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>
+<: $keys->print_legend('legend-types', [qw( ci pm po co mi mo mv me )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need an argument afterwards.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is
index be691647443110b9f41d4c4a9697d7f447cd24c1..e4ef3b3a28d39310cda34f8f58f6e08879f74349 100644 (file)
@@ -139,4 +139,17 @@ mode => {
        '' => 'normal gameplay',
 },
 
+flag => {
+       pm => [direction => "Direction to move to or target a command ($sign{motion})."],
+       po => [move      => "Other character movement."],
+       co => [act       => "Direct action command: takes a turn."],
+       mi => [info      => "Informational command: shows/does something without ending the turn."],
+       mo => [invertory => "Display invertory menu."],
+       mv => [menu      => "Enters some other menu."],
+
+       arg  => ["key$sign{arg}"  => "Commands with a dot need at least one argument afterwards."],
+       argi => ["key$sign{argi}" => "Asks for an inventory item."],
+       argm => ["key$sign{argm}" => "Requires a direction afterwards."],
+},
+
 }
index b00fb9c194156bc97e119066ff29ab7a9d1622d4..add03706c0d5a0b04645f98af9e885d8752421b9 100644 (file)
@@ -35,31 +35,11 @@ $keys->print_rows($get{rows} || '4321-421', [3,2,1,0]);
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="pm">direction
-                       <dd>Direction to move to or target a command (<:= $sign{motion} :>).
-               <dt class="po">move
-                       <dd>Other character movement.
-               <dt class="co">act
-                       <dd>Direct action command: takes a turn.
-               <dt class="mi">info
-                       <dd>Informational command: shows/does something without ending the turn.
-               <dt class="mo">invertory
-                       <dd>Display invertory menu.
-               <dt class="mv">menu
-                       <dd>Enters some other menu.
-               </dl>
+<: $keys->print_legend('legend-types', [qw( pm po co mi mo mv )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need at least one argument afterwards.
-               <dt>key<:= $sign{argi} :>
-                       <dd>Asks for an inventory item.
-               <dt>key<:= $sign{argm} :>
-                       <dd>Requires a direction afterwards.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg argi argm )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is
index da03370f4d26a2656db075d3565a40f6a1c1861c..c7bcd25c4633dfc03443ecc36b1be88963cb11e0 100644 (file)
@@ -80,4 +80,18 @@ mode => {
        '^x' => 'emacs ctrl-x bindings',
 },
 
+flag => {
+       ci => [info    => "Info command: shows/does something without altering anything."],
+       pm => [motion  => "Move the cursor."],
+       co => [history => "Replace contents involving kill ring, undo, or command history."],
+       mi => [change  => "Alter current text (filtering or completion)."],
+       mo => [delete  => "Remove text."],
+       mv => [misc    => "Miscellaneous commands."],
+       me => [mode    => "Additional key functionality (click to view)."],
+
+       arg => ["key$sign{arg}" => "Commands with a dot need a char argument afterwards."],
+       new => ["&gt;v2.0" => "Unavailable before readline version 2.1 (1997)."],
+       ext => ["bash" => "Default assignment in Bash shells, but not common readline."],
+},
+
 }
index c0eb58a280f7da6df1a9a3bcf35175adef68a98d..9c7c027a8c68754fa886d2a929d5d399b9a47993 100644 (file)
@@ -33,33 +33,11 @@ $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="ci">info
-                       <dd>Info command: shows/does something without altering anything.
-               <dt class="pm">motion
-                       <dd>Move the cursor.
-               <dt class="co">history
-                       <dd>Replace contents involving kill ring, undo, or command history.
-               <dt class="mi">change
-                       <dd>Alter current text (filtering or completion).
-               <dt class="mo">delete
-                       <dd>Remove text.
-               <dt class="mv">misc
-                       <dd>Miscellaneous commands.
-               <dt class="me">mode
-                       <dd>Additional key functionality (click to view).
-               </dl>
+<: $keys->print_legend('legend-types', [qw( ci pm co mi mo mv me )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need a char argument afterwards.
-               <dt class="new">&gt;v2.0
-                       <dd>Unavailable before readline version 2.1 (1997).
-               <dt class="ext">bash
-                       <dd>Default assignment in Bash shells, but not common readline.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg new ext )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is
index 70fde8035a15a01fbdaadeaa0c5a22ec5860aab9..1b23b4d440a0986e22eaab5cc838104ae3a465c9 100644 (file)
@@ -136,4 +136,19 @@ mode => {
        'Z' => 'quit commands (Z)',
 },
 
+flag => {
+       ci => ['info'     => "Displays something without any permanent consequences."],
+       pm => ['motion'   => "Move cursor, scroll window, focus buffer element."],
+       po => ['tab'      => "Tab or window navigation/selection."],
+       co => ['buffer'   => "Page interaction."],
+       cp => ['open'     => "Browse to a location in the current tab."],
+       mi => ['tab open' => "Browse somewhere in a new tab."],
+       mo => ['browser'  => "Other browser action."],
+       mv => ['mode'     => "Enter a different mode."],
+       me => ['key cmd'  => "Additional key commands (click for overview)."],
+
+       arg  => ["key$sign{arg}"  => "Commands with a dot need a char argument afterwards."],
+       args => ["key$sign{args}" => "Commands with two dots require variable arguments afterwards."],
+},
+
 }
index d939c9adf7034a9be7cd6c9097fc4f0ef775eeb0..3493d842775b026b51eabfb651b520918f6548c9 100644 (file)
@@ -36,35 +36,11 @@ $keys->print_rows($get{rows});
 
 <div class="help">
        <div class="left">
-               <dl class="legend legend-types">
-               <dt class="ci">info
-                       <dd>Displays something without any permanent consequences.
-               <dt class="pm">motion
-                       <dd>Move cursor, scroll window, focus buffer element.
-               <dt class="po">tab
-                       <dd>Tab or window navigation/selection.
-               <dt class="co">buffer
-                       <dd>Page interaction.
-               <dt class="cp">open
-                       <dd>Browse to a location in the current tab.
-               <dt class="mi">tab open
-                       <dd>Browse somewhere in a new tab.
-               <dt class="mo">browser
-                       <dd>Other browser action.
-               <dt class="mv">mode
-                       <dd>Enter a different mode.
-               <dt class="me">key cmd
-                       <dd>Additional key commands (click for overview).
-               </dl>
+<: $keys->print_legend('legend-types', [qw( ci pm po co cp mi mo mv me )]) :>
        </div>
 
        <div class="right">
-               <dl class="legend legend-options">
-               <dt>key<:= $sign{arg} :>
-                       <dd>Commands with a dot need a char argument afterwards.
-               <dt>key<:= $sign{args} :>
-                       <dd>Commands with two dots require variable arguments afterwards.
-               </dl>
+<: $keys->print_legend('legend-options', [qw( arg args )]) :>
 
                <ul class="legend legend-set">
                <li>keyboard <strong>map</strong> is