aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xBonus/google.cgi25
-rw-r--r--ChangeLog9
-rw-r--r--main.c31
3 files changed, 53 insertions, 12 deletions
diff --git a/Bonus/google.cgi b/Bonus/google.cgi
new file mode 100755
index 0000000..0016340
--- /dev/null
+++ b/Bonus/google.cgi
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+# ~/.w3m/urimethodmap
+# g: file:/cgi-bin/google.cgi?%s
+# google: file:/cgi-bin/google.cgi?%s
+
+$url = "http://www.google.com/";
+$_ = $ENV{"QUERY_STRING"};
+s@^g(oogle)?:@@ && s@^//@@ && s@/$@@;
+if ($_) {
+ s/\+/ /g;
+ s/%([\da-f][\da-f])/pack('C', hex($1))/egi;
+ s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg;
+ $url .= "search?q=$_&hl=ja&lr=lang_ja&ie=EUC-JP";
+} else {
+ $input = "w3m-control: GOTO_LINK";
+}
+print <<EOF;
+w3m-control: GOTO $url
+w3m-control: DELETE_PREVBUF
+w3m-control: SEARCH \\[
+w3m-control: MOVE_RIGHT
+${input}
+
+EOF
diff --git a/ChangeLog b/ChangeLog
index 30c888d..18221b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-01-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03625] keymap key SEARCH string
+ * main.c (srch): accept command argument
+ (reMark): accept command argument
+ * Bonus/google.cgi: added
+
+2003-01-11 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03622] Re: Error occured while reset
* file.c (uncompress_stream): child process initialized
* terms.c (close_tty): close unless stdin,out,err
@@ -6268,4 +6275,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.663 2003/01/10 16:16:44 ukai Exp $
+$Id: ChangeLog,v 1.664 2003/01/10 16:23:52 ukai Exp $
diff --git a/main.c b/main.c
index b1224d9..0821b80 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.187 2003/01/10 16:08:23 ukai Exp $ */
+/* $Id: main.c,v 1.188 2003/01/10 16:23:59 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -1651,19 +1651,25 @@ srch(int (*func) (Buffer *, char *), char *prompt)
{
char *str;
int result;
+ int disp = FALSE;
- str = inputStrHist(prompt, NULL, TextHist);
- if (str != NULL && *str == '\0')
- str = SearchString;
- if (str == NULL) {
- displayBuffer(Currentbuf, B_NORMAL);
- return;
+ str = searchKeyData();
+ if (str == NULL || *str == '\0') {
+ str = inputStrHist(prompt, NULL, TextHist);
+ if (str != NULL && *str == '\0')
+ str = SearchString;
+ if (str == NULL) {
+ displayBuffer(Currentbuf, B_NORMAL);
+ return;
+ }
+ disp = TRUE;
}
result = srchcore(str, func);
if (result & SR_FOUND)
clear_mark(Currentbuf->currentLine);
displayBuffer(Currentbuf, B_NORMAL);
- disp_srchresult(result, prompt, str);
+ if (disp)
+ disp_srchresult(result, prompt, str);
searchRoutine = func;
}
@@ -2634,10 +2640,13 @@ reMark(void)
if (!use_mark)
return;
- str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist);
+ str = searchKeyData();
if (str == NULL || *str == '\0') {
- displayBuffer(Currentbuf, B_NORMAL);
- return;
+ str = inputStrHist("(Mark)Regexp: ", MarkString, TextHist);
+ if (str == NULL || *str == '\0') {
+ displayBuffer(Currentbuf, B_NORMAL);
+ return;
+ }
}
if ((p = regexCompile(str, 1)) != NULL) {
disp_message(p, TRUE);