diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-15 17:23:29 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-15 17:23:29 +0000 |
commit | 65bc0411a17980179bc4f0008afb58e50a0d16d6 (patch) | |
tree | 4ed52b991bfc6735d47ab7819fccba400fb6bc93 | |
parent | * main.c (fversion): add "external-uri-loader,w3mmailer" (diff) | |
download | w3m-65bc0411a17980179bc4f0008afb58e50a0d16d6.tar.gz w3m-65bc0411a17980179bc4f0008afb58e50a0d16d6.zip |
[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>
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | config.h.dist | 1 | ||||
-rwxr-xr-x | configure | 5 | ||||
-rw-r--r-- | fm.h | 7 | ||||
-rw-r--r-- | main.c | 29 | ||||
-rw-r--r-- | rc.c | 19 |
7 files changed, 73 insertions, 6 deletions
@@ -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,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:// diff --git a/config.h.dist b/config.h.dist index e1208ae..ec389fe 100644 --- a/config.h.dist +++ b/config.h.dist @@ -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 @@ -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 @@ -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 @@ -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> @@ -153,6 +153,9 @@ fversion(FILE * f) #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; @@ -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 "従うリダイレクトの回数" #define CMT_META_REFRESH "meta refresh に対応する" +#ifdef USE_MIGEMO +#define CMT_USE_MIGEMO "Migemo(ローマ字検索)を使用する" +#define CMT_MIGEMO_COMMAND "Migemoコマンド" +#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, |