aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog19
-rw-r--r--fm.h3
-rw-r--r--linein.c15
-rw-r--r--main.c21
-rw-r--r--proto.h5
-rw-r--r--search.c14
6 files changed, 56 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 7427522..60be9fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2002-01-31 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 02946] toggle migemo
+ * fm.h (migemo_active): added
+ * proto.h (inputLineHistSearch): add arg `prop' to incrfunc()
+ * linein.c (inputLineHistSearch): ditto
+ * main.c (isrch): ditto
+ * main.c (dispincsrch): ditto
+ C-\ toggle migemo
+ underline when migemo is active
+ * search.c (migemo_active): deleted
+ * search.c (migemo_running): added
+ * search.c (init_migemo): migemo_running
+ * search.c (migemostr): ditto
+ * search.c (forwardSearch): migemo_active > 0
+ * search.c (backwardSearch): ditto
+
2002-01-31 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 02942] Digest qop=auth support
@@ -2440,4 +2457,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.279 2002/01/30 17:48:49 ukai Exp $
+$Id: ChangeLog,v 1.280 2002/01/31 03:55:35 ukai Exp $
diff --git a/fm.h b/fm.h
index e3577d6..f9a4070 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.44 2002/01/24 17:29:45 ukai Exp $ */
+/* $Id: fm.h,v 1.45 2002/01/31 03:55:35 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -782,6 +782,7 @@ global int DefaultURLString init(DEFAULT_URL_EMPTY);
#ifdef USE_MIGEMO
global int use_migemo init(FALSE);
+global int migemo_active init(0);
global char *migemo_command init(DEF_MIGEMO_COMMAND);
#endif /* USE_MIGEMO */
diff --git a/linein.c b/linein.c
index a2c03d9..327f9a5 100644
--- a/linein.c
+++ b/linein.c
@@ -1,4 +1,4 @@
-/* $Id: linein.c,v 1.21 2002/01/22 10:45:14 ukai Exp $ */
+/* $Id: linein.c,v 1.22 2002/01/31 03:55:35 ukai Exp $ */
#include "fm.h"
#include "local.h"
#include "myctype.h"
@@ -82,7 +82,7 @@ static void ins_kanji(Str tmp);
char *
inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
- int (*incrfunc) (int ch, Str str))
+ int (*incrfunc) (int ch, Str str, Lineprop *prop))
{
int opos, x, y, lpos, rpos, epos;
unsigned char c;
@@ -192,7 +192,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
InnerCode);
ins_kanji(tmp);
if (incrfunc)
- incrfunc(-1, strBuf);
+ incrfunc(-1, strBuf, strProp);
}
else
#endif
@@ -229,10 +229,11 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
cm_disp_next = -1;
}
else if (!i_quote && c < 0x20) { /* Control code */
- if (incrfunc == NULL || (c = incrfunc((int)c, strBuf)) < 0x20)
+ if (incrfunc == NULL
+ || (c = incrfunc((int)c, strBuf, strProp)) < 0x20)
(*InputKeymap[(int)c]) (c);
if (incrfunc)
- incrfunc(-1, strBuf);
+ incrfunc(-1, strBuf, strProp);
if (cm_clear)
cm_next = FALSE;
if (cm_disp_clear)
@@ -249,7 +250,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
tmp = conv_str(tmp, DisplayCode, InnerCode);
ins_kanji(tmp);
if (incrfunc)
- incrfunc(-1, strBuf);
+ incrfunc(-1, strBuf, strProp);
}
else if ((c & 0x80) || in_kanji) { /* Kanji 1 */
i_quote = FALSE;
@@ -278,7 +279,7 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist,
CPos++;
mode = PC_ASCII;
if (incrfunc)
- incrfunc(-1, strBuf);
+ incrfunc(-1, strBuf, strProp);
}
if (CLen && (flag & IN_CHAR))
break;
diff --git a/main.c b/main.c
index 627d89f..fcebbce 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.74 2002/01/30 15:08:48 ukai Exp $ */
+/* $Id: main.c,v 1.75 2002/01/31 03:55:35 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -1401,7 +1401,7 @@ disp_srchresult(int result, char *prompt, char *str)
}
static int
-dispincsrch(int ch, Str buf)
+dispincsrch(int ch, Str buf, Lineprop *prop)
{
static Buffer sbuf;
static Line *currentLine;
@@ -1426,6 +1426,11 @@ dispincsrch(int ch, Str buf)
searchRoutine = forwardSearch;
do_next_search = TRUE;
break;
+
+ case 034:
+ migemo_active = -migemo_active;
+ goto done;
+
default:
if (ch >= 0)
return ch; /* use InputKeymap */
@@ -1459,6 +1464,16 @@ dispincsrch(int ch, Str buf)
}
displayBuffer(Currentbuf, B_FORCE_REDRAW);
clear_mark(Currentbuf->currentLine);
+ done:
+ {
+ int i;
+ for (i = 0; str[i] != '\0'; i++) {
+ if (migemo_active > 0)
+ prop[i] |= PE_UNDER;
+ else
+ prop[i] &= ~PE_UNDER;
+ }
+ }
return -1;
}
@@ -1468,7 +1483,7 @@ isrch(int (*func) (Buffer *, char *), char *prompt)
char *str;
Buffer sbuf;
SAVE_BUFPOSITION(&sbuf);
- dispincsrch(0, NULL); /* initialize incremental search state */
+ dispincsrch(0, NULL, NULL); /* initialize incremental search state */
searchRoutine = func;
str = inputLineHistSearch(prompt, NULL, IN_STRING, TextHist, dispincsrch);
diff --git a/proto.h b/proto.h
index 788c896..9e9ee17 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.31 2002/01/30 15:08:48 ukai Exp $ */
+/* $Id: proto.h,v 1.32 2002/01/31 03:55:35 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -268,7 +268,8 @@ extern void escmap(void);
extern void escbmap(void);
extern void escdmap(char c);
extern char *inputLineHistSearch(char *prompt, char *def_str, int flag,
- Hist *hist, int (*incfunc) (int ch, Str buf));
+ Hist *hist, int (*incfunc) (int ch, Str buf,
+ Lineprop *prop));
#ifdef USE_HISTORY
extern Buffer *historyBuffer(Hist *hist);
extern void loadHistory(Hist *hist);
diff --git a/search.c b/search.c
index 8a0c65b..1e5ce0b 100644
--- a/search.c
+++ b/search.c
@@ -1,4 +1,4 @@
-/* $Id: search.c,v 1.17 2002/01/21 17:57:28 ukai Exp $ */
+/* $Id: search.c,v 1.18 2002/01/31 03:55:35 ukai Exp $ */
#include "fm.h"
#include "regex.h"
#include <signal.h>
@@ -15,13 +15,13 @@ set_mark(Line *l, int pos, int epos)
#ifdef USE_MIGEMO
/* Migemo: romaji --> kana+kanji in regexp */
static FILE *migemor, *migemow;
-static int migemo_active;
+static int migemo_running;
static int migemo_pid;
void
init_migemo()
{
- migemo_active = use_migemo;
+ migemo_active = migemo_running = use_migemo;
if (migemor != NULL)
fclose(migemor);
if (migemow != NULL)
@@ -75,7 +75,7 @@ open_migemo(char *migemo_command)
close(fdr[0]);
close(fdr[1]);
err0:
- migemo_active = 0;
+ migemo_active = migemo_running = 0;
return 0;
}
@@ -104,7 +104,7 @@ migemostr(char *str)
err:
/* XXX: backend migemo is not working? */
init_migemo();
- migemo_active = 0;
+ migemo_active = migemo_running = 0;
return str;
}
#endif /* USE_MIGEMO */
@@ -118,7 +118,7 @@ forwardSearch(Buffer *buf, char *str)
int pos;
#ifdef USE_MIGEMO
- if (migemo_active) {
+ if (migemo_active > 0) {
if (((p = regexCompile(migemostr(str), IgnoreCase)) != NULL)
&& ((p = regexCompile(str, IgnoreCase)) != NULL)) {
message(p, 0, 0);
@@ -196,7 +196,7 @@ backwardSearch(Buffer *buf, char *str)
int pos;
#ifdef USE_MIGEMO
- if (migemo_active) {
+ if (migemo_active > 0) {
if (((p = regexCompile(migemostr(str), IgnoreCase)) != NULL)
&& ((p = regexCompile(str, IgnoreCase)) != NULL)) {
message(p, 0, 0);