[w3m-dev 02841] migemo patch

* NEWS: migemo support
* config.h.dist (USE_MIGEMO): added
* configure: add use_migemo
* fm.h (use_migemo): added
* fm.h (migemo_command: added
* main.c (fversion): add "migemo"
* main.c (migemostr): added
* main.c (srchcore): if use_migemo, use migemostr
* rc.c (CMT_USE_MIGEMO): added
* rc.c (CMT_MIGEMO_COMMAND): added
* rc.c (params3): add use_migemo, migemo_command
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-01-15 17:23:29 +00:00
parent 18223a265b
commit 65bc0411a1
7 changed files with 73 additions and 6 deletions

View File

@@ -1,3 +1,18 @@
2002-01-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02841] migemo patch
* NEWS: migemo support
* config.h.dist (USE_MIGEMO): added
* configure: add use_migemo
* fm.h (use_migemo): added
* fm.h (migemo_command: added
* main.c (fversion): add "migemo"
* main.c (migemostr): added
* main.c (srchcore): if use_migemo, use migemostr
* rc.c (CMT_USE_MIGEMO): added
* rc.c (CMT_MIGEMO_COMMAND): added
* rc.c (params3): add use_migemo, migemo_command
2002-01-16 Fumitoshi UKAI <ukai@debian.or.jp>
* main.c (fversion): add "external-uri-loader,w3mmailer"
@@ -1962,4 +1977,4 @@
* release-0-2-1
* import w3m-0.2.1
$Id: ChangeLog,v 1.222 2002/01/15 16:30:08 ukai Exp $
$Id: ChangeLog,v 1.223 2002/01/15 17:23:29 ukai Exp $

1
NEWS
View File

@@ -1,5 +1,6 @@
w3m 0.3?
* support migemo (romaji search) [experimental]
* use w3mmail.cgi for mailto: URL
* support external URI loader
* support -dump_extra ftp://

View File

@@ -102,6 +102,7 @@ MODEL=Linux.i686-monster-ja
#define KANJI_SYMBOLS
#define USE_COLOR
#undef USE_ANSI_COLOR
#undef USE_MIGEMO
#undef EMACS_LIKE_LINEEDIT
#undef VI_PREC_NUM
#undef USE_MARK

5
configure vendored
View File

@@ -1,5 +1,5 @@
#!/bin/sh
# $Id: configure,v 1.49 2002/01/15 03:45:02 ukai Exp $
# $Id: configure,v 1.50 2002/01/15 17:23:29 ukai Exp $
# Configuration.
#
@@ -697,6 +697,8 @@ else
def_param "use_ansi_color" n
fi
ask_param "Use Migemo (Roma-ji search; Please see http://www.nmn.jp/~hidai/software/w3m/)" use_migemo n
# protocols?
ask_param "External URI loader support" use_external_uri_loader y
if [ "$use_external_uri_loader" = y ]; then
@@ -2035,6 +2037,7 @@ $def_lang
$def_kanji_symbols
$def_use_color
$def_use_ansi_color
$def_use_migemo
$def_emacs_like_lineedit
$def_vi_prec_num
$def_use_mark

7
fm.h
View File

@@ -1,4 +1,4 @@
/* $Id: fm.h,v 1.37 2002/01/14 15:59:17 ukai Exp $ */
/* $Id: fm.h,v 1.38 2002/01/15 17:23:29 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -776,6 +776,11 @@ global char *DirBufferCommand init("file:///$LIB/dirlist" CGI_EXTENSION);
global int ignore_null_img_alt init(TRUE);
global int FoldTextarea init(FALSE);
#ifdef USE_MIGEMO
global int use_migemo init(FALSE);
global char *migemo_command init("migemoc");
#endif /* USE_MIGEMO */
global struct auth_cookie *Auth_cookie init(NULL);
global char *Local_cookie init(NULL);
#ifdef USE_COOKIE

29
main.c
View File

@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.58 2002/01/15 16:30:08 ukai Exp $ */
/* $Id: main.c,v 1.59 2002/01/15 17:23:29 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -152,6 +152,9 @@ fversion(FILE * f)
#endif
#ifdef USE_MARK
",mark"
#endif
#ifdef USE_MIGEMO
",migemo"
#endif
);
}
@@ -1330,6 +1333,24 @@ rdrwSc(void)
displayBuffer(Currentbuf, B_FORCE_REDRAW);
}
#ifdef USE_MIGEMO
/* Migemo: romaji --> kana+kanji in regexp */
static char *
migemostr(char *str)
{
FILE *f;
Str tmp;
tmp = Strnew_m_charp(migemo_command, " ", shell_quote(str), NULL);
if (!(f = popen(tmp->ptr, "r")))
return str;
tmp = Strfgets(f);
Strchop(tmp);
pclose(f);
return tmp->ptr;
}
#endif /* USE_MIGEMO */
/* search by regular expression */
static int
srchcore(char *str, int (*func) (Buffer *, char *))
@@ -1338,7 +1359,11 @@ srchcore(char *str, int (*func) (Buffer *, char *))
volatile int i, result = SR_NOTFOUND;
if (str != NULL && str != SearchString)
SearchString = str;
SearchString =
#ifdef USE_MIGEMO
use_migemo ? migemostr(str) :
#endif /* USE_MIGEMO */
str;
if (SearchString == NULL || *SearchString == '\0')
return SR_NOTFOUND;

19
rc.c
View File

@@ -1,4 +1,4 @@
/* $Id: rc.c,v 1.28 2002/01/15 16:07:58 ukai Exp $ */
/* $Id: rc.c,v 1.29 2002/01/15 17:23:29 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -168,6 +168,11 @@ static char *config_file = NULL;
#define CMT_FOLLOW_REDIRECTION "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥβ<C8A4><CEB2><EFBFBD>"
#define CMT_META_REFRESH "meta refresh <20><><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>"
#ifdef USE_MIGEMO
#define CMT_USE_MIGEMO "Migemo(<28><><EFBFBD><EFBFBD><EFBFBD>޻<EFBFBD><DEBB><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD>"
#define CMT_MIGEMO_COMMAND "Migemo<6D><6F><EFBFBD>ޥ<EFBFBD><DEA5><EFBFBD>"
#endif /* USE_MIGEMO */
#else /* LANG != JA */
@@ -283,6 +288,12 @@ static char *config_file = NULL;
#endif
#define CMT_FOLLOW_REDIRECTION "Follow this number of redirections"
#define CMT_META_REFRESH "Support meta refresh"
#ifdef USE_MIGEMO
#define CMT_USE_MIGEMO "Use Migemo (Roma-ji search)"
#define CMT_MIGEMO_COMMAND "Migemo command"
#endif /* USE_MIGEMO */
#endif /* LANG != JA */
#define PI_TEXT 0
@@ -461,6 +472,12 @@ struct param_ptr params3[] = {
{"wrap_search", P_INT, PI_ONOFF, (void *)&WrapDefault, CMT_WRAP, NULL},
{"ignorecase_search", P_INT, PI_ONOFF, (void *)&IgnoreCase,
CMT_IGNORE_CASE, NULL},
#ifdef USE_MIGEMO
{"use_migemo", P_INT, PI_ONOFF, (void *)&use_migemo, CMT_USE_MIGEMO,
NULL},
{"migemo_command", P_STRING, PI_TEXT, (void *)&migemo_command,
CMT_MIGEMO_COMMAND, NULL},
#endif /* USE_MIGEMO */
#ifdef USE_MOUSE
{"use_mouse", P_INT, PI_ONOFF, (void *)&use_mouse, CMT_MOUSE, NULL},
{"reverse_mouse", P_INT, PI_ONOFF, (void *)&reverse_mouse,