[w3m-dev 02601]

From: Fumitoshi UKAI <ukai@debian.or.jp>
This commit is contained in:
Fumitoshi UKAI
2001-11-30 18:06:28 +00:00
parent b943a931a8
commit dcfbd6abaa
11 changed files with 187 additions and 31 deletions

View File

@@ -1,5 +1,19 @@
2001-12-01 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 02601]
* Makefile (install-core): added
* Makefile (install-helpfile): added
* configure (use_help_cgi): default yes if perl found
* configure (config.h): add HELP_CGI
* configure (config.h): add $def_use_help_cgi
* main.c (ldhelp): add USE_HELP_CGI code
* scripts/Makefile: use w3mhelp*.pl.in
* scripts/w3mhelp-funcname.pl.in: added
* scripts/w3mhelp-funcdesc.en.pl.in: added
* scripts/w3mhelp-funcdesc.ja.pl.in: added
* scripts/w3mhelp.cgi.in: use %buf_*, %lineedit_*
* scripts/w3mhelp.cgi.in: use %title
* [w3m-dev 02660] (based on [w3m-dev 02577]
by Kiyokazu SUTO <suto@ks-and-ks.ne.jp>)
* scripts/.cvsignore: add w3mhelp.cgi w3mhelp-*.pl

View File

@@ -6,6 +6,12 @@ all: XXMakefile
install: XXMakefile
$(MAKE) -f XXMakefile install
install-core: XXMakefile
$(MAKE) -f XXMakefile install-core
install-helpfile: XXMakefile
$(MAKE) -f XXMakefile install-helpfile
install-scripts: XXMakefile
$(MAKE) -f XXMakefile install-scripts

View File

@@ -117,6 +117,7 @@ MODEL=Linux.i686-monster-ja
#undef USE_NNTP
#undef USE_GOPHER
#undef USE_ALARM
#define USE_HELP_CGI
#define DEF_EDITOR "/bin/vi"
#define DEF_MAILER "/bin/mail"
@@ -126,6 +127,7 @@ MODEL=Linux.i686-monster-ja
#define HELP_DIR "/usr/local/lib/w3m"
#define ETC_DIR "/usr/local/etc/w3m"
#define HELP_FILE "w3mhelp.html"
#define HELP_CGI "w3mhelp"
#define W3MCONFIG "w3mconfig"
#define RC_DIR "~/.w3m/"

8
configure vendored
View File

@@ -1,5 +1,5 @@
#!/bin/sh
# $Id: configure,v 1.29 2001/11/30 10:49:06 ukai Exp $
# $Id: configure,v 1.30 2001/11/30 18:06:28 ukai Exp $
# Configuration.
#
@@ -1108,10 +1108,14 @@ perl=`./which perl`
if [ `expr "$perl" : 'not found'` != 0 ]; then
echo "You don't have perl."
perl=/usr/local/bin/perl
have_perl=n
else
echo "You have perl."
have_perl=y
fi
def_param use_help_cgi $have_perl
####### strcasecmp
cat > _zmachdep.c << EOF
#include <string.h>
@@ -1971,6 +1975,7 @@ $def_ftppass_hostnamegen
$def_use_nntp
$def_use_gopher
$def_use_alarm
$def_use_help_cgi
#define DEF_EDITOR "$editor"
#define DEF_MAILER "$mailer"
@@ -1980,6 +1985,7 @@ $def_use_alarm
#define HELP_DIR "$helpdir"
#define ETC_DIR "$sysconfdir"
#define HELP_FILE "w3mhelp.html"
#define HELP_CGI "w3mhelp"
#define W3MCONFIG "w3mconfig"
#define RC_DIR "~/.w3m/"

15
main.c
View File

