aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--NEWS1
-rw-r--r--config.h.dist1
-rwxr-xr-xconfigure5
-rw-r--r--fm.h7
-rw-r--r--main.c29
-rw-r--r--rc.c19
7 files changed, 73 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 70d5c2c..32ca17e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
diff --git a/NEWS b/NEWS
index 03d09a9..b8144fd 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/configure b/configure
index 63dac5e..b30656d 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/fm.h b/fm.h
index fde478e..c65fc38 100644
--- a/fm.h
+++ b/fm.h
@@ -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
diff --git a/main.c b/main.c
index 9cdf538..ee4a5d9 100644
--- a/main.c
+++ b/main.c
@@ -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;
diff --git a/rc.c b/rc.c
index 31205ff..634e21d 100644
--- a/rc.c
+++ b/rc.c
@@ -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,