diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2004-03-23 16:44:02 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2004-03-23 16:44:02 +0000 |
commit | f8ca559c6413a56b778210efddb1d7b631636f09 (patch) | |
tree | de4964c95d84fbff081cbaa0297de7a68e2badf2 | |
parent | rc.c: cleanup LANG==JA (diff) | |
download | w3m-f8ca559c6413a56b778210efddb1d7b631636f09.tar.gz w3m-f8ca559c6413a56b778210efddb1d7b631636f09.zip |
fix search problem on different charset page than display charset
* proto.h (conv_search_string): added
* search.c (migemostr): use conv_search_string
(conv_search_string): added
* main.c (srchcore): use conv_search_string
(reMark): ditto
* menu.c (menu_search_forward): ditto
(menu_search_backward): ditto
(menu_search_next_previous): ditto
From: Fumitoshi UKAI <ukai@debian.or.jp>
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | main.c | 16 | ||||
-rw-r--r-- | menu.c | 21 | ||||
-rw-r--r-- | proto.h | 7 | ||||
-rw-r--r-- | search.c | 16 |
5 files changed, 41 insertions, 35 deletions
@@ -1,4 +1,16 @@ -2004-03-23 Fumitoshi UKAI <ukai@ukai.org> +2004-03-24 Fumitoshi UKAI <ukai@debian.or.jp> + + * fix search problem on different charset page than display charset + * proto.h (conv_search_string): added + * search.c (migemostr): use conv_search_string + (conv_search_string): added + * main.c (srchcore): use conv_search_string + (reMark): ditto + * menu.c (menu_search_forward): ditto + (menu_search_backward): ditto + (menu_search_next_previous): ditto + +2004-03-23 Fumitoshi UKAI <ukai@debian.or.jp> * rc.c: cleanup LANG == JA @@ -8355,4 +8367,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.913 2004/03/23 16:31:43 ukai Exp $ +$Id: ChangeLog,v 1.914 2004/03/23 16:44:02 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.240 2004/03/22 17:12:33 ukai Exp $ */ +/* $Id: main.c,v 1.241 2004/03/23 16:44:02 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -1604,13 +1604,7 @@ srchcore(char *volatile str, int (*func) (Buffer *, char *)) if (SearchString == NULL || *SearchString == '\0') return SR_NOTFOUND; -#ifdef USE_M17N - if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); - else -#endif - str = SearchString; + str = conv_search_string(SearchString, DisplayCharset); prevtrap = mySignal(SIGINT, intTrap); crmode(); if (SETJMP(IntReturn) == 0) { @@ -2707,11 +2701,7 @@ DEFUN(reMark, REG_MARK, "Set mark using regexp") return; } } -#ifdef USE_M17N - if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); -#endif + str = conv_search_string(str, DisplayCharset); if ((str = regexCompile(str, 1)) != NULL) { disp_message(str, TRUE); return; @@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.40 2003/09/26 20:45:53 ukai Exp $ */ +/* $Id: menu.c,v 1.41 2004/03/23 16:44:02 ukai Exp $ */ /* * w3m menu.c */ @@ -954,11 +954,7 @@ menu_search_forward(Menu *menu, int from) if (str == NULL || *str == '\0') return -1; SearchString = str; -#ifdef USE_M17N - if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); -#endif + str = conv_search_string(str, DisplayCharset); menuSearchRoutine = menuForwardSearch; found = menuForwardSearch(menu, str, from + 1); if (WrapSearch && found == -1) @@ -1008,11 +1004,7 @@ menu_search_backward(Menu *menu, int from) if (str == NULL || *str == '\0') return -1; SearchString = str; -#ifdef USE_M17N - if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); -#endif + str = conv_search_string(str, DisplayCharset); menuSearchRoutine = menuBackwardSearch; found = menuBackwardSearch(menu, str, from - 1); if (WrapSearch && found == -1) @@ -1045,12 +1037,7 @@ menu_search_next_previous(Menu *menu, int from, int reverse) disp_message("No previous regular expression", TRUE); return -1; } -#ifdef USE_M17N - str = SearchString; - if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); -#endif + str = conv_search_string(SearchString, DisplayCharset); if (reverse != 0) reverse = 1; if (menuSearchRoutine == menuBackwardSearch) @@ -1,4 +1,4 @@ -/* $Id: proto.h,v 1.97 2003/10/05 18:52:51 ukai Exp $ */ +/* $Id: proto.h,v 1.98 2004/03/23 16:44:02 ukai Exp $ */ /* * This file was automatically generated by version 1.7 of cextract. * Manual editing not recommended. @@ -336,6 +336,11 @@ extern Str correct_irrtag(int status); #ifdef USE_MIGEMO extern void init_migemo(void); #endif +#ifdef USE_M17N +extern char *conv_search_string(char *str, wc_ces f_ces); +#else +#define conv_search_string(str, f_ces) str +#endif extern int forwardSearch(Buffer *buf, char *str); extern int backwardSearch(Buffer *buf, char *str); extern void pcmap(void); @@ -1,4 +1,4 @@ -/* $Id: search.c,v 1.30 2003/09/22 21:02:21 ukai Exp $ */ +/* $Id: search.c,v 1.31 2004/03/23 16:44:02 ukai Exp $ */ #include "fm.h" #include "regex.h" #include <signal.h> @@ -72,7 +72,7 @@ migemostr(char *str) Strchop(tmp); if (tmp->length == 0) goto err; - return tmp->ptr; + return conv_search_string(tmp->ptr, SystemCharset); err: /* XXX: backend migemo is not working? */ init_migemo(); @@ -81,6 +81,18 @@ migemostr(char *str) } #endif /* USE_MIGEMO */ +#ifdef USE_M17N +/* normalize search string */ +char * +conv_search_string(char *str, wc_ces f_ces) +{ + if (SearchConv && !WcOption.pre_conv && + Currentbuf->document_charset != f_ces) + str = wtf_conv_fit(str, Currentbuf->document_charset); + return str; +} +#endif + int forwardSearch(Buffer *buf, char *str) { |