@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.29 2001/11/30 11:10:36 ukai Exp $ */
/* $Id: main.c,v 1.30 2001/11/30 18:06:28 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -1604,7 +1604,20 @@ ldfile(void)
void
ldhelp(void)
{
#ifdef USE_HELP_CGI
char *lang;
int n;
lang = AcceptLang;
n = strcspn(lang, ";, \t");
cmd_loadURL(Sprintf("file:///$LIB/" HELP_CGI CGI_EXTENSION
"?version=%s&lang=%s",
Str_form_quote(Strnew_charp(w3m_version))->ptr,
Str_form_quote(Strnew_charp_n(lang, n))->ptr)->ptr,
NULL);
#else
cmd_loadURL(helpFile(HELP_FILE), NULL);
#endif
}
static void

View File

@@ -1,4 +1,5 @@
dirlist.cgi
w3mhelp.cgi
w3hmhelp-*.pl
w3hmhelp-funcdesc.en.pl
w3hmhelp-funcdesc.ja.pl
w3hmhelp-funcname.pl

View File

@@ -41,7 +41,7 @@ helplibs:
fi; \
done < ../doc/$$keymap >> w3mhelp-funcname.pl
@echo ');' >> w3mhelp-funcname.pl
@echo '1;' >> w3mhelp-funcname.pl
@cat w3mhelp-funcname.pl.in >> w3mhelp-funcname.pl
@echo "done"
@echo "generating w3mhelp-funcdesc*.pl..."
@@ -53,7 +53,7 @@ helplibs:
case "$$func" in [a-zA-Z@]*) echo "'$$func', '$$desc', ";; esac; \
done < ../$$dir/README.func >> w3mhelp-funcdesc.$$lang.pl; \
echo ');' >> w3mhelp-funcdesc.$$lang.pl; \
echo '1;' >> w3mhelp-funcdesc.$$lang.pl; \
cat w3mhelp-funcdesc.$$lang.pl.in >> w3mhelp-funcdesc.$$lang.pl; \
done
@echo done

View File

@@ -0,0 +1,26 @@
# Buffer selection mode
%buf_funcdesc = (
'BUF:PREV', 'Select previous buffer',
'BUF:NEXT', 'Select next buffer',
'BUF:DELETE', 'Delete current buffer',
'BUF:GO', 'Go to the selected buffer',
);
%lineedit_funcdesc = (
'LINEEDIT:FORWARD', 'Move cursor forward',
'LINEEDIT:BACK', 'Move cursor backward',
'LINEEDIT:BS', 'Delete previous character',
'LINEEDIT:DEL', 'Delete current character',
'LINEEDIT:KILL_AFTER', 'Kill everything after cursor',
'LINEEDIT:KILL_BEFORE', 'Kill everything before cursor',
'LINEEDIT:TOP', 'Move to the top of line',
'LINEEDIT:BOTTOM', 'Move to the bottom of line',
'LINEEDIT:PREV', 'Fetch the previous string from the history list',
'LINEEDIT:NEXT', 'Fetch the next string from the history list',
'LINEEDIT:COMPLETE', 'Complete filename',
'LINEEDIT:ACCEPT', 'Accept',
);
1;

View File

@@ -0,0 +1,40 @@
# Buffer selection mode
%buf_funcdesc = (
'BUF:PREV', '<27><><EFBFBD>ľ<EFBFBD><C4BE>ΥХåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'BUF:NEXT', '<27><><EFBFBD>IJ<EFBFBD><C4B2>ΥХåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'BUF:DELETE', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤Ƥ<F2A4B7A4><C6A4><EFBFBD><EFBFBD>Хåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'BUF:GO', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򤷤Ƥ<F2A4B7A4><C6A4><EFBFBD><EFBFBD>Хåե<C3A5><D5A5><EFBFBD>ɽ<EFBFBD><C9BD>',
);
%lineedit_funcdesc = (
'LINEEDIT:FORWARD', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򱦤ذ<F2B1A6A4>ư',
'LINEEDIT:BACK', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򺸤ذ<F2BAB8A4>ư',
'LINEEDIT:BS', '<27><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'LINEEDIT:DEL', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'LINEEDIT:KILL_AFTER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD>',
'LINEEDIT:KILL_BEFORE', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤǤ<DEA4><C7A4><EFBFBD><EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD>',
'LINEEDIT:TOP', '<27><>Ƭ<EFBFBD>˰<EFBFBD>ư',
'LINEEDIT:BOTTOM', '<27><><EFBFBD><EFBFBD><EFBFBD>ذ<EFBFBD>ư',
'LINEEDIT:PREV', '<27>ҥ<EFBFBD><D2A5>ȥ꤫<C8A5><EAA4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD>',
'LINEEDIT:NEXT', '<27>ҥ<EFBFBD><D2A5>ȥ꤫<C8A5><EFBFBD><E9BCA1>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD>',
'LINEEDIT:COMPLETE', '<27>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD>䴰',
'LINEEDIT:ACCEPT', '<27><><EFBFBD>Ͻ<EFBFBD>λ',
);
%title = (
"Page/Cursor motion", '<27>ڡ<EFBFBD><DAA1><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ư',
"Hyperlink operation", '<27>ϥ<EFBFBD><CFA5>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
"File/Stream operation", '<27>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD>ȥ꡼<C8A5><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
"Buffer operation", '<27>Хåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD>',
"Buffer selection mode", '<27>Хåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A1BC>',
"Bookmark operation", '<27>֥å<D6A5><C3A5>ޡ<EFBFBD><DEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
"Search", '<27><><EFBFBD><EFBFBD>',
"Dictionary look-up", '<27><><EFBFBD>񸡺<EFBFBD>',
"Mark operation", '<27>ޡ<EFBFBD><DEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
"Miscellany", '<27><><EFBFBD><EFBFBD>¾',
"Line-edit mode", '<27><><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD><E2A1BC>',
);
1;

View File

@@ -0,0 +1,49 @@
%buf_funcname = (
'BUF:PREV', 'buffer_prev',
'BUF:NEXT', 'buffer_next',
'BUF:DELETE', 'buffer_delete',
'BUF:GO', 'buffer_go',
);
%lineedit_funcname = (
'LINEEDIT:FORWARD', 'lineedit_forward',
'LINEEDIT:BACK', 'lineedit_back',
'LINEEDIT:BS', 'lineedit_backspace',
'LINEEDIT:DEL', 'lineedit_delete',
'LINEEDIT:KILL_AFTER', 'lineedit_kill_after',
'LINEEDIT:KILL_BEFORE', 'lineedit_kill_before',
'LINEEDIT:TOP', 'lineedit_top',
'LINEEDIT:BOTTOM', 'lineedit_bottom',
'LINEEDIT:PREV', 'lineedit_prev',
'LINEEDIT:NEXT', 'lineedit_next',
'LINEEDIT:COMPLETE', 'lineedit_complete',
'LINEEDIT:ACCEPT', 'lineedit_accept',
);
%buf_keyfunc = (
'k', 'BUF:PREV',
'C-p', 'BUF:PREV',
'j', 'BUF:NEXT',
'C-n', 'BUF:NEXT',
'D', 'BUF:DELETE',
'RET', 'BUF:GO'
);
%lineedit_keyfunc = (
'C-f', 'LINEEDIT:FORWARD',
'C-b', 'LINEEDIT:BACK',
'C-h', 'LINEEDIT:BS',
'C-d', 'LINEEDIT:DEL',
'C-k', 'LINEEDIT:KILL_AFTER',
'C-u', 'LINEEDIT:KILL_BEFORE',
'C-a', 'LINEEDIT:TOP',
'C-e', 'LINEEDIT:BOTTOM',
'C-p', 'LINEEDIT:PREV',
'C-n', 'LINEEDIT:NEXT',
'TAB', 'LINEEDIT:COMPLETE',
'SPC', 'LINEEDIT:COMPLETE',
'RET', 'LINEEDIT:ACCEPT'
);
1;

View File

@@ -1,5 +1,5 @@
#!@PERL@
# $Id: w3mhelp.cgi.in,v 1.1 2001/11/30 16:48:19 ukai Exp $
# $Id: w3mhelp.cgi.in,v 1.2 2001/11/30 18:06:29 ukai Exp $
$helpdir="@HELP_DIR@";
unshift(@INC, $helpdir);
@@ -40,12 +40,22 @@ if (-f $keymap) {
local (%funckeydesc, $key, $fname, $desc);
%funcname = (%funcname, %buf_funcname, %lineedit_funcname);
%funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc);
while (($fname, $desc) = each %funcdesc) {
$funckeydesc{$funcname{$fname}} = "$desc\n";
}
while (($key, $fname) = each %keyfunc) {
$funckeydesc{$funcname{$fname}} .= "$key,";
}
while (($key, $fname) = each %buf_keyfunc) {
$funckeydesc{$funcname{$fname}} .= "$key,";
}
while (($key, $fname) = each %lineedit_keyfunc) {
$funckeydesc{$funcname{$fname}} .= "$key,";
}
print <<HEADING;
Content-Type: text/html
@@ -98,15 +108,8 @@ for $otherlang (@docdirs) {
qw(backBf vwSrc selMn editBf rdrwSc reload
svBuf svSrc editScr));
print <<PAGE;
<H2>Buffer selection mode</H2>
<table cellpadding=0>
<TR><TD WIDTH=140>k, C-p<TD>Select previous buffer
<TR><TD>j, C-n<TD>Select next buffer
<TR><TD>D<TD>Delete current buffer
<TR><TD>RET<TD>Go to the selected buffer
</table>
PAGE
&show_keymap("Buffer selection mode",
qw(buffer_prev buffer_next buffer_delete buffer_go));
&show_keymap("Bookmark operation",
qw(ldBmark adBmark));
@@ -123,22 +126,13 @@ PAGE
&show_keymap("Miscellany",
qw(setAlarm execsh ldhelp ldOpt cooLst susp qquitfm quitfm));
&show_keymap("Line-edit mode",
qw(lineedit_forward lineedit_back lineedit_backspace
lineedit_delete lineedit_kill_after lineedit_kill_before
lineedit_top lineedit_bottom lineedit_prev lineedit_next
lineedit_complete lineedit_accept));
print <<PAGE;
<H2>Line-edit mode</H2>
<table cellpadding=0>
<TR><TD WIDTH=140>C-f<TD>Move cursor forward
<TR><TD>C-b<TD>Move cursor backward
<TR><TD>C-h<TD>Delete previous character
<TR><TD>C-d<TD>Delete current character
<TR><TD>C-k<TD>Kill everything after cursor
<TR><TD>C-u<TD>Kill everything before cursor
<TR><TD>C-a<TD>Move to the top of line
<TR><TD>C-e<TD>Move to the bottom of line
<TR><TD>C-p<TD>Fetch the previous string from the history list
<TR><TD>C-n<TD>Fetch the next string from the history list
<TR><TD>TAB,SPC<TD>Complete filename
<TR><TD>RETURN<TD>Accept
</table>
<HR>
</BODY>
</HTML>
@@ -167,6 +161,11 @@ sub show_keymap {
my ($fid);
my ($attr) = " WIDTH=140";
if (defined($title{$head})) {
$head = $title{$head};
$head =~ s/[<>&]/$htmlesc{$&}/ge;
}
print <<PAGE;
<H2>$head</H2>
<table cellpadding=0>