#!@PERL@ # $Id: w3mhelp.cgi.in,v 1.1 2001/11/30 16:48:19 ukai Exp $ $helpdir="@HELP_DIR@"; unshift(@INC, $helpdir); @docdirs=qw(@DOCDIRS@); require "w3mhelp-funcname.pl"; require "w3mhelp-funcdesc.en.pl"; $lang = 'en'; %htmlesc = qw(< < > > & &); $keymap = "$ENV{'HOME'}/.w3m/keymap"; $version = '*unknown*'; if (defined($ENV{'QUERY_STRING'})) { print "QUERY_STRING=$ENV{'QUERY_STRING'}\n"; if ($ENV{'QUERY_STRING'} =~ /(^|&)version=([^&]*)/) { $version = $2; $version =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge; $version =~ s/w3m\///; } if ($ENV{'QUERY_STRING'} =~ /(^|&)lang=([^&]*)/) { local $tlang=$2; $tlang =~ s/\+|%([0-9A-Fa-f][0-9A-Fa-f])/$& eq '+' ? ' ' : pack('C', hex($1))/ge; $tlang =~ tr/A-Z/a-z/; print "tlang=$tlang\n"; eval qq{require "w3mhelp-funcdesc.$tlang.pl"}; if (defined(%funcdesc)) { $lang = $tlang; } } } if (-f $keymap) { open(KEYMAP, $keymap) or die "cannot open keymap: $keymap, $!"; &load_keymap(*KEYMAP, $func); close(KEYMAP); } local (%funckeydesc, $key, $fname, $desc); while (($fname, $desc) = each %funcdesc) { $funckeydesc{$funcname{$fname}} = "$desc\n"; } while (($key, $fname) = each %keyfunc) { $funckeydesc{$funcname{$fname}} .= "$key,"; } print < w3m help page
******* w3m (WWW-wo-Miru) Version $version by A.ITO ********
***** Key assign table *****
HEADING $q_version = $version; $q_version =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge; $script = "$d[2] version
\n"; } } &show_keymap("Page/Cursor motion", qw(pgFore pgBack movR movL movD movU lup1 ldown1 goLineF goLineL movRW movLW shiftl shiftr col1R col1L goLine ctrCsrH ctrCsrV topA lastA nextA prevA nextL nextLU nextR nextRD nextD nextU)); &show_keymap("Hyperlink operation", qw(followA svA peekURL peekIMG followI svI chkURL chkNMID curURL pginfo curlno ldHist rFrame extbrz linkbrz)); &show_keymap("File/Stream operation", qw(goURL ldfile readsh pipesh)); &show_keymap("Buffer operation", qw(backBf vwSrc selMn editBf rdrwSc reload svBuf svSrc editScr)); print <Buffer selection mode
k, C-pSelect previous buffer
j, C-nSelect next buffer
DDelete current buffer
RETGo to the selected buffer
PAGE &show_keymap("Bookmark operation", qw(ldBmark adBmark)); &show_keymap("Search", qw(srchfor srchbak srchnxt srchprv)); &show_keymap("Dictionary look-up", qw(dictword dictwordat)); &show_keymap("Mark operation", qw(_mark prevMk nextMk reMark)); &show_keymap("Miscellany", qw(setAlarm execsh ldhelp ldOpt cooLst susp qquitfm quitfm)); print <Line-edit mode
C-fMove cursor forward
C-bMove cursor backward
C-hDelete previous character
C-dDelete current character
C-kKill everything after cursor
C-uKill everything before cursor
C-aMove to the top of line
C-eMove to the bottom of line
C-pFetch the previous string from the history list
C-nFetch the next string from the history list
TAB,SPCComplete filename
RETURNAccept

PAGE exit 0; sub load_keymap { local(*FH) = shift; my ($func) = @_; while () { next if /^#/; next if /^\s*$/; ($keymap, $key, $fname) = split; next unless $keymap =~ /keymap/; $fname =~ tr/a-z/A-Z/; next unless (defined($funcdesc{$fname})); $key =~ s/^\\//; $keyfunc{$key} = $fname; } } sub show_keymap { my ($head, @list) = @_; my ($fid); my ($attr) = " WIDTH=140"; print <$head PAGE foreach $fid (@list) { local ($desc, $keys) = split("\n", $funckeydesc{$fid}, 2); $keys =~ s/,$//; $keys = '' if ($keys eq ''); $keys =~ s/[<>&]/$htmlesc{$&}/ge; $desc =~ s/[<>&]/$htmlesc{$&}/ge; print <$keys PAGE $attr = ""; } print "
$desc
\n"; }