X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/14c29200cb58d3c4a0830265f2433849781858d0..c71aaa5c83036e5b1685f66887d51832b6fb49f7:/doc/gen-map-doc?ds=inline diff --git a/doc/gen-map-doc b/doc/gen-map-doc index fcbaeff..ad7dd68 100644 --- a/doc/gen-map-doc +++ b/doc/gen-map-doc @@ -23,21 +23,22 @@ while () { } if ($map and /{\s*"(.+)"\s*,\s*(\w+)\s*,\s*(?:"([^"]+)"|(\w+))\s*}/) { my ($function, $op, $binding) = ($1, $2, $3 || $4); - $binding =~ s/ /Space/; - $binding =~ s/^\\033/ESC /; - $binding =~ s/^\\010/Backspace/; - $binding =~ s/^\\(0\d+)$/'^'.chr(64+oct($1))/e; - $binding =~ s/^\\(0\d+)(.)/'^'.chr(64+oct($1)) ." $2"/e; - $binding =~ s/<(.+)>/$1/; $binding =~ s/&/&/; + # for , try CamelCasing into + $binding =~ s/<(.)(.+)>/<\U$1\E$2>/; $binding =~ s//>/; - $binding =~ s/\\t/TAB/; - $binding =~ s/M_ENTER_S/RET/; - $binding =~ s/NULL/not bound/; + $binding =~ s/ /<Space>/; + $binding =~ s/^\\033/Esc /; + $binding =~ s/^\\010/<Backspace>/; + $binding =~ s/^\\(0\d+)$/'^'.chr(64+oct($1))/e; + $binding =~ s/^\\(0\d+)(.)/'^'.chr(64+oct($1)) ." $2"/e; + $binding =~ s/\\t/<Tab>/; + $binding =~ s/M_ENTER_S/<Return>/; + $binding =~ s/NULL//; die "unknown key $binding" if $binding =~ /\\[^\\]|<|>/; die "unknown OP $op" unless $OPS{$op}; - $MAP{$map} .= "$function$binding$OPS{$op}\n"; + $MAP{$map} .= "<$function>$binding$OPS{$op}\n"; } if ($map and /^}/) { undef $map; @@ -48,18 +49,21 @@ open XML, $xml or die "$xml: $!"; while () { if (/__print_map\((.*)\)/) { my $map = $1; + my $maptitle = $1; + $maptitle =~ s/^(.)/\U$1\E/; unless ($MAP{$map}) { warn "map $map undefined"; next; } + my $title = $map; + $title =~ s/(.)(.+)/\U$1\E$2/; print < -$map + +$maptitle Menu $DOC{$map} - - -Default $map function bindings +
+Default $title Menu Bindings FunctionDefault keyDescription @@ -70,12 +74,10 @@ $MAP{$map}
-
-
EOT - delete $MAP{$1}; + delete $MAP{$map}; } else { print; }