共通の下位ディレクトリー: /tmp/w3m/Bonusと/m/home/rubikitch/src/w3m/Bonus
共通の下位ディレクトリー: /tmp/w3m/CVSと/m/home/rubikitch/src/w3m/CVS
/m/home/rubikitch/src/w3mだけに発見: GPATH
/m/home/rubikitch/src/w3mだけに発見: GRTAGS
/m/home/rubikitch/src/w3mだけに発見: GSYMS
/m/home/rubikitch/src/w3mだけに発見: GTAGS
共通の下位ディレクトリー: /tmp/w3m/Patchesと/m/home/rubikitch/src/w3m/Patches
共通の下位ディレクトリー: /tmp/w3m/Symbolsと/m/home/rubikitch/src/w3m/Symbols
diff -u /tmp/w3m/config.h.in /m/home/rubikitch/src/w3m/config.h.in
--- /tmp/w3m/config.h.in	2007-05-24 00:06:05.000000000 +0900
+++ /m/home/rubikitch/src/w3m/config.h.in	2007-10-23 08:35:25.000000000 +0900
@@ -16,7 +16,7 @@
 #define XFACE2XPM    "xface2xpm"
 
 #define BOOKMARK     "bookmark.html"
-#define CONFIG_FILE  "config"
+#define CONFIG_FILE  "config052"
 #define KEYMAP_FILE  "keymap"
 #define MENU_FILE    "menu"
 #define MOUSE_FILE   "mouse"
@@ -42,6 +42,8 @@
 #undef USE_UNICODE
 #define W3M_LANG @W3M_LANG@
 #define LANG W3M_LANG
+#define USE_BUFINFO 1
+#define USE_SCREEN 1
 
 /* Define to 1 if translation of program messages to the user's
    native language is requested. */
diff -u /tmp/w3m/cookie.c /m/home/rubikitch/src/w3m/cookie.c
--- /tmp/w3m/cookie.c	2006-12-10 19:53:22.000000000 +0900
+++ /m/home/rubikitch/src/w3m/cookie.c	2007-10-23 08:35:25.000000000 +0900
@@ -72,12 +72,25 @@
 	else if (domain[0] == '.' && strcasecmp(host, &domain[1]) == 0) {
 	    return host;
 	}
+        /* [w3m-dev 04157] */
+        else if (domain[0] == '.' && strcasecmp(host, &domain[1]) == 0) {
+            return host;
+        }
 	/* [RFC 2109] s. 2, cases 2, 3 */
 	else {
 	    offset = (domain[0] != '.') ? 0 : strlen(host) - strlen(domain);
 	    domain_p = &host[offset];
+            if (w3m_debug)
+                fprintf(stderr, "domain_match: [RFC 2109] s. 2, cases 2, 3: offset=%d domain_p=%s\n", offset, domain_p);
 	    if (offset >= 0 && strcasecmp(domain_p, domain) == 0)
 		return domain_p;
+            else if (offset == -1) {
+                domain_p = &domain[1];
+                if (w3m_debug)
+                    fprintf(stderr, "domain_match: [RFC 2109] s. 2, cases 2, 3: offset=%d domain_p=%s\n", offset, domain_p);
+                if (strcasecmp(host, domain_p) == 0)
+                    return &domain[1];
+            }
 	}
     }
     return NULL;
@@ -270,18 +283,18 @@
 
 #define COOKIE_ERROR(err) if(!((err) & COO_OVERRIDE_OK) || use_security) return (err)
 
-#ifdef DEBUG
-    fprintf(stderr, "host: [%s, %s] %d\n", pu->host, pu->file, flag);
-    fprintf(stderr, "cookie: [%s=%s]\n", name->ptr, value->ptr);
-    fprintf(stderr, "expires: [%s]\n", asctime(gmtime(&expires)));
-    if (domain)
-	fprintf(stderr, "domain: [%s]\n", domain->ptr);
-    if (path)
-	fprintf(stderr, "path: [%s]\n", path->ptr);
-    fprintf(stderr, "version: [%d]\n", version);
-    if (port)
-	fprintf(stderr, "port: [%s]\n", port->ptr);
-#endif				/* DEBUG */
+    if (w3m_debug) {
+        fprintf(stderr, "host: [%s, %s] %d\n", pu->host, pu->file, flag);
+        fprintf(stderr, "cookie: [%s=%s]\n", name->ptr, value->ptr);
+        fprintf(stderr, "expires: [%s]\n", asctime(gmtime(&expires)));
+        if (domain)
+            fprintf(stderr, "domain: [%s]\n", domain->ptr);
+        if (path)
+            fprintf(stderr, "path: [%s]\n", path->ptr);
+        fprintf(stderr, "version: [%d]\n", version);
+        if (port)
+            fprintf(stderr, "port: [%s]\n", port->ptr);
+    }
     /* [RFC 2109] s. 4.3.2 case 2; but this (no request-host) shouldn't happen */
     if (!domainname)
 	return COO_ENODOT;
@@ -304,6 +317,8 @@
 				     domain->ptr + domain->length,
 				     3);
 	    if (n < 2) {
+                if (w3m_debug)
+                    fprintf(stderr, "COOKIE_ERROR: dot_number=%d\n", n);
 		COOKIE_ERROR(COO_ESPECIAL);
 	    }
 	    else if (n == 2) {
@@ -315,35 +330,53 @@
 			strcasecmp(*sdomain, &domain->ptr[offset]) == 0)
 			ok = 1;
 		}
-		if (!ok)
+		if (!ok) {
+                    if (w3m_debug)
+                        fprintf(stderr, "COOKIE_ERROR: domain\n");
 		    COOKIE_ERROR(COO_ESPECIAL);
+                }
 	    }
 	}
 	else {
 	    /* [DRAFT 12] s. 4.3.2 case 2 */
 	    if (strcasecmp(domain->ptr, ".local") != 0 &&
-		contain_no_dots(&domain->ptr[1], &domain->ptr[domain->length]))
+		contain_no_dots(&domain->ptr[1], &domain->ptr[domain->length])) {
+                if (w3m_debug)
+                    fprintf(stderr, "COOKIE_ERROR: [DRAFT 12] s. 4.3.2 case 2\n");
 		COOKIE_ERROR(COO_ENODOT);
+            }
 	}
 
 	/* [RFC 2109] s. 4.3.2 case 3 */
-	if (!(dp = domain_match(domainname, domain->ptr)))
+	if (!(dp = domain_match(domainname, domain->ptr))) {
+            if (w3m_debug)
+                fprintf(stderr, "COOKIE_ERROR: [RFC 2109] s. 4.3.2 case 3: domainname=%s domain->ptr=%s\n", domainname, domain->ptr);
 	    COOKIE_ERROR(COO_EDOM);
+        }
 	/* [RFC 2409] s. 4.3.2 case 4 */
 	/* Invariant: dp contains matched domain */
-	if (version > 0 && !contain_no_dots(domainname, dp))
+	if (version > 0 && !contain_no_dots(domainname, dp)) {
+            if (w3m_debug)
+                fprintf(stderr, "COOKIE_ERROR: [RFC 2109] s. 4.3.2 case 4\n");
 	    COOKIE_ERROR(COO_EBADHOST);
+        }
     }
     if (path) {
 	/* [RFC 2109] s. 4.3.2 case 1 */
-	if (version > 0 && strncmp(path->ptr, pu->file, path->length) != 0)
+	if (version > 0 && strncmp(path->ptr, pu->file, path->length) != 0) {
+            if (w3m_debug)
+                fprintf(stderr, "COOKIE_ERROR: [RFC 2109] s. 4.3.2 case 1\n");
 	    COOKIE_ERROR(COO_EPATH);
+        }
     }
     if (port) {
 	/* [DRAFT 12] s. 4.3.2 case 5 */
 	portlist = make_portlist(port);
-	if (portlist && !port_match(portlist, pu->port))
+	if (portlist && !port_match(portlist, pu->port)) {
+            if (w3m_debug)
+                fprintf(stderr, "COOKIE_ERROR: [DRAFT 12] s. 4.3.2 case 5\n");
 	    COOKIE_ERROR(COO_EPORT);
+        }
     }
 
     if (!domain)
diff -u /tmp/w3m/display.c /m/home/rubikitch/src/w3m/display.c
--- /tmp/w3m/display.c	2007-05-29 21:07:02.000000000 +0900
+++ /m/home/rubikitch/src/w3m/display.c	2007-10-23 08:35:25.000000000 +0900
@@ -17,6 +17,8 @@
 #define EFFECT_VISITED_END        effect_visited_end()
 #define EFFECT_MARK_START         effect_mark_start()
 #define EFFECT_MARK_END           effect_mark_end()
+#define EFFECT_HL_LINE_START      effect_hl_line_start()
+#define EFFECT_HL_LINE_END        effect_hl_line_end()
 
 /*-
  * color: 
@@ -40,6 +42,7 @@
 #else
 #define EFFECT_MARK_START_C         standout()
 #endif
+#define EFFECT_HL_LINE_START_C      underline()
 
 #define EFFECT_IMAGE_END_C          setfcolor(basic_color)
 #define EFFECT_ANCHOR_END_C         setfcolor(basic_color)
@@ -51,6 +54,7 @@
 #else
 #define EFFECT_MARK_END_C           standend()
 #endif
+#define EFFECT_HL_LINE_END_C        underlineend()
 
 #define EFFECT_ANCHOR_START_M       underline()
 #define EFFECT_ANCHOR_END_M         underlineend()
@@ -66,6 +70,8 @@
 #define EFFECT_VISITED_END_M /**/
 #define EFFECT_MARK_START_M         standout()
 #define EFFECT_MARK_END_M           standend()
+#define EFFECT_HL_LINE_START_M      underline()
+#define EFFECT_HL_LINE_END_M        underlineend()
 #define define_effect(name_start,name_end,color_start,color_end,mono_start,mono_end) \
 static void name_start { if (useColor) { color_start; } else { mono_start; }}\
 static void name_end { if (useColor) { color_end; } else { mono_end; }}
@@ -78,6 +84,8 @@
 	      EFFECT_FORM_END_C, EFFECT_FORM_START_M, EFFECT_FORM_END_M)
 define_effect(EFFECT_MARK_START, EFFECT_MARK_END, EFFECT_MARK_START_C,
 	      EFFECT_MARK_END_C, EFFECT_MARK_START_M, EFFECT_MARK_END_M)
+define_effect(EFFECT_HL_LINE_START, EFFECT_HL_LINE_END, EFFECT_HL_LINE_START_C,
+              EFFECT_HL_LINE_END_C, EFFECT_HL_LINE_START_M, EFFECT_HL_LINE_END_M)
 
 /*****************/
 static void
@@ -153,6 +161,8 @@
 #define EFFECT_VISITED_END /**/
 #define EFFECT_MARK_START         standout()
 #define EFFECT_MARK_END           standend()
+#define EFFECT_HL_LINE_START      underline()
+#define EFFECT_HL_LINE_END        underlineend()
 #endif				/* not USE_COLOR */
 /* *INDENT-ON* */
 
@@ -363,12 +373,31 @@
     return msg;
 }
 
+static void
+redrawCurrentLine(Buffer *buf)
+{
+    if (buf && buf->currentLine)
+        redrawLine(buf, buf->currentLine, buf->currentLine->linenumber - buf->topLine->linenumber + LastTab->y+2 );
+    return;
+}
+
+void
+redrawCurrentLineIfNeeded(Buffer *buf)
+{
+    if (hl_line) redrawCurrentLine(buf);
+    return;
+}
+
+extern void setRedrawImageEventvoid(void);
+
 void
 displayBuffer(Buffer *buf, int mode)
 {
     Str msg;
     int ny = 0;
 
+    if (NoRedraw)
+        return;
     if (!buf)
 	return;
     if (buf->topLine == NULL && readBufferCache(buf) == 0) {	/* clear_buffer */
@@ -470,6 +499,11 @@
 #endif
 
     drawAnchorCursor(buf);
+    if (hl_line) {
+        EFFECT_HL_LINE_START;
+        redrawCurrentLine(buf);
+        EFFECT_HL_LINE_END;
+    }
 
     msg = make_lastline_message(buf);
     if (buf->firstLine == NULL) {
@@ -497,6 +531,8 @@
 	save_current_buf = buf;
     }
 #endif
+    if (mode == B_FORCE_REDRAW || mode == B_REDRAW_IMAGE)
+        setRedrawImageEvent();
 }
 
 static void
@@ -1044,6 +1080,7 @@
 	       EFFECT_VISITED_END);
     do_effect2(PE_ACTIVE, active_mode, EFFECT_ACTIVE_START, EFFECT_ACTIVE_END);
     do_effect2(PE_MARK, mark_mode, EFFECT_MARK_START, EFFECT_MARK_END);
+    do_effect2(PE_SMARK, mark_mode, EFFECT_MARK_START, EFFECT_MARK_END);
     if (graph_mode) {
 	graphend();
 	graph_mode = FALSE;
@@ -1061,6 +1098,7 @@
 	       EFFECT_VISITED_END);
     do_effect1(PE_ACTIVE, active_mode, EFFECT_ACTIVE_START, EFFECT_ACTIVE_END);
     do_effect1(PE_MARK, mark_mode, EFFECT_MARK_START, EFFECT_MARK_END);
+    do_effect1(PE_SMARK, mark_mode, EFFECT_MARK_START, EFFECT_MARK_END);
 }
 
 #ifdef USE_ANSI_COLOR
/m/home/rubikitch/src/w3mだけに発見: display.c.orig
/m/home/rubikitch/src/w3mだけに発見: display.c.rej
共通の下位ディレクトリー: /tmp/w3m/docと/m/home/rubikitch/src/w3m/doc
共通の下位ディレクトリー: /tmp/w3m/doc-jpと/m/home/rubikitch/src/w3m/doc-jp
diff -u /tmp/w3m/file.c /m/home/rubikitch/src/w3m/file.c
--- /tmp/w3m/file.c	2007-05-24 00:06:05.000000000 +0900
+++ /m/home/rubikitch/src/w3m/file.c	2007-10-23 08:35:25.000000000 +0900
@@ -842,7 +842,7 @@
 		    else
 		        disp_message_nsec(Sprintf("Received cookie: %s=%s",
 					      name->ptr, value->ptr)->ptr,
-				      FALSE, 1, TRUE, FALSE);
+				      FALSE, 0, TRUE, FALSE);
 		}
 		err =
 		    add_cookie(pu, name, value, expires, domain, path, flag,
@@ -1710,6 +1710,8 @@
     HRequest hr;
     ParsedURL *volatile auth_pu;
 
+    int implicit_label = FALSE;
+
     tpath = path;
     prevtrap = NULL;
     add_auth_cookie_flag = 0;
@@ -1768,9 +1770,12 @@
 #ifdef USE_EXTERNAL_URI_LOADER
 	    tmp = searchURIMethods(&pu);
 	    if (tmp != NULL) {
+                //            fprintf(stderr, "uri=%s\n", tmp->ptr);
 		b = loadGeneralFile(tmp->ptr, current, referer, flag, request);
+#if 0
 		if (b != NULL && b != NO_BUFFER)
 		    copyParsedURL(&b->currentURL, &pu);
+#endif
 		return b;
 	    }
 #endif
@@ -1848,6 +1853,7 @@
 	    /* 302: Found */
 	    /* 303: See Other */
 	    /* 307: Temporary Redirect (HTTP/1.1) */
+            //            fprintf(stderr, "p=%s\n", p);
 	    tpath = url_quote_conv(p, DocumentCharset);
 	    request = NULL;
 	    UFclose(&f);
@@ -2006,12 +2012,14 @@
 	if (f.is_cgi && (p = checkHeader(t_buf, "Location:")) != NULL &&
 	    checkRedirection(&pu)) {
 	    /* document moved */
+            //            fprintf(stderr, "p[searchHeader]=%s\n", p);
 	    tpath = url_quote_conv(remove_space(p), DocumentCharset);
 	    request = NULL;
 	    UFclose(&f);
 	    add_auth_cookie_flag = 0;
 	    current = New(ParsedURL);
 	    copyParsedURL(current, &pu);
+            //            fprintf(stderr, "pu.host=%s pu.file=%s\n", pu.host, pu.file);
 	    t_buf = newBuffer(INIT_BUFFER_WIDTH);
 	    t_buf->bufferprop |= BP_REDIRECTED;
 	    status = HTST_NORMAL;
@@ -2242,6 +2250,11 @@
 #endif
 	else
 	    b->type = "text/plain";
+        if (!pu.label && proc == loadHTMLBuffer) {
+            /* implicit label trick */
+            pu.label = Strnew_charp("__w3m__")->ptr;
+            implicit_label = TRUE;
+        }
 	if (pu.label) {
 	    if (proc == loadHTMLBuffer) {
 		Anchor *a;
@@ -2263,6 +2276,8 @@
 		arrangeCursor(b);
 	    }
 	}
+        if (implicit_label)
+            pu.label = NULL;
     }
     if (header_string)
 	header_string = NULL;
@@ -2753,6 +2768,12 @@
 		hidden = hidden_italic;
 	}
     }
+    if (obuf->in_italic) {
+	if ((hidden_italic = has_hidden_link(obuf, HTML_I)) != NULL) {
+	    if (!hidden || hidden_italic < hidden)
+		hidden = hidden_italic;
+	}
+    }
     if (obuf->in_under) {
 	if ((hidden_under = has_hidden_link(obuf, HTML_U)) != NULL) {
 	    if (!hidden || hidden_under < hidden)
@@ -4370,17 +4391,37 @@
 	flushline(h_env, obuf, envs[h_env->envc].indent, 1, h_env->limit);
 	h_env->blank_lines = 0;
 	return 1;
-    case HTML_H:
+    case HTML_H1:
+    case HTML_H2:
+    case HTML_H3:
+    case HTML_H4:
+    case HTML_H5:
+    case HTML_H6:
 	if (!(obuf->flag & (RB_PREMODE | RB_IGNORE_P))) {
 	    flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
 	    do_blankline(h_env, obuf, envs[h_env->envc].indent, 0,
 			 h_env->limit);
 	}
+        if(cmd == HTML_H1)
+            HTMLlineproc1("<u>", h_env);
 	HTMLlineproc1("<b>", h_env);
+        {
+            int i;
+            for(i=0;i<=cmd-HTML_H1;i++)
+                HTMLlineproc1("=", h_env);
+            HTMLlineproc1(" ", h_env);
+        }
 	set_alignment(obuf, tag);
 	return 1;
-    case HTML_N_H:
+    case HTML_N_H1:
+    case HTML_N_H2:
+    case HTML_N_H3:
+    case HTML_N_H4:
+    case HTML_N_H5:
+    case HTML_N_H6:
 	HTMLlineproc1("</b>", h_env);
+        if(cmd == HTML_N_H1)
+            HTMLlineproc1("</u>", h_env);
 	if (!(obuf->flag & RB_PREMODE)) {
 	    flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
 	}
@@ -5184,6 +5225,21 @@
 	    }
 	}
 	return 1;
+    case HTML_IFRAME:
+        if (view_unseenobject) {
+            if (parsedtag_get_value(tag, ATTR_SRC, &p)) {
+                Str s;
+                q = html_quote(p);
+                s = Sprintf("<A HREF=\"%s\">iframe(%s)</A>", q, q);
+                HTMLlineproc1(s->ptr, h_env);
+            }
+        }
+        return 1;
+    case HTML_OBJECT:
+        if (view_unseenobject) {
+            HTMLlineproc1("[object]", h_env);
+        }
+        return 1;
     case HTML_BODY:
 	if (view_unseenobject) {
 	    if (parsedtag_get_value(tag, ATTR_BACKGROUND, &p)) {
@@ -6745,6 +6801,10 @@
 	push_tag(obuf, "</i>", HTML_N_I);
 	obuf->in_italic = 0;
     }
+    if (obuf->in_italic) {
+	push_tag(obuf, "</i>", HTML_N_I);
+	obuf->in_italic = 0;
+    }
     if (obuf->in_under) {
 	push_tag(obuf, "</u>", HTML_N_U);
 	obuf->in_under = 0;
@@ -7453,7 +7513,7 @@
     buf = loadcmdout(cmd, loadBuffer, NULL);
     if (buf == NULL)
 	return NULL;
-    buf->filename = cmd;
+    buf->filename = CurrentDir;
     buf->buffername = Sprintf("%s %s", SHELLBUFFERNAME,
 			      conv_from_system(cmd))->ptr;
     return buf;
@@ -7475,7 +7535,7 @@
 	return NULL;
     buf = newBuffer(INIT_BUFFER_WIDTH);
     buf->pagerSource = newFileStream(f, (void (*)())pclose);
-    buf->filename = cmd;
+    buf->filename = CurrentDir;
     buf->buffername = Sprintf("%s %s", PIPEBUFFERNAME,
 			      conv_from_system(cmd))->ptr;
     buf->bufferprop |= BP_PIPE;
@@ -7906,6 +7966,21 @@
     return 0;
 }
 
+char *
+downloadPath(char *name)
+{
+    if (download_dir == NULL || *download_dir == '\0' || *name == '/' || *name == '~')
+        return name;
+    else
+    	return Strnew_m_charp(download_dir, "/", name, NULL)->ptr;
+}
+
+char *
+downloadDir()
+{
+    return (*download_dir) ? download_dir : CurrentDir;
+}
+
 int
 _doFileCopy(char *tmpf, char *defstr, int download)
 {
@@ -7926,7 +8001,7 @@
 	p = searchKeyData();
 	if (p == NULL || *p == '\0') {
 	    /* FIXME: gettextize? */
-	    q = inputLineHist("(Download)Save file to: ",
+	    q = inputLineHist(Sprintf("(Download)Save file to[%s]: ", downloadDir())->ptr,
 			      defstr, IN_COMMAND, SaveHist);
 	    if (q == NULL || *q == '\0')
 		return FALSE;
@@ -7939,6 +8014,7 @@
 		p = unescape_spaces(Strnew_charp(q))->ptr;
 		p = conv_to_system(q);
 	    }
+            p = downloadPath(p);
 	    p = expandPath(p);
 	    if (checkOverWrite(p) < 0)
 		return -1;
@@ -7984,7 +8060,7 @@
 	q = searchKeyData();
 	if (q == NULL || *q == '\0') {
 	    /* FIXME: gettextize? */
-	    printf("(Download)Save file to: ");
+	    printf(Sprintf("(Download)Save file to[%s]: ", downloadDir())->ptr);
 	    fflush(stdout);
 	    filen = Strfgets(stdin);
 	    if (filen->length == 0)
@@ -7999,6 +8075,7 @@
 	if (*p == '|' && PermitSaveToPipe)
 	    is_pipe = TRUE;
 	else {
+            p = downloadPath(p);
 	    p = expandPath(p);
 	    if (checkOverWrite(p) < 0)
 		return -1;
@@ -8046,12 +8123,14 @@
 	p = searchKeyData();
 	if (p == NULL || *p == '\0') {
 	    /* FIXME: gettextize? */
-	    p = inputLineHist("(Download)Save file to: ",
+	    p = inputLineHist(Sprintf("(Download)Save file to[%s]: ", downloadDir())->ptr,
 			      defstr, IN_FILENAME, SaveHist);
 	    if (p == NULL || *p == '\0')
 		return -1;
 	    p = conv_to_system(p);
 	}
+        p = downloadPath(p);
+        p = expandPath(p);
 	if (checkOverWrite(p) < 0)
 	    return -1;
 	if (checkSaveFile(uf.stream, p) < 0) {
@@ -8096,7 +8175,7 @@
 	q = searchKeyData();
 	if (q == NULL || *q == '\0') {
 	    /* FIXME: gettextize? */
-	    printf("(Download)Save file to: ");
+	    printf(Sprintf("(Download)Save file to[%s]: ", downloadDir())->ptr);
 	    fflush(stdout);
 	    filen = Strfgets(stdin);
 	    if (filen->length == 0)
@@ -8107,6 +8186,7 @@
 	*(p + 1) = '\0';
 	if (*q == '\0')
 	    return -1;
+        q = downloadPath(q);
 	p = expandPath(q);
 	if (checkOverWrite(p) < 0)
 	    return -1;
@@ -8169,8 +8249,10 @@
 
     if (stat(path, &st) < 0)
 	return 0;
+    if (path[0] != '/' && path[0] != '~')
+	path = Strnew_m_charp(CurrentDir, "/", path, NULL)->ptr;
     /* FIXME: gettextize? */
-    ans = inputAnswer("File exists. Overwrite? (y/n)");
+    ans = inputAnswer(Sprintf("%s exists. Overwrite? (y/n)",path)->ptr);
     if (ans && TOLOWER(*ans) == 'y')
 	return 0;
     else
diff -u /tmp/w3m/fm.h /m/home/rubikitch/src/w3m/fm.h
--- /tmp/w3m/fm.h	2007-05-30 13:47:24.000000000 +0900
+++ /m/home/rubikitch/src/w3m/fm.h	2007-10-23 08:35:25.000000000 +0900
@@ -164,6 +164,7 @@
 #define PE_IMAGE        0x20
 #define PE_FORM         0x40
 #define PE_ACTIVE	0x80
+#define PE_SMARK        0x00    /* FIXME */
 #define PE_VISITED	0x4000
 
 /* Extra effect */
@@ -867,6 +868,7 @@
 global char *personal_document_root init(NULL);
 global char *cgi_bin init(NULL);
 global char *index_file init(NULL);
+global char *download_dir init(NULL);
 
 global char *CurrentDir;
 global int CurrentPid;
@@ -1021,6 +1023,7 @@
 extern Hist *URLHist;
 extern Hist *ShellHist;
 extern Hist *TextHist;
+extern Hist *CommandHist;
 #ifdef USE_HISTORY
 global int UseHistory init(TRUE);
 global int URLHistSize init(100);
@@ -1134,10 +1137,10 @@
 global int is_redisplay init(FALSE);
 global int clear_buffer init(TRUE);
 global double pixel_per_char init(DEFAULT_PIXEL_PER_CHAR);
-global int set_pixel_per_char init(FALSE);
+global int set_pixel_per_char init(TRUE);
 #ifdef USE_IMAGE
 global double pixel_per_line init(DEFAULT_PIXEL_PER_LINE);
-global int set_pixel_per_line init(FALSE);
+global int set_pixel_per_line init(TRUE);
 global double image_scale init(100);
 #endif
 global int use_lessopen init(FALSE);
@@ -1167,6 +1170,8 @@
 extern void deleteFiles(void);
 void w3m_exit(int i);
 
+global char hl_line init(FALSE);
+
 #ifdef USE_ALARM
 #define AL_UNSET         0
 #define AL_EXPLICIT      1
@@ -1174,6 +1179,7 @@
 #define AL_IMPLICIT_ONCE 3
 
 typedef struct _AlarmEvent {
+    int usec;
     int sec;
     short status;
     int cmd;
@@ -1181,6 +1187,8 @@
 } AlarmEvent;
 #endif
 
+global int NoRedraw init(FALSE);
+
 /* 
  * Externals
  */
共通の下位ディレクトリー: /tmp/w3m/gcと/m/home/rubikitch/src/w3m/gc
diff -u /tmp/w3m/html.c /m/home/rubikitch/src/w3m/html.c
--- /tmp/w3m/html.c	2007-04-19 21:00:38.000000000 +0900
+++ /m/home/rubikitch/src/w3m/html.c	2007-10-23 08:35:25.000000000 +0900
@@ -89,6 +89,9 @@
 unsigned char ALST_EMBED[] = { ATTR_SRC, ATTR_CORE };
 #define MAX_EMBED	MAXA_CORE + 1
 
+unsigned char ALST_IFRAME[] = { ATTR_SRC, ATTR_CORE };
+#define MAXA_IFRAME    MAXA_CORE + 1
+
 unsigned char ALST_TEXTAREA_INT[] = { ATTR_TEXTAREANUMBER };
 #define MAXA_TEXTAREA_INT 1
 unsigned char ALST_SELECT_INT[] = { ATTR_SELECTNUMBER };
@@ -124,151 +127,161 @@
     {NULL, NULL, 0, 0},		/*   0 HTML_UNKNOWN    */
     {"a", ALST_A, MAXA_A, 0},	/*   1 HTML_A          */
     {"/a", NULL, 0, TFLG_END},	/*   2 HTML_N_A        */
-    {"h", ALST_P, MAXA_P, 0},	/*   3 HTML_H          */
-    {"/h", NULL, 0, TFLG_END},	/*   4 HTML_N_H        */
-    {"p", ALST_P, MAXA_P, 0},	/*   5 HTML_P          */
-    {"br", NULL, 0, 0},		/*   6 HTML_BR         */
-    {"b", NULL, 0, 0},		/*   7 HTML_B          */
-    {"/b", NULL, 0, TFLG_END},	/*   8 HTML_N_B        */
-    {"ul", ALST_UL, MAXA_UL, 0},	/*   9 HTML_UL         */
-    {"/ul", NULL, 0, TFLG_END},	/*  10 HTML_N_UL       */
-    {"li", ALST_LI, MAXA_LI, 0},	/*  11 HTML_LI         */
-    {"ol", ALST_UL, MAXA_UL, 0},	/*  12 HTML_OL         */
-    {"/ol", NULL, 0, TFLG_END},	/*  13 HTML_N_OL       */
-    {"title", NULL, 0, 0},	/*  14 HTML_TITLE      */
-    {"/title", NULL, 0, TFLG_END},	/*  15 HTML_N_TITLE    */
-    {"hr", ALST_HR, MAXA_HR, 0},	/*  16 HTML_HR         */
-    {"dl", ALST_DL, MAXA_DL, 0},	/*  17 HTML_DL         */
-    {"/dl", NULL, 0, TFLG_END},	/*  18 HTML_N_DL       */
-    {"dt", ALST_NOP, MAXA_NOP, 0},	/*  19 HTML_DT         */
-    {"dd", ALST_NOP, MAXA_NOP, 0},	/*  20 HTML_DD         */
-    {"pre", ALST_PRE, MAXA_PRE, 0},	/*  21 HTML_PRE        */
-    {"/pre", NULL, 0, TFLG_END},	/*  22 HTML_N_PRE      */
-    {"blockquote", ALST_NOP, MAXA_NOP, 0},	/*  23 HTML_BLQ        */
-    {"/blockquote", NULL, 0, TFLG_END},	/*  24 HTML_N_BLQ      */
-    {"img", ALST_IMG, MAXA_IMG, 0},	/*  25 HTML_IMG        */
-    {"listing", NULL, 0, 0},	/*  26 HTML_LISTING    */
-    {"/listing", NULL, 0, TFLG_END},	/*  27 HTML_N_LISTING  */
-    {"xmp", NULL, 0, 0},	/*  28 HTML_XMP        */
-    {"/xmp", NULL, 0, TFLG_END},	/*  29 HTML_N_XMP      */
-    {"plaintext", NULL, 0, 0},	/*  30 HTML_PLAINTEXT  */
-    {"table", ALST_TABLE, MAXA_TABLE, 0},	/*  31 HTML_TABLE      */
-    {"/table", NULL, 0, TFLG_END},	/*  32 HTML_N_TABLE    */
-    {"meta", ALST_META, MAXA_META, 0},	/*  33 HTML_META       */
-    {"/p", NULL, 0, TFLG_END},	/*  34 HTML_N_P        */
-    {"frame", ALST_FRAME, MAXA_FRAME, 0},	/*  35 HTML_FRAME      */
-    {"frameset", ALST_FRAMESET, MAXA_FRAMESET, 0},	/*  36 HTML_FRAMESET   */
-    {"/frameset", NULL, 0, TFLG_END},	/*  37 HTML_N_FRAMESET */
-    {"center", NULL, 0, 0},	/*  38 HTML_CENTER     */
-    {"/center", NULL, 0, TFLG_END},	/*  39 HTML_N_CENTER   */
-    {"font", NULL, 0, 0},	/*  40 HTML_FONT       */
-    {"/font", NULL, 0, TFLG_END},	/*  41 HTML_N_FONT     */
-    {"form", ALST_FORM, MAXA_FORM, 0},	/*  42 HTML_FORM       */
-    {"/form", NULL, 0, TFLG_END},	/*  43 HTML_N_FORM     */
-    {"input", ALST_INPUT, MAXA_INPUT, 0},	/*  44 HTML_INPUT      */
-    {"textarea", ALST_TEXTAREA, MAXA_TEXTAREA, 0},	/*  45 HTML_TEXTAREA   */
-    {"/textarea", NULL, 0, TFLG_END},	/*  46 HTML_N_TEXTAREA */
-    {"select", ALST_SELECT, MAXA_SELECT, 0},	/*  47 HTML_SELECT     */
-    {"/select", NULL, 0, TFLG_END},	/*  48 HTML_N_SELECT   */
-    {"option", ALST_OPTION, MAXA_OPTION, 0},	/*  49 HTML_OPTION     */
-    {"nobr", NULL, 0, 0},	/*  50 HTML_NOBR       */
-    {"/nobr", NULL, 0, TFLG_END},	/*  51 HTML_N_NOBR     */
-    {"div", ALST_P, MAXA_P, 0},	/*  52 HTML_DIV        */
-    {"/div", NULL, 0, TFLG_END},	/*  53 HTML_N_DIV      */
-    {"isindex", ALST_ISINDEX, MAXA_ISINDEX, 0},	/*  54 HTML_ISINDEX    */
-    {"map", ALST_MAP, MAXA_MAP, 0},	/*  55 HTML_MAP        */
-    {"/map", NULL, 0, TFLG_END},	/*  56 HTML_N_MAP      */
-    {"area", ALST_AREA, MAXA_AREA, 0},	/*  57 HTML_AREA       */
-    {"script", NULL, 0, 0},	/*  58 HTML_SCRIPT     */
-    {"/script", NULL, 0, TFLG_END},	/*  59 HTML_N_SCRIPT   */
-    {"base", ALST_BASE, MAXA_BASE, 0},	/*  60 HTML_BASE       */
-    {"del", NULL, 0, 0},	/*  61 HTML_DEL        */
-    {"/del", NULL, 0, TFLG_END},	/*  62 HTML_N_DEL      */
-    {"ins", NULL, 0, 0},	/*  63 HTML_INS        */
-    {"/ins", NULL, 0, TFLG_END},	/*  64 HTML_N_INS      */
-    {"u", NULL, 0, 0},		/*  65 HTML_U          */
-    {"/u", NULL, 0, TFLG_END},	/*  66 HTML_N_U        */
-    {"style", NULL, 0, 0},	/*  67 HTML_STYLE      */
-    {"/style", NULL, 0, TFLG_END},	/*  68 HTML_N_STYLE    */
-    {"wbr", NULL, 0, 0},	/*  69 HTML_WBR        */
-    {"em", NULL, 0, 0},		/*  70 HTML_EM         */
-    {"/em", NULL, 0, TFLG_END},	/*  71 HTML_N_EM       */
-    {"body", ALST_BODY, MAXA_BODY, 0},	/*  72 HTML_BODY       */
-    {"/body", NULL, 0, TFLG_END},	/*  73 HTML_N_BODY     */
-    {"tr", ALST_TR, MAXA_TR, 0},	/*  74 HTML_TR         */
-    {"/tr", NULL, 0, TFLG_END},	/*  75 HTML_N_TR       */
-    {"td", ALST_TD, MAXA_TD, 0},	/*  76 HTML_TD         */
-    {"/td", NULL, 0, TFLG_END},	/*  77 HTML_N_TD       */
-    {"caption", ALST_NOP, MAXA_NOP, 0},	/*  78 HTML_CAPTION    */
-    {"/caption", NULL, 0, TFLG_END},	/*  79 HTML_N_CAPTION  */
-    {"th", ALST_TD, MAXA_TD, 0},	/*  80 HTML_TH         */
-    {"/th", NULL, 0, TFLG_END},	/*  81 HTML_N_TH       */
-    {"thead", NULL, 0, 0},	/*  82 HTML_THEAD      */
-    {"/thead", NULL, 0, TFLG_END},	/*  83 HTML_N_THEAD    */
-    {"tbody", NULL, 0, 0},	/*  84 HTML_TBODY      */
-    {"/tbody", NULL, 0, TFLG_END},	/*  85 HTML_N_TBODY    */
-    {"tfoot", NULL, 0, 0},	/*  86 HTML_TFOOT      */
-    {"/tfoot", NULL, 0, TFLG_END},	/*  87 HTML_N_TFOOT    */
-    {"colgroup", NULL, 0, 0},	/*  88 HTML_COLGROUP   */
-    {"/colgroup", NULL, 0, TFLG_END},	/*  89 HTML_N_COLGROUP */
-    {"col", NULL, 0, 0},	/*  90 HTML_COL        */
-    {"bgsound", ALST_BGSOUND, MAX_BGSOUND, 0},	/*  91 HTML_BGSOUND    */
-    {"applet", ALST_APPLET, MAX_APPLET, 0},	/*  92 HTML_APPLET     */
-    {"embed", ALST_EMBED, MAX_EMBED, 0},	/*  93 HTML_EMBED      */
-    {"/option", NULL, 0, TFLG_END},	/*  94 HTML_N_OPTION   */
-    {"head", NULL, 0, 0},	/*  95 HTML_HEAD       */
-    {"/head", NULL, 0, TFLG_END},	/*  96 HTML_N_HEAD     */
-    {"doctype", NULL, 0, 0},	/*  97 HTML_DOCTYPE    */
-    {"noframes", ALST_NOFRAMES, MAXA_NOFRAMES, 0},	/*  98 HTML_NOFRAMES   */
-    {"/noframes", NULL, 0, TFLG_END},	/*  99 HTML_N_NOFRAMES */
+    {"h1", ALST_P, MAXA_P, 0},	/*   3 HTML_H          */
+    {"/h1", NULL, 0, TFLG_END},	/*   9 HTML_N_H        */
+    {"h2", ALST_P, MAXA_P, 0},	/*   4 HTML_H          */
+    {"/h2", NULL, 0, TFLG_END},	/*  10 HTML_N_H        */
+    {"h3", ALST_P, MAXA_P, 0},	/*   5 HTML_H          */
+    {"/h3", NULL, 0, TFLG_END},	/*  11 HTML_N_H        */
+    {"h4", ALST_P, MAXA_P, 0},	/*   6 HTML_H          */
+    {"/h4", NULL, 0, TFLG_END},	/*  12 HTML_N_H        */
+    {"h5", ALST_P, MAXA_P, 0},	/*   7 HTML_H          */
+    {"/h5", NULL, 0, TFLG_END},	/*  13 HTML_N_H        */
+    {"h6", ALST_P, MAXA_P, 0},	/*   8 HTML_H          */
+    {"/h6", NULL, 0, TFLG_END},	/*  14 HTML_N_H        */
+    {"p", ALST_P, MAXA_P, 0},	/*  15 HTML_P          */
+    {"br", NULL, 0, 0},		/*   16 HTML_BR         */
+    {"b", NULL, 0, 0},		/*   17 HTML_B          */
+    {"/b", NULL, 0, TFLG_END},	/*   18 HTML_N_B        */
+    {"ul", ALST_UL, MAXA_UL, 0},	/*   19 HTML_UL         */
+    {"/ul", NULL, 0, TFLG_END},	/*  20 HTML_N_UL       */
+    {"li", ALST_LI, MAXA_LI, 0},	/*  21 HTML_LI         */
+    {"ol", ALST_UL, MAXA_UL, 0},	/*  22 HTML_OL         */
+    {"/ol", NULL, 0, TFLG_END},	/*  23 HTML_N_OL       */
+    {"title", NULL, 0, 0},	/*  24 HTML_TITLE      */
+    {"/title", NULL, 0, TFLG_END},	/*  25 HTML_N_TITLE    */
+    {"hr", ALST_HR, MAXA_HR, 0},	/*  26 HTML_HR         */
+    {"dl", ALST_DL, MAXA_DL, 0},	/*  27 HTML_DL         */
+    {"/dl", NULL, 0, TFLG_END},	/*  28 HTML_N_DL       */
+    {"dt", ALST_NOP, MAXA_NOP, 0},	/*  29 HTML_DT         */
+    {"dd", ALST_NOP, MAXA_NOP, 0},	/*  30 HTML_DD         */
+    {"pre", ALST_PRE, MAXA_PRE, 0},	/*  31 HTML_PRE        */
+    {"/pre", NULL, 0, TFLG_END},	/*  32 HTML_N_PRE      */
+    {"blockquote", ALST_NOP, MAXA_NOP, 0},	/*  33 HTML_BLQ        */
+    {"/blockquote", NULL, 0, TFLG_END},	/*  34 HTML_N_BLQ      */
+    {"img", ALST_IMG, MAXA_IMG, 0},	/*  35 HTML_IMG        */
+    {"listing", NULL, 0, 0},	/*  36 HTML_LISTING    */
+    {"/listing", NULL, 0, TFLG_END},	/*  37 HTML_N_LISTING  */
+    {"xmp", NULL, 0, 0},	/*  38 HTML_XMP        */
+    {"/xmp", NULL, 0, TFLG_END},	/*  39 HTML_N_XMP      */
+    {"plaintext", NULL, 0, 0},	/*  40 HTML_PLAINTEXT  */
+    {"table", ALST_TABLE, MAXA_TABLE, 0},	/*  41 HTML_TABLE      */
+    {"/table", NULL, 0, TFLG_END},	/*  42 HTML_N_TABLE    */
+    {"meta", ALST_META, MAXA_META, 0},	/*  43 HTML_META       */
+    {"/p", NULL, 0, TFLG_END},	/*  44 HTML_N_P        */
+    {"frame", ALST_FRAME, MAXA_FRAME, 0},	/*  45 HTML_FRAME      */
+    {"frameset", ALST_FRAMESET, MAXA_FRAMESET, 0},	/*  46 HTML_FRAMESET   */
+    {"/frameset", NULL, 0, TFLG_END},	/*  47 HTML_N_FRAMESET */
+    {"center", NULL, 0, 0},	/*  48 HTML_CENTER     */
+    {"/center", NULL, 0, TFLG_END},	/*  49 HTML_N_CENTER   */
+    {"font", NULL, 0, 0},	/*  50 HTML_FONT       */
+    {"/font", NULL, 0, TFLG_END},	/*  51 HTML_N_FONT     */
+    {"form", ALST_FORM, MAXA_FORM, 0},	/*  52 HTML_FORM       */
+    {"/form", NULL, 0, TFLG_END},	/*  53 HTML_N_FORM     */
+    {"input", ALST_INPUT, MAXA_INPUT, 0},	/*  54 HTML_INPUT      */
+    {"textarea", ALST_TEXTAREA, MAXA_TEXTAREA, 0},	/*  55 HTML_TEXTAREA   */
+    {"/textarea", NULL, 0, TFLG_END},	/*  56 HTML_N_TEXTAREA */
+    {"select", ALST_SELECT, MAXA_SELECT, 0},	/*  57 HTML_SELECT     */
+    {"/select", NULL, 0, TFLG_END},	/*  58 HTML_N_SELECT   */
+    {"option", ALST_OPTION, MAXA_OPTION, 0},	/*  59 HTML_OPTION     */
+    {"nobr", NULL, 0, 0},	/*  60 HTML_NOBR       */
+    {"/nobr", NULL, 0, TFLG_END},	/*  61 HTML_N_NOBR     */
+    {"div", ALST_P, MAXA_P, 0},	/*  62 HTML_DIV        */
+    {"/div", NULL, 0, TFLG_END},	/*  63 HTML_N_DIV      */
+    {"isindex", ALST_ISINDEX, MAXA_ISINDEX, 0},	/*  64 HTML_ISINDEX    */
+    {"map", ALST_MAP, MAXA_MAP, 0},	/*  65 HTML_MAP        */
+    {"/map", NULL, 0, TFLG_END},	/*  66 HTML_N_MAP      */
+    {"area", ALST_AREA, MAXA_AREA, 0},	/*  67 HTML_AREA       */
+    {"script", NULL, 0, 0},	/*  68 HTML_SCRIPT     */
+    {"/script", NULL, 0, TFLG_END},	/*  69 HTML_N_SCRIPT   */
+    {"base", ALST_BASE, MAXA_BASE, 0},	/*  70 HTML_BASE       */
+    {"del", NULL, 0, 0},	/*  71 HTML_DEL        */
+    {"/del", NULL, 0, TFLG_END},	/*  72 HTML_N_DEL      */
+    {"ins", NULL, 0, 0},	/*  73 HTML_INS        */
+    {"/ins", NULL, 0, TFLG_END},	/*  74 HTML_N_INS      */
+    {"u", NULL, 0, 0},		/*  75 HTML_U          */
+    {"/u", NULL, 0, TFLG_END},	/*  76 HTML_N_U        */
+    {"style", NULL, 0, 0},	/*  77 HTML_STYLE      */
+    {"/style", NULL, 0, TFLG_END},	/*  78 HTML_N_STYLE    */
+    {"wbr", NULL, 0, 0},	/*  79 HTML_WBR        */
+    {"em", NULL, 0, 0},		/*  80 HTML_EM         */
+    {"/em", NULL, 0, TFLG_END},	/*  81 HTML_N_EM       */
+    {"body", ALST_BODY, MAXA_BODY, 0},	/*  82 HTML_BODY       */
+    {"/body", NULL, 0, TFLG_END},	/*  83 HTML_N_BODY     */
+    {"tr", ALST_TR, MAXA_TR, 0},	/*  84 HTML_TR         */
+    {"/tr", NULL, 0, TFLG_END},	/*  85 HTML_N_TR       */
+    {"td", ALST_TD, MAXA_TD, 0},	/*  86 HTML_TD         */
+    {"/td", NULL, 0, TFLG_END},	/*  87 HTML_N_TD       */
+    {"caption", ALST_NOP, MAXA_NOP, 0},	/*  88 HTML_CAPTION    */
+    {"/caption", NULL, 0, TFLG_END},	/*  89 HTML_N_CAPTION  */
+    {"th", ALST_TD, MAXA_TD, 0},	/*  90 HTML_TH         */
+    {"/th", NULL, 0, TFLG_END},	/*  91 HTML_N_TH       */
+    {"thead", NULL, 0, 0},	/*  92 HTML_THEAD      */
+    {"/thead", NULL, 0, TFLG_END},	/*  93 HTML_N_THEAD    */
+    {"tbody", NULL, 0, 0},	/*  94 HTML_TBODY      */
+    {"/tbody", NULL, 0, TFLG_END},	/*  95 HTML_N_TBODY    */
+    {"tfoot", NULL, 0, 0},	/*  96 HTML_TFOOT      */
+    {"/tfoot", NULL, 0, TFLG_END},	/*  97 HTML_N_TFOOT    */
+    {"colgroup", NULL, 0, 0},	/*  98 HTML_COLGROUP   */
+    {"/colgroup", NULL, 0, TFLG_END},	/*  99 HTML_N_COLGROUP */
+    {"col", NULL, 0, 0},	/*  100 HTML_COL        */
+    {"bgsound", ALST_BGSOUND, MAX_BGSOUND, 0},	/*  101 HTML_BGSOUND    */
+    {"applet", ALST_APPLET, MAX_APPLET, 0},	/*  102 HTML_APPLET     */
+    {"embed", ALST_EMBED, MAX_EMBED, 0},	/*  103 HTML_EMBED      */
+    {"/option", NULL, 0, TFLG_END},	/*  104 HTML_N_OPTION   */
+    {"head", NULL, 0, 0},	/*  105 HTML_HEAD       */
+    {"/head", NULL, 0, TFLG_END},	/*  106 HTML_N_HEAD     */
+    {"doctype", NULL, 0, 0},	/*  107 HTML_DOCTYPE    */
+    {"noframes", ALST_NOFRAMES, MAXA_NOFRAMES, 0},	/*  108 HTML_NOFRAMES   */
+    {"/noframes", NULL, 0, TFLG_END},	/*  109 HTML_N_NOFRAMES */
 
-    {"sup", NULL, 0, 0},	/* 100 HTML_SUP       */
-    {"/sup", NULL, 0, 0},	/* 101 HTML_N_SUP       */
-    {"sub", NULL, 0, 0},	/* 102 HTML_SUB       */
-    {"/sub", NULL, 0, 0},	/* 103 HTML_N_SUB       */
-    {"link", ALST_LINK, MAXA_LINK, 0},	/*  104 HTML_LINK      */
-    {"s", NULL, 0, 0},		/*  105 HTML_S        */
-    {"/s", NULL, 0, TFLG_END},	/*  106 HTML_N_S      */
-    {"q", NULL, 0, 0},		/*  107 HTML_Q */
-    {"/q", NULL, 0, TFLG_END},	/*  108 HTML_N_Q */
-    {"i", NULL, 0, 0},		/*  109 HTML_I */
-    {"/i", NULL, 0, TFLG_END},	/*  110 HTML_N_I */
-    {"strong", NULL, 0, 0},		/* 111 HTML_STRONG */
-    {"/strong", NULL, 0, TFLG_END},	/* 112 HTML_N_STRONG */
-    {NULL, NULL, 0, 0},		/* 113 Undefined       */
-    {NULL, NULL, 0, 0},		/* 114 Undefined       */
-    {NULL, NULL, 0, 0},		/* 115 Undefined       */
-    {NULL, NULL, 0, 0},		/* 116 Undefined       */
-    {NULL, NULL, 0, 0},		/* 117 Undefined       */
-    {NULL, NULL, 0, 0},		/* 118 Undefined       */
-    {NULL, NULL, 0, 0},		/* 119 Undefined       */
+    {"sup", NULL, 0, 0},	/* 110 HTML_SUP       */
+    {"/sup", NULL, 0, 0},	/* 111 HTML_N_SUP       */
+    {"sub", NULL, 0, 0},	/* 112 HTML_SUB       */
+    {"/sub", NULL, 0, 0},	/* 113 HTML_N_SUB       */
+    {"link", ALST_LINK, MAXA_LINK, 0},	/*  114 HTML_LINK      */
+    {"s", NULL, 0, 0},		/*  115 HTML_S        */
+    {"/s", NULL, 0, TFLG_END},	/*  116 HTML_N_S      */
+    {"q", NULL, 0, 0},		/*  117 HTML_Q */
+    {"/q", NULL, 0, TFLG_END},	/*  118 HTML_N_Q */
+    {"i", NULL, 0, 0},		/*  119 HTML_I */
+    {"/i", NULL, 0, TFLG_END},	/*  120 HTML_N_I */
+    {"strong", NULL, 0, 0},		/* 121 HTML_STRONG */
+    {"/strong", NULL, 0, TFLG_END},	/* 122 HTML_N_STRONG */
+    {"iframe", ALST_IFRAME, MAXA_IFRAME, 0},     /*  123 HTML_IFRAME */
+    {"/iframe", NULL, 0, TFLG_END}, /* 124 HTML_N_IFRAME */
+    {"object", NULL, 0, 0},		/* 125 HTML_OBJECT       */
+    {"/object", NULL, 0, TFLG_END},		/* 126 HTML_N_OBJECT */
+    {NULL, NULL, 0, 0},		/* 127 Undefined       */
+    {NULL, NULL, 0, 0},		/* 128 Undefined       */
+    {NULL, NULL, 0, 0},		/* 129 Undefined       */
 
     /* pseudo tag */
-    {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT},	/* 120 HTML_SELECT_INT   */
-    {"/select_int", NULL, 0, TFLG_INT | TFLG_END},	/* 121 HTML_N_SELECT_INT */
-    {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT},	/* 122 HTML_OPTION_INT   */
-    {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT},	/* 123 HTML_TEXTAREA_INT   */
-    {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END},	/* 124 HTML_N_TEXTAREA_INT */
-    {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT},	/* 125 HTML_TABLE_ALT   */
-    {"symbol", ALST_SYMBOL, MAXA_SYMBOL, TFLG_INT},	/* 126 HTML_SYMBOL */
-    {"/symbol", NULL, 0, TFLG_INT | TFLG_END},	/* 127 HTML_N_SYMBOL      */
-    {"pre_int", NULL, 0, TFLG_INT},	/* 128 HTML_PRE_INT     */
-    {"/pre_int", NULL, 0, TFLG_INT | TFLG_END},	/* 129 HTML_N_PRE_INT   */
-    {"title_alt", ALST_TITLE_ALT, MAXA_TITLE_ALT, TFLG_INT},	/* 130 HTML_TITLE_ALT   */
-    {"form_int", ALST_FORM_INT, MAXA_FORM_INT, TFLG_INT},	/* 131 HTML_FORM_INT    */
-    {"/form_int", NULL, 0, TFLG_INT | TFLG_END},	/* 132 HTML_N_FORM_INT  */
-    {"dl_compact", NULL, 0, TFLG_INT},	/* 133 HTML_DL_COMPACT  */
-    {"input_alt", ALST_INPUT_ALT, MAXA_INPUT_ALT, TFLG_INT},	/* 134 HTML_INPUT_ALT   */
-    {"/input_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 135 HTML_N_INPUT_ALT */
-    {"img_alt", ALST_IMG_ALT, MAXA_IMG_ALT, TFLG_INT},	/* 136 HTML_IMG_ALT     */
-    {"/img_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 137 HTML_N_IMG_ALT   */
-    {" ", ALST_NOP, MAXA_NOP, TFLG_INT},	/* 138 HTML_NOP         */
-    {"pre_plain", NULL, 0, TFLG_INT},	/* 139 HTML_PRE_PLAIN         */
-    {"/pre_plain", NULL, 0, TFLG_INT | TFLG_END},	/* 140 HTML_N_PRE_PLAIN         */
-    {"internal", NULL, 0, TFLG_INT},	/* 141 HTML_INTERNAL   */
-    {"/internal", NULL, 0, TFLG_INT | TFLG_END},	/* 142 HTML_N_INTERNAL   */
-    {"div_int", ALST_P, MAXA_P, TFLG_INT},	/*  143 HTML_DIV_INT    */
-    {"/div_int", NULL, 0, TFLG_INT | TFLG_END},	/*  144 HTML_N_DIV_INT  */
+    {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT},	/* 130 HTML_SELECT_INT   */
+    {"/select_int", NULL, 0, TFLG_INT | TFLG_END},	/* 131 HTML_N_SELECT_INT */
+    {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT},	/* 132 HTML_OPTION_INT   */
+    {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT},	/* 133 HTML_TEXTAREA_INT   */
+    {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END},	/* 134 HTML_N_TEXTAREA_INT */
+    {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT},	/* 135 HTML_TABLE_ALT   */
+    {"symbol", ALST_SYMBOL, MAXA_SYMBOL, TFLG_INT},	/* 136 HTML_SYMBOL */
+    {"/symbol", NULL, 0, TFLG_INT | TFLG_END},	/* 137 HTML_N_SYMBOL      */
+    {"pre_int", NULL, 0, TFLG_INT},	/* 138 HTML_PRE_INT     */
+    {"/pre_int", NULL, 0, TFLG_INT | TFLG_END},	/* 139 HTML_N_PRE_INT   */
+    {"title_alt", ALST_TITLE_ALT, MAXA_TITLE_ALT, TFLG_INT},	/* 140 HTML_TITLE_ALT   */
+    {"form_int", ALST_FORM_INT, MAXA_FORM_INT, TFLG_INT},	/* 141 HTML_FORM_INT    */
+    {"/form_int", NULL, 0, TFLG_INT | TFLG_END},	/* 142 HTML_N_FORM_INT  */
+    {"dl_compact", NULL, 0, TFLG_INT},	/* 143 HTML_DL_COMPACT  */
+    {"input_alt", ALST_INPUT_ALT, MAXA_INPUT_ALT, TFLG_INT},	/* 144 HTML_INPUT_ALT   */
+    {"/input_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 145 HTML_N_INPUT_ALT */
+    {"img_alt", ALST_IMG_ALT, MAXA_IMG_ALT, TFLG_INT},	/* 146 HTML_IMG_ALT     */
+    {"/img_alt", NULL, 0, TFLG_INT | TFLG_END},	/* 147 HTML_N_IMG_ALT   */
+    {" ", ALST_NOP, MAXA_NOP, TFLG_INT},	/* 148 HTML_NOP         */
+    {"pre_plain", NULL, 0, TFLG_INT},	/* 149 HTML_PRE_PLAIN         */
+    {"/pre_plain", NULL, 0, TFLG_INT | TFLG_END},	/* 150 HTML_N_PRE_PLAIN         */
+    {"internal", NULL, 0, TFLG_INT},	/* 151 HTML_INTERNAL   */
+    {"/internal", NULL, 0, TFLG_INT | TFLG_END},	/* 152 HTML_N_INTERNAL   */
+    {"div_int", ALST_P, MAXA_P, TFLG_INT},	/*  153 HTML_DIV_INT    */
+    {"/div_int", NULL, 0, TFLG_INT | TFLG_END},	/*  154 HTML_N_DIV_INT  */
 };
 
 TagAttrInfo AttrMAP[MAX_TAGATTR] = {
diff -u /tmp/w3m/html.h /m/home/rubikitch/src/w3m/html.h
--- /tmp/w3m/html.h	2007-05-23 21:01:43.000000000 +0900
+++ /m/home/rubikitch/src/w3m/html.h	2007-10-23 08:35:25.000000000 +0900
@@ -92,145 +92,159 @@
 #define HTML_UNKNOWN	0
 #define HTML_A		1
 #define HTML_N_A	2
-#define HTML_H		3
-#define HTML_N_H	4
-#define HTML_P		5
-#define HTML_BR		6
-#define HTML_B		7
-#define HTML_N_B	8
-#define HTML_UL		9
-#define HTML_N_UL	10
-#define HTML_LI		11
-#define HTML_OL		12
-#define HTML_N_OL	13
-#define HTML_TITLE	14
-#define HTML_N_TITLE	15
-#define HTML_HR		16
-#define HTML_DL		17
-#define HTML_N_DL	18
-#define HTML_DT		19
-#define HTML_DD		20
-#define HTML_PRE	21
-#define HTML_N_PRE	22
-#define HTML_BLQ	23
-#define HTML_N_BLQ	24
-#define HTML_IMG	25
-#define HTML_LISTING	26
-#define HTML_N_LISTING	27
-#define HTML_XMP	28
-#define HTML_N_XMP	29
-#define HTML_PLAINTEXT	30
-#define HTML_TABLE      31
-#define HTML_N_TABLE    32
-#define HTML_META       33
-#define HTML_N_P        34
-#define HTML_FRAME      35
-#define HTML_FRAMESET   36
-#define HTML_N_FRAMESET 37
-#define HTML_CENTER     38
-#define HTML_N_CENTER   39
-#define HTML_FONT       40
-#define HTML_N_FONT     41
-#define HTML_FORM       42
-#define HTML_N_FORM     43
-#define HTML_INPUT      44
-#define HTML_TEXTAREA   45
-#define HTML_N_TEXTAREA 46
-#define HTML_SELECT     47
-#define HTML_N_SELECT   48
-#define HTML_OPTION     49
-#define HTML_NOBR       50
-#define HTML_N_NOBR     51
-#define HTML_DIV        52
-#define HTML_N_DIV      53
-#define HTML_ISINDEX    54
-#define HTML_MAP        55
-#define HTML_N_MAP      56
-#define HTML_AREA       57
-#define HTML_SCRIPT     58
-#define HTML_N_SCRIPT   59
-#define HTML_BASE       60
-#define HTML_DEL        61
-#define HTML_N_DEL      62
-#define HTML_INS        63
-#define HTML_N_INS      64
-#define HTML_U          65
-#define HTML_N_U        66
-#define HTML_STYLE      67
-#define HTML_N_STYLE    68
-#define HTML_WBR        69
-#define HTML_EM		70
-#define HTML_N_EM	71
-#define HTML_BODY	72
-#define HTML_N_BODY	73
-#define HTML_TR         74
-#define HTML_N_TR       75
-#define HTML_TD         76
-#define HTML_N_TD       77
-#define HTML_CAPTION    78
-#define HTML_N_CAPTION  79
-#define HTML_TH         80
-#define HTML_N_TH       81
-#define HTML_THEAD      82
-#define HTML_N_THEAD    83
-#define HTML_TBODY      84
-#define HTML_N_TBODY    85
-#define HTML_TFOOT      86
-#define HTML_N_TFOOT    87
-#define HTML_COLGROUP   88
-#define HTML_N_COLGROUP 89
-#define HTML_COL        90
-#define HTML_BGSOUND    91
-#define HTML_APPLET     92
-#define HTML_EMBED      93
-#define HTML_N_OPTION   94
-#define HTML_HEAD       95
-#define HTML_N_HEAD     96
-#define HTML_DOCTYPE    97
-#define HTML_NOFRAMES   98
-#define HTML_N_NOFRAMES 99
-#define HTML_SUP	100
-#define HTML_N_SUP	101
-#define HTML_SUB	102
-#define HTML_N_SUB	103
-#define HTML_LINK       104
-#define HTML_S          105
-#define HTML_N_S        106
-#define HTML_Q		107
-#define HTML_N_Q	108
-#define HTML_I		109
-#define HTML_N_I	110
-#define HTML_STRONG	111
-#define HTML_N_STRONG	112
-
+#define HTML_H1		3
+#define HTML_H2		4
+#define HTML_H3		5
+#define HTML_H4		6
+#define HTML_H5		7
+#define HTML_H6		8
+#define HTML_N_H1	9
+#define HTML_N_H2	10
+#define HTML_N_H3	11
+#define HTML_N_H4	12
+#define HTML_N_H5	13
+#define HTML_N_H6	14
+#define HTML_P		15
+#define HTML_BR		16
+#define HTML_B		17
+#define HTML_N_B	18
+#define HTML_UL		19
+#define HTML_N_UL	20
+#define HTML_LI		21
+#define HTML_OL		22
+#define HTML_N_OL	23
+#define HTML_TITLE	24
+#define HTML_N_TITLE	25
+#define HTML_HR		26
+#define HTML_DL		27
+#define HTML_N_DL	28
+#define HTML_DT		29
+#define HTML_DD		30
+#define HTML_PRE	31
+#define HTML_N_PRE	32
+#define HTML_BLQ	33
+#define HTML_N_BLQ	34
+#define HTML_IMG	35
+#define HTML_LISTING	36
+#define HTML_N_LISTING	37
+#define HTML_XMP	38
+#define HTML_N_XMP	39
+#define HTML_PLAINTEXT	40
+#define HTML_TABLE      41
+#define HTML_N_TABLE    42
+#define HTML_META       43
+#define HTML_N_P        44
+#define HTML_FRAME      45
+#define HTML_FRAMESET   46
+#define HTML_N_FRAMESET 47
+#define HTML_CENTER     48
+#define HTML_N_CENTER   49
+#define HTML_FONT       50
+#define HTML_N_FONT     51
+#define HTML_FORM       52
+#define HTML_N_FORM     53
+#define HTML_INPUT      54
+#define HTML_TEXTAREA   55
+#define HTML_N_TEXTAREA 56
+#define HTML_SELECT     57
+#define HTML_N_SELECT   58
+#define HTML_OPTION     59
+#define HTML_NOBR       60
+#define HTML_N_NOBR     61
+#define HTML_DIV        62
+#define HTML_N_DIV      63
+#define HTML_ISINDEX    64
+#define HTML_MAP        65
+#define HTML_N_MAP      66
+#define HTML_AREA       67
+#define HTML_SCRIPT     68
+#define HTML_N_SCRIPT   69
+#define HTML_BASE       70
+#define HTML_DEL        71
+#define HTML_N_DEL      72
+#define HTML_INS        73
+#define HTML_N_INS      74
+#define HTML_U          75
+#define HTML_N_U        76
+#define HTML_STYLE      77
+#define HTML_N_STYLE    78
+#define HTML_WBR        79
+#define HTML_EM		80
+#define HTML_N_EM	81
+#define HTML_BODY	82
+#define HTML_N_BODY	83
+#define HTML_TR         84
+#define HTML_N_TR       85
+#define HTML_TD         86
+#define HTML_N_TD       87
+#define HTML_CAPTION    88
+#define HTML_N_CAPTION  89
+#define HTML_TH         90
+#define HTML_N_TH       91
+#define HTML_THEAD      92
+#define HTML_N_THEAD    93
+#define HTML_TBODY      94
+#define HTML_N_TBODY    95
+#define HTML_TFOOT      96
+#define HTML_N_TFOOT    97
+#define HTML_COLGROUP   98
+#define HTML_N_COLGROUP 99
+#define HTML_COL        100
+#define HTML_BGSOUND    101
+#define HTML_APPLET     102
+#define HTML_EMBED      103
+#define HTML_N_OPTION   104
+#define HTML_HEAD       105
+#define HTML_N_HEAD     106
+#define HTML_DOCTYPE    107
+#define HTML_NOFRAMES   108
+#define HTML_N_NOFRAMES 109
+#define HTML_SUP	110
+#define HTML_N_SUP	111
+#define HTML_SUB	112
+#define HTML_N_SUB	113
+#define HTML_LINK       114
+#define HTML_S          115
+#define HTML_N_S        116
+#define HTML_Q		117
+#define HTML_N_Q	118
+#define HTML_I		119
+#define HTML_N_I	120
+#define HTML_STRONG	121
+#define HTML_N_STRONG	122
+#define HTML_IFRAME     123
+#define HTML_N_IFRAME   124
+#define HTML_OBJECT     125
+#define HTML_N_OBJECT   126
+  
    /* pseudo tag */
-#define HTML_SELECT_INT     120
-#define HTML_N_SELECT_INT   121
-#define HTML_OPTION_INT     122
-#define HTML_TEXTAREA_INT   123
-#define HTML_N_TEXTAREA_INT 124
-#define HTML_TABLE_ALT      125
-#define HTML_SYMBOL         126
-#define HTML_N_SYMBOL       127
-#define HTML_PRE_INT        128
-#define HTML_N_PRE_INT      129
-#define HTML_TITLE_ALT      130
-#define HTML_FORM_INT       131
-#define HTML_N_FORM_INT     132
-#define HTML_DL_COMPACT     133
-#define HTML_INPUT_ALT      134
-#define HTML_N_INPUT_ALT    135
-#define HTML_IMG_ALT        136
-#define HTML_N_IMG_ALT      137
-#define HTML_NOP	    138
-#define HTML_PRE_PLAIN	    139
-#define HTML_N_PRE_PLAIN    140
-#define HTML_INTERNAL       141
-#define HTML_N_INTERNAL     142
-#define HTML_DIV_INT        143
-#define HTML_N_DIV_INT      144
+#define HTML_SELECT_INT     130
+#define HTML_N_SELECT_INT   131
+#define HTML_OPTION_INT     132
+#define HTML_TEXTAREA_INT   133
+#define HTML_N_TEXTAREA_INT 134
+#define HTML_TABLE_ALT      135
+#define HTML_SYMBOL         136
+#define HTML_N_SYMBOL       137
+#define HTML_PRE_INT        138
+#define HTML_N_PRE_INT      139
+#define HTML_TITLE_ALT      140
+#define HTML_FORM_INT       141
+#define HTML_N_FORM_INT     142
+#define HTML_DL_COMPACT     143
+#define HTML_INPUT_ALT      144
+#define HTML_N_INPUT_ALT    145
+#define HTML_IMG_ALT        146
+#define HTML_N_IMG_ALT      147
+#define HTML_NOP	    148
+#define HTML_PRE_PLAIN	    149
+#define HTML_N_PRE_PLAIN    150
+#define HTML_INTERNAL       151
+#define HTML_N_INTERNAL     152
+#define HTML_DIV_INT        153
+#define HTML_N_DIV_INT      154
 
-#define MAX_HTMLTAG	    145
+#define MAX_HTMLTAG	    155
 
 /* Tag attribute */
 
diff -u /tmp/w3m/image.c /m/home/rubikitch/src/w3m/image.c
--- /tmp/w3m/image.c	2003-07-08 00:49:03.000000000 +0900
+++ /m/home/rubikitch/src/w3m/image.c	2007-10-23 08:35:25.000000000 +0900
@@ -240,7 +240,7 @@
 /* load image */
 
 #ifndef MAX_LOAD_IMAGE
-#define MAX_LOAD_IMAGE 8
+#define MAX_LOAD_IMAGE 128
 #endif
 static int n_load_image = 0;
 static Hash_sv *image_hash = NULL;
共通の下位ディレクトリー: /tmp/w3m/intlと/m/home/rubikitch/src/w3m/intl
共通の下位ディレクトリー: /tmp/w3m/libwcと/m/home/rubikitch/src/w3m/libwc
diff -u /tmp/w3m/linein.c /m/home/rubikitch/src/w3m/linein.c
--- /tmp/w3m/linein.c	2007-05-23 21:14:24.000000000 +0900
+++ /m/home/rubikitch/src/w3m/linein.c	2007-10-23 08:35:25.000000000 +0900
@@ -184,7 +184,7 @@
 	cm_clear = TRUE;
 	cm_disp_clear = TRUE;
 	if (!i_quote &&
-	    (((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) ||
+	    (((cm_mode & CPL_ALWAYS) && (c == CTRL_I)) ||
 	     ((cm_mode & CPL_ON) && (c == CTRL_I)))) {
 	    if (emacs_like_lineedit && cm_next) {
 		_dcompl();
diff -u /tmp/w3m/main.c /m/home/rubikitch/src/w3m/main.c
--- /tmp/w3m/main.c	2007-06-04 22:21:10.000000000 +0900
+++ /m/home/rubikitch/src/w3m/main.c	2007-10-23 08:35:25.000000000 +0900
@@ -37,6 +37,8 @@
 Hist *URLHist;
 Hist *ShellHist;
 Hist *TextHist;
+Hist *CommandHist;
+Hist *UserHist[10];
 
 typedef struct _Event {
     int cmd;
@@ -48,10 +50,13 @@
 
 #ifdef USE_ALARM
 static AlarmEvent DefaultAlarm = {
-    0, AL_UNSET, FUNCNAME_nulcmd, NULL
+    0, 0, AL_UNSET, FUNCNAME_nulcmd, NULL
 };
 static AlarmEvent *CurrentAlarm = &DefaultAlarm;
 static MySignalHandler SigAlarm(SIGNAL_ARG);
+AlarmEvent * setUAlarmEvent(AlarmEvent * event, int usec, short status, int cmd, void *data);
+#define alarm(sec) ualarm((sec*1000000), 0)
+#define REDRAW_IMAGE_DELAY 200000
 #endif
 
 #ifdef SIGWINCH
@@ -88,7 +93,7 @@
 static char *getCurWord(Buffer *buf, int *spos, int *epos,
 			const char *badchars);
 
-static int display_ok = FALSE;
+static int display_ok = TRUE;
 static void do_dump(Buffer *);
 int prec_num = 0;
 int prev_key = -1;
@@ -257,6 +262,7 @@
     fprintf(f, "    -o opt=value     assign value to config option\n");
     fprintf(f, "    -show-option     print all config options\n");
     fprintf(f, "    -config file     specify config file\n");
+    fprintf(f, "    -search-string S set default search string\n");
     fprintf(f, "    -help            print this usage message\n");
     fprintf(f, "    -version         print w3m version\n");
     fprintf(f, "    -reqlog          write request logfile\n");
@@ -318,6 +324,50 @@
 	fprintf(stderr, msg, (unsigned long)arg);
 }
 
+
+static MySignalHandler
+write_state(SIGNAL_ARG)
+{
+    FILE *fp;
+    char *filename;
+    set_buffer_environ(Currentbuf);
+    filename = rcFile(Sprintf("state-%d", (int)getpid())->ptr);
+    pushText(fileToDelete, filename);
+    if ((fp=fopen(filename, "w")) != NULL){
+
+
+        fprintf(fp, "%s:%s\n", "W3M_CHARSET", getenv("W3M_CHARSET"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_COLUMN", getenv("W3M_CURRENT_COLUMN"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_FORM", getenv("W3M_CURRENT_FORM"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_IMG", getenv("W3M_CURRENT_IMG"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_LINE", getenv("W3M_CURRENT_LINE"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_LINK", getenv("W3M_CURRENT_LINK"));
+
+        fprintf(fp, "%s:%s\n", "W3M_CURRENT_WORD", getenv("W3M_CURRENT_WORD"));
+
+        fprintf(fp, "%s:%s\n", "W3M_FILENAME", getenv("W3M_FILENAME"));
+
+        fprintf(fp, "%s:%s\n", "W3M_SEARCH_STRING", getenv("W3M_SEARCH_STRING"));
+
+        fprintf(fp, "%s:%s\n", "W3M_SOURCEFILE", getenv("W3M_SOURCEFILE"));
+
+        fprintf(fp, "%s:%s\n", "W3M_TITLE", getenv("W3M_TITLE"));
+
+        fprintf(fp, "%s:%s\n", "W3M_TYPE", getenv("W3M_TYPE"));
+
+        fprintf(fp, "%s:%s\n", "W3M_URL", getenv("W3M_URL"));
+
+    }
+    fclose(fp);
+    SIGNAL_RETURN;
+}
+
+
 #ifdef SIGCHLD
 static void
 sig_chld(int signo)
@@ -458,6 +508,13 @@
     ShellHist = newHist();
     TextHist = newHist();
     URLHist = newHist();
+    CommandHist = newHist();
+
+    {
+        int j;
+        for(j=0; j<10; j++)
+            UserHist[j] = newHist();
+    }
 
 #ifdef USE_M17N
     if (FollowLocale && Locale) {
@@ -510,7 +567,17 @@
     i = 1;
     while (i < argc) {
 	if (*argv[i] == '-') {
-	    if (!strcmp("-t", argv[i])) {
+            if (!strcmp("-search-string", argv[i])) {
+		if (++i >= argc)
+		    usage();
+                set_environ("W3M_SEARCH_STRING", argv[i]);
+#ifdef USE_MIGEMO
+                init_migemo();
+#endif
+                SearchString = argv[i];
+                searchRoutine = forwardSearch;
+            }
+	    else if (!strcmp("-t", argv[i])) {
 		if (++i >= argc)
 		    usage();
 		if (atoi(argv[i]) > 0)
@@ -842,6 +909,7 @@
     mySignal(SIGPIPE, SigPipe);
 #endif
 
+    mySignal(SIGUSR1, write_state);
     orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
     err_msg = Strnew();
     if (load_argc == 0) {
@@ -1088,7 +1156,7 @@
 	if (Currentbuf->event) {
 	    if (Currentbuf->event->status != AL_UNSET) {
 		CurrentAlarm = Currentbuf->event;
-		if (CurrentAlarm->sec == 0) {	/* refresh (0sec) */
+		if (CurrentAlarm->sec == 0 && CurrentAlarm->usec == 0) {	/* refresh (0sec) */
 		    Currentbuf->event = NULL;
 		    CurrentKey = -1;
 		    CurrentKeyData = NULL;
@@ -1114,6 +1182,10 @@
 	    mySignal(SIGALRM, SigAlarm);
 	    alarm(CurrentAlarm->sec);
 	}
+	else if (CurrentAlarm->usec > 0) {
+	    mySignal(SIGALRM, SigAlarm);
+	    ualarm(CurrentAlarm->usec, 0);
+	}
 #endif
 #ifdef SIGWINCH
 	mySignal(SIGWINCH, resize_hook);
@@ -1146,6 +1218,9 @@
 	if (CurrentAlarm->sec > 0) {
 	    alarm(0);
 	}
+        else if (CurrentAlarm->usec > 0) {
+	    ualarm(0, 0);
+	}
 #endif
 #ifdef USE_MOUSE
 	if (use_mouse)
@@ -1383,7 +1458,6 @@
 
 static Str currentURL(void);
 
-#ifdef USE_BUFINFO
 void
 saveBufferInfo()
 {
@@ -1397,7 +1471,6 @@
     fprintf(fp, "%s\n", currentURL()->ptr);
     fclose(fp);
 }
-#endif
 
 static void
 pushBuffer(Buffer *buf)
@@ -1487,6 +1560,36 @@
  * Command functions: These functions are called with a keystroke.
  */
 
+/* setRedrawImageEvent */
+void
+setRedrawImageEvent(void)
+{
+#ifdef USE_IMAGE
+#ifdef USE_ALARM
+    Currentbuf->event = setUAlarmEvent(Currentbuf->event, REDRAW_IMAGE_DELAY, AL_IMPLICIT_ONCE,
+                                                               //Currentbuf->event = setAlarmEvent(Currentbuf->event, 1, AL_IMPLICIT_ONCE,
+                                       FUNCNAME_dispI2, NULL);
+    //                                              FUNCNAME_execCmd, "MOVE_RIGHT;MOVE_LEFT");
+    //    pushEvent(FUNCNAME_execCmd, "MOVE_RIGHT;MOVE_LEFT");
+#endif    
+#endif    
+}
+
+static void
+setForceRedrawEvent(void)
+{
+#ifdef USE_IMAGE
+#ifdef USE_ALARM
+    Currentbuf->event = setUAlarmEvent(Currentbuf->event, REDRAW_IMAGE_DELAY, AL_IMPLICIT_ONCE,
+                                                               //Currentbuf->event = setAlarmEvent(Currentbuf->event, 1, AL_IMPLICIT_ONCE,
+                                       FUNCNAME_dispI4, NULL);
+    //                                              FUNCNAME_execCmd, "MOVE_RIGHT;MOVE_LEFT");
+    //    pushEvent(FUNCNAME_execCmd, "MOVE_RIGHT;MOVE_LEFT");
+#endif    
+#endif    
+}
+
+
 static void
 nscroll(int n, int mode)
 {
@@ -1542,6 +1645,7 @@
 	}
     }
     displayBuffer(buf, mode);
+    setForceRedrawEvent();
 }
 
 /* Move page forward */
@@ -1618,35 +1722,36 @@
 }
 
 static void
-clear_mark(Line *l)
+clear_smark(Line *l)
 {
     int pos;
     if (!l)
 	return;
     for (pos = 0; pos < l->size; pos++)
-	l->propBuf[pos] &= ~PE_MARK;
+	l->propBuf[pos] &= ~PE_SMARK;
 }
 
 /* search by regular expression */
 static int
-srchcore(char *volatile str, int (*func) (Buffer *, char *))
+srchcore(char *volatile str, int (*func) (Buffer *, char *), int update)
 {
     MySignalHandler(*prevtrap) ();
     volatile int i, result = SR_NOTFOUND;
 
-    if (str != NULL && str != SearchString)
+    if (str != NULL && str != SearchString && update)
 	SearchString = str;
-    if (SearchString == NULL || *SearchString == '\0')
+    if ((SearchString == NULL || *SearchString == '\0') && update)
 	return SR_NOTFOUND;
 
-    str = conv_search_string(SearchString, DisplayCharset);
+    str = conv_search_string(str, DisplayCharset);
+    redrawCurrentLineIfNeeded(Currentbuf);    
     prevtrap = mySignal(SIGINT, intTrap);
     crmode();
     if (SETJMP(IntReturn) == 0) {
 	for (i = 0; i < PREC_NUM; i++) {
 	    result = func(Currentbuf, str);
 	    if (i < PREC_NUM - 1 && result & SR_FOUND)
-		clear_mark(Currentbuf->currentLine);
+		clear_smark(Currentbuf->currentLine);
 	}
     }
     mySignal(SIGINT, prevtrap);
@@ -1710,14 +1815,14 @@
 	    if (searchRoutine == forwardSearch)
 		Currentbuf->pos += 1;
 	    SAVE_BUFPOSITION(&sbuf);
-	    if (srchcore(str, searchRoutine) == SR_NOTFOUND
+	    if (srchcore(str, searchRoutine, TRUE) == SR_NOTFOUND
 		&& searchRoutine == forwardSearch) {
 		Currentbuf->pos -= 1;
 		SAVE_BUFPOSITION(&sbuf);
 	    }
 	    arrangeCursor(Currentbuf);
 	    displayBuffer(Currentbuf, B_FORCE_REDRAW);
-	    clear_mark(Currentbuf->currentLine);
+	    clear_smark(Currentbuf->currentLine);
 	    return -1;
 	}
 	else
@@ -1726,13 +1831,13 @@
     else if (*str) {
 	RESTORE_BUFPOSITION(&sbuf);
 	arrangeCursor(Currentbuf);
-	srchcore(str, searchRoutine);
+	srchcore(str, searchRoutine, TRUE);
 	arrangeCursor(Currentbuf);
 	currentLine = Currentbuf->currentLine;
 	pos = Currentbuf->pos;
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
-    clear_mark(Currentbuf->currentLine);
+    clear_smark(Currentbuf->currentLine);
 #ifdef USE_MIGEMO
   done:
     while (*str++ != '\0') {
@@ -1762,7 +1867,7 @@
 }
 
 void
-srch(int (*func) (Buffer *, char *), char *prompt)
+srch(int (*func) (Buffer *, char *), char *prompt, int update)
 {
     char *str;
     int result;
@@ -1783,9 +1888,9 @@
     pos = Currentbuf->pos;
     if (func == forwardSearch)
 	Currentbuf->pos += 1;
-    result = srchcore(str, func);
+    result = srchcore(str, func, update);
     if (result & SR_FOUND)
-	clear_mark(Currentbuf->currentLine);
+	clear_smark(Currentbuf->currentLine);
     else
 	Currentbuf->pos = pos;
     displayBuffer(Currentbuf, B_NORMAL);
@@ -1798,7 +1903,12 @@
 
 DEFUN(srchfor, SEARCH SEARCH_FORE WHEREIS, "Search forward")
 {
-    srch(forwardSearch, "Forward: ");
+    srch(forwardSearch, "Forward: ", TRUE);
+}
+
+DEFUN(srchfor2, SEARCH2 SEARCH_FORE2 WHEREIS2, "Search forward(SearchString is not updated)")
+{
+    srch(forwardSearch, "Forward: ", FALSE);
 }
 
 DEFUN(isrchfor, ISEARCH, "Incremental search forward")
@@ -1810,7 +1920,12 @@
 
 DEFUN(srchbak, SEARCH_BACK, "Search backward")
 {
-    srch(backwardSearch, "Backward: ");
+    srch(backwardSearch, "Backward: ", TRUE);
+}
+
+DEFUN(srchbak2, SEARCH_BACK2, "Search backward(SearchString is not updated)")
+{
+    srch(backwardSearch, "Backward: ", FALSE);
 }
 
 DEFUN(isrchbak, ISEARCH_BACK, "Incremental search backward")
@@ -1839,9 +1954,9 @@
 	reverse ^= 1;
     if (reverse == 0)
 	Currentbuf->pos += 1;
-    result = srchcore(SearchString, routine[reverse]);
+    result = srchcore(SearchString, routine[reverse], TRUE);
     if (result & SR_FOUND)
-	clear_mark(Currentbuf->currentLine);
+	clear_smark(Currentbuf->currentLine);
     displayBuffer(Currentbuf, B_NORMAL);
     disp_srchresult(result, (reverse ? "Backward: " : "Forward: "),
 		    SearchString);
@@ -1859,6 +1974,22 @@
     srch_nxtprv(1);
 }
 
+/* Search next matching */
+DEFUN(srchnxtfore, SEARCH_NEXT_FORE, "Search next regexp (forward)")
+{
+    searchRoutine = searchRoutine ? forwardSearch : NULL;
+    srch_nxtprv(0);
+}
+
+/* Search previous matching */
+DEFUN(srchnxtback, SEARCH_NEXT_BACK, "Search previous regexp (backward)")
+{
+    searchRoutine = searchRoutine ? forwardSearch : NULL;
+    srch_nxtprv(1);
+}
+
+
+
 static void
 shiftvisualpos(Buffer *buf, int shift)
 {
@@ -1884,6 +2015,7 @@
     columnSkip(Currentbuf, searchKeyNum() * (-Currentbuf->COLS + 1) + 1);
     shiftvisualpos(Currentbuf, Currentbuf->currentColumn - column);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 /* Shift screen right */
@@ -1897,6 +2029,7 @@
     columnSkip(Currentbuf, searchKeyNum() * (Currentbuf->COLS - 1) - 1);
     shiftvisualpos(Currentbuf, Currentbuf->currentColumn - column);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 DEFUN(col1R, RIGHT, "Shift screen one column right")
@@ -1915,6 +2048,7 @@
 	shiftvisualpos(Currentbuf, 1);
     }
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 DEFUN(col1L, LEFT, "Shift screen one column")
@@ -1932,6 +2066,7 @@
 	shiftvisualpos(Currentbuf, -1);
     }
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 DEFUN(setEnv, SETENV, "Set environment variable")
@@ -1968,7 +2103,7 @@
     cmd = searchKeyData();
     if (cmd == NULL || *cmd == '\0') {
 	/* FIXME: gettextize? */
-	cmd = inputLineHist("Pipe buffer to: ", "", IN_COMMAND, ShellHist);
+	cmd = inputLineHist(Sprintf("Pipe buffer to[%s]: ",CurrentDir)->ptr, "", IN_COMMAND, ShellHist);
     }
     if (cmd != NULL)
 	cmd = conv_to_system(cmd);
@@ -1985,13 +2120,14 @@
     }
     saveBuffer(Currentbuf, f, TRUE);
     fclose(f);
+    set_params_environ();
     buf = getpipe(myExtCommand(cmd, shell_quote(tmpf), TRUE)->ptr);
     if (buf == NULL) {
 	disp_message("Execution failed", TRUE);
 	return;
     }
     else {
-	buf->filename = cmd;
+	buf->filename = CurrentDir;
 	buf->buffername = Sprintf("%s %s", PIPEBUFFERNAME,
 				  conv_from_system(cmd))->ptr;
 	buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
@@ -2012,7 +2148,7 @@
     CurrentKeyData = NULL;	/* not allowed in w3m-control: */
     cmd = searchKeyData();
     if (cmd == NULL || *cmd == '\0') {
-	cmd = inputLineHist("(read shell[pipe])!", "", IN_COMMAND, ShellHist);
+	cmd = inputLineHist(Sprintf("(read shell[pipe])[%s]!",CurrentDir)->ptr, "", IN_COMMAND, ShellHist);
     }
     if (cmd != NULL)
 	cmd = conv_to_system(cmd);
@@ -2020,6 +2156,7 @@
 	displayBuffer(Currentbuf, B_NORMAL);
 	return;
     }
+    set_params_environ();
     buf = getpipe(cmd);
     if (buf == NULL) {
 	disp_message("Execution failed", TRUE);
@@ -2044,7 +2181,7 @@
     CurrentKeyData = NULL;	/* not allowed in w3m-control: */
     cmd = searchKeyData();
     if (cmd == NULL || *cmd == '\0') {
-	cmd = inputLineHist("(read shell)!", "", IN_COMMAND, ShellHist);
+	cmd = inputLineHist(Sprintf("(read shell)[%s]!",CurrentDir)->ptr, "", IN_COMMAND, ShellHist);
     }
     if (cmd != NULL)
 	cmd = conv_to_system(cmd);
@@ -2054,6 +2191,7 @@
     }
     prevtrap = mySignal(SIGINT, intTrap);
     crmode();
+    set_params_environ();
     buf = getshell(cmd);
     mySignal(SIGINT, prevtrap);
     term_raw();
@@ -2072,39 +2210,56 @@
 }
 
 /* Execute shell command */
-DEFUN(execsh, EXEC_SHELL SHELL, "Execute shell command")
+static void _execsh(int arg)
 {
     char *cmd;
-
+    
     CurrentKeyData = NULL;	/* not allowed in w3m-control: */
     cmd = searchKeyData();
     if (cmd == NULL || *cmd == '\0') {
-	cmd = inputLineHist("(exec shell)!", "", IN_COMMAND, ShellHist);
+	cmd = inputLineHist(Sprintf("(exec shell)[%s]!",CurrentDir)->ptr, "", IN_COMMAND, ShellHist);
     }
     if (cmd != NULL)
 	cmd = conv_to_system(cmd);
     if (cmd != NULL && *cmd != '\0') {
 	fmTerm();
 	printf("\n");
+        set_params_environ();
 	system(cmd);
-	/* FIXME: gettextize? */
-	printf("\n[Hit any key]");
-	fflush(stdout);
-	fmInit();
-	getch();
+        if (arg) {
+          /* FIXME: gettextize? */
+          printf("\n[Hit any key]");
+          fflush(stdout);
+          fmInit();
+          getch();
+        } else {
+          fflush(stdout);
+          fmInit();
+        }
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
 }
 
+DEFUN(execsh, EXEC_SHELL SHELL, "Execute shell command")
+{
+  _execsh(TRUE);
+}
+
+DEFUN(execsh2, EXEC_SHELL2 SHELL2, "Execute shell command")
+{
+  _execsh(FALSE);
+}
+
 /* Load file */
-DEFUN(ldfile, LOAD, "Load local file")
+static void
+_ldfile(char *prompt)
 {
     char *fn;
 
     fn = searchKeyData();
     if (fn == NULL || *fn == '\0') {
 	/* FIXME: gettextize? */
-	fn = inputFilenameHist("(Load)Filename? ", NULL, LoadHist);
+	fn = inputFilenameHist(prompt, NULL, LoadHist);
     }
     if (fn != NULL)
 	fn = conv_to_system(fn);
@@ -2115,6 +2270,11 @@
     cmd_loadfile(fn);
 }
 
+DEFUN(ldfile, LOAD, "Load local file")
+{
+  _ldfile(Sprintf("(Load)Filename[%s]: ", CurrentDir)->ptr);
+}
+
 /* Load help file */
 DEFUN(ldhelp, HELP, "View help")
 {
@@ -2181,11 +2341,13 @@
 _movD(int n)
 {
     int i, m = searchKeyNum();
+    redrawCurrentLineIfNeeded(Currentbuf);
     if (Currentbuf->firstLine == NULL)
 	return;
     for (i = 0; i < m; i++)
 	cursorDown(Currentbuf, n);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 DEFUN(movD, MOVE_DOWN,
@@ -2205,11 +2367,13 @@
 _movU(int n)
 {
     int i, m = searchKeyNum();
+    redrawCurrentLineIfNeeded(Currentbuf);
     if (Currentbuf->firstLine == NULL)
 	return;
     for (i = 0; i < m; i++)
 	cursorUp(Currentbuf, n);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 DEFUN(movU, MOVE_UP,
@@ -2280,6 +2444,7 @@
     if (Currentbuf->firstLine == NULL)
 	return;
 
+    redrawCurrentLineIfNeeded(Currentbuf);
     for (i = 0; i < n; i++) {
 	pline = Currentbuf->currentLine;
 	ppos = Currentbuf->pos;
@@ -2345,6 +2510,7 @@
     if (Currentbuf->firstLine == NULL)
 	return;
 
+    redrawCurrentLineIfNeeded(Currentbuf);
     for (i = 0; i < n; i++) {
 	pline = Currentbuf->currentLine;
 	ppos = Currentbuf->pos;
@@ -2556,6 +2722,7 @@
     Currentbuf->pos = 0;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 /* Go to the bottom of the line */
@@ -2569,6 +2736,7 @@
     Currentbuf->pos = Currentbuf->currentLine->len - 1;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 static int
@@ -2671,6 +2839,7 @@
     while (l != NULL) {
 	for (; i < l->len; i++) {
 	    if (l->propBuf[i] & PE_MARK) {
+                redrawCurrentLineIfNeeded(Currentbuf);
 		Currentbuf->currentLine = l;
 		Currentbuf->pos = i;
 		arrangeCursor(Currentbuf);
@@ -2705,6 +2874,7 @@
     while (l != NULL) {
 	for (; i >= 0; i--) {
 	    if (l->propBuf[i] & PE_MARK) {
+                redrawCurrentLineIfNeeded(Currentbuf);
 		Currentbuf->currentLine = l;
 		Currentbuf->pos = i;
 		arrangeCursor(Currentbuf);
@@ -3486,10 +3656,12 @@
 	hseq++;
     } while (an == NULL);
 
+    redrawCurrentLineIfNeeded(Currentbuf);
     gotoLine(Currentbuf, po->line);
     Currentbuf->pos = po->pos;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setForceRedrawEvent();
 }
 
 /* go to the last anchor */
@@ -3521,10 +3693,12 @@
 	hseq--;
     } while (an == NULL);
 
+    redrawCurrentLineIfNeeded(Currentbuf);
     gotoLine(Currentbuf, po->line);
     Currentbuf->pos = po->pos;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setForceRedrawEvent();
 }
 
 /* go to the next anchor */
@@ -3629,10 +3803,12 @@
     if (an == NULL || an->hseq < 0)
 	return;
     po = &hl->marks[an->hseq];
+    redrawCurrentLineIfNeeded(Currentbuf);
     gotoLine(Currentbuf, po->line);
     Currentbuf->pos = po->pos;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 /* go to the previous anchor */
@@ -3713,10 +3889,12 @@
     if (an == NULL || an->hseq < 0)
 	return;
     po = hl->marks + an->hseq;
+    redrawCurrentLineIfNeeded(Currentbuf);
     gotoLine(Currentbuf, po->line);
     Currentbuf->pos = po->pos;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 /* go to the next left/right anchor */
@@ -3769,10 +3947,12 @@
 
     if (pan == NULL)
 	return;
+    redrawCurrentLineIfNeeded(Currentbuf);
     gotoLine(Currentbuf, y);
     Currentbuf->pos = pan->start.pos;
     arrangeCursor(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setRedrawImageEvent();
 }
 
 /* go to the next downward/upward anchor */
@@ -3816,9 +3996,11 @@
 
     if (pan == NULL)
 	return;
+    redrawCurrentLineIfNeeded(Currentbuf);    
     gotoLine(Currentbuf, pan->start.line);
     arrangeLine(Currentbuf);
     displayBuffer(Currentbuf, B_NORMAL);
+    setForceRedrawEvent();
 }
 
 /* go to the next left anchor */
@@ -3873,6 +4055,7 @@
 	Currentbuf = buf;
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
+    setForceRedrawEvent();
 }
 
 /* go to the previous bufferr */
@@ -3891,6 +4074,7 @@
 	Currentbuf = buf;
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
+    setForceRedrawEvent();
 }
 
 static int
@@ -3965,6 +4149,7 @@
 	}
     }
     displayBuffer(Currentbuf, B_FORCE_REDRAW);
+    setForceRedrawEvent();
 }
 
 DEFUN(deletePrevBuf, DELETE_PREVBUF,
@@ -3975,6 +4160,12 @@
 	delBuffer(buf);
 }
 
+DEFUN(deleteBuf, DELETE_BUF,
+      "Delete current buffer (mainly for local-CGI)")
+{
+    delBuffer(Currentbuf);
+}
+
 static void
 cmd_loadURL(char *url, ParsedURL *current, char *referer, FormList *request)
 {
@@ -4030,6 +4221,43 @@
 }
 
 
+static char *
+inputURL(char *prompt)
+{
+    char *url = NULL;
+    ParsedURL p_url, *current;
+    Hist *hist = copyHist(URLHist);
+    Anchor *a;
+
+    current = baseURL(Currentbuf);
+    if (current) {
+        char *c_url = parsedURL2Str(current)->ptr;
+        if (DefaultURLString == DEFAULT_URL_CURRENT) {
+            url = c_url;
+            if (DecodeURL)
+                url = url_unquote_conv(url, 0);
+        }
+        else
+            pushHist(hist, c_url);
+    }
+    a = retrieveCurrentAnchor(Currentbuf);
+    if (a) {
+        char *a_url;
+        parseURL2(a->url, &p_url, current);
+        a_url = parsedURL2Str(&p_url)->ptr;
+        if (DefaultURLString == DEFAULT_URL_LINK) {
+            url = a_url;
+            if (DecodeURL)
+                url = url_unquote_conv(url, Currentbuf->document_charset);
+        }
+        else
+            pushHist(hist, a_url);
+    }
+    url = inputLineHist(prompt, url, IN_URL, hist);
+    if (url != NULL)
+        SKIP_BLANKS(url);
+    return url;
+}
 /* go to specified URL */
 static void
 goURL0(char *prompt, int relative)
@@ -4040,36 +4268,7 @@
 
     url = searchKeyData();
     if (url == NULL) {
-	Hist *hist = copyHist(URLHist);
-	Anchor *a;
-
-	current = baseURL(Currentbuf);
-	if (current) {
-	    char *c_url = parsedURL2Str(current)->ptr;
-	    if (DefaultURLString == DEFAULT_URL_CURRENT) {
-		url = c_url;
-		if (DecodeURL)
-		    url = url_unquote_conv(url, 0);
-	    }
-	    else
-		pushHist(hist, c_url);
-	}
-	a = retrieveCurrentAnchor(Currentbuf);
-	if (a) {
-	    char *a_url;
-	    parseURL2(a->url, &p_url, current);
-	    a_url = parsedURL2Str(&p_url)->ptr;
-	    if (DefaultURLString == DEFAULT_URL_LINK) {
-		url = a_url;
-		if (DecodeURL)
-		    url = url_unquote_conv(url, Currentbuf->document_charset);
-	    }
-	    else
-		pushHist(hist, a_url);
-	}
-	url = inputLineHist(prompt, url, IN_URL, hist);
-	if (url != NULL)
-	    SKIP_BLANKS(url);
+        url = inputURL(prompt);
     }
 #ifdef USE_M17N
     if (url != NULL) {
@@ -4176,7 +4375,10 @@
 }
 
 /* set an option */
-DEFUN(setOpt, SET_OPTION, "Set option")
+int setopt_verbose=FALSE;
+
+static
+void _setOpt(int verbose)
 {
     char *opt;
 
@@ -4193,11 +4395,23 @@
 	    return;
 	}
     }
+    setopt_verbose = verbose;
     if (set_param_option(opt))
-	sync_with_option();
+        sync_with_option();
+    setopt_verbose = FALSE;
     displayBuffer(Currentbuf, B_REDRAW_IMAGE);
 }
 
+DEFUN(setOpt, SET_OPTION, "Set option")
+{
+  _setOpt(FALSE);
+}
+
+DEFUN(vsetOpt, VSET_OPTION SETOPT, "Set option(verbose)")
+{
+  _setOpt(TRUE);
+}
+
 /* error message list */
 DEFUN(msgs, MSGS, "Display error messages")
 {
@@ -4392,7 +4606,7 @@
     file = searchKeyData();
     if (file == NULL || *file == '\0') {
 	/* FIXME: gettextize? */
-	qfile = inputLineHist("Save buffer to: ", NULL, IN_COMMAND, SaveHist);
+	qfile = inputLineHist(Sprintf("Save buffer to[%s]: ",CurrentDir)->ptr, NULL, IN_COMMAND, SaveHist);
 	if (qfile == NULL || *qfile == '\0') {
 	    displayBuffer(Currentbuf, B_NORMAL);
 	    return;
@@ -4451,6 +4665,23 @@
 }
 
 static void
+screen_register(char *str)
+{
+#if USE_SCREEN
+    static Str buf;
+    char *sty;
+#ifdef USE_BUFINFO
+    saveBufferInfo();
+#endif
+    sty = getenv("STY");
+    if (sty != NULL && *sty) {
+        buf = Sprintf("screen -S %s -X register . \"%s\"", sty, str);
+        system(buf->ptr);
+    }
+#endif
+}
+
+static void
 _peekURL(int only_img)
 {
 
@@ -4507,6 +4738,7 @@
     while (offset < s->length && p[offset] & PC_WCHAR2)
 	offset++;
 #endif
+    screen_register(&s->ptr[offset]);
     disp_message_nomouse(&s->ptr[offset], TRUE);
 }
 
@@ -4566,6 +4798,7 @@
     while (offset < s->length && p[offset] & PC_WCHAR2)
 	offset++;
 #endif
+    screen_register(&s->ptr[offset]);
     disp_message_nomouse(&s->ptr[offset], TRUE);
 }
 /* view HTML source */
@@ -4907,7 +5140,7 @@
 {
     char *p;
     int spos, epos;
-    p = getCurWord(Currentbuf, &spos, &epos, ":\"\'`<>()[]{}&|;*?$");
+    p = getCurWord(Currentbuf, &spos, &epos, ":\"\'`<>()[]{}\\");
     if (p == NULL)
 	return;
     reAnchorWord(Currentbuf, Currentbuf->currentLine, spos, epos);
@@ -5048,6 +5281,8 @@
     if (a == NULL)
 	return;
     parseURL2(a->url, &pu, baseURL(Currentbuf));
+    pushHashHist(URLHist, parsedURL2Str(&pu)->ptr);
+    displayBuffer(Currentbuf, B_NORMAL);
     invoke_browser(parsedURL2Str(&pu)->ptr);
 }
 
@@ -5100,6 +5335,22 @@
     displayBuffer(Currentbuf, B_REDRAW_IMAGE);
 }
 
+DEFUN(dispI2, REDRAW_IMAGE, "Redraw images(internal)")
+{
+#ifdef USE_GDKPIXBUF
+    displayBuffer(Currentbuf, B_NORMAL);
+    displayBuffer(Currentbuf, B_NORMAL);
+#endif
+}
+
+DEFUN(dispI4, FORCE_REDRAW, "Redraw images forcefully(internal)")
+{
+#ifdef USE_GDKPIXBUF
+    displayBuffer(Currentbuf, B_REDRAW_IMAGE);
+    displayBuffer(Currentbuf, B_FORCE_REDRAW);
+#endif
+}
+
 DEFUN(stopI, STOP_IMAGE, "Stop loading and drawing of images")
 {
     if (!activeImage)
@@ -5442,6 +5693,7 @@
 	return;
     else if (mouse_action.cursorX >= Currentbuf->rootX &&
 	     mouse_action.cursorY < LASTLINE) {
+        redrawCurrentLineIfNeeded(Currentbuf);
 	cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX,
 		 mouse_action.cursorY - Currentbuf->rootY);
     }
@@ -5555,7 +5807,7 @@
     return &p[b];
 }
 
-static char *
+char *
 GetWord(Buffer *buf)
 {
     int b, e;
@@ -5622,6 +5874,7 @@
 
     if (buf == NULL)
 	return;
+    set_environ("W3M_SEARCH_STRING", SearchString);
     if (buf != prev_buf) {
 	set_environ("W3M_SOURCEFILE", buf->sourcefile);
 	set_environ("W3M_FILENAME", buf->filename);
@@ -5758,7 +6011,10 @@
     exit(i);
 }
 
-DEFUN(execCmd, COMMAND, "Execute w3m command(s)")
+int CmdAbort = FALSE;
+
+static void
+_execCmd(char *defs)
 {
     char *data, *p;
     int cmd;
@@ -5766,12 +6022,13 @@
     CurrentKeyData = NULL;	/* not allowed in w3m-control: */
     data = searchKeyData();
     if (data == NULL || *data == '\0') {
-	data = inputStrHist("command [; ...]: ", "", TextHist);
+	data = inputStrHist("command [; ...]: ", defs, CommandHist);
 	if (data == NULL) {
 	    displayBuffer(Currentbuf, B_NORMAL);
 	    return;
 	}
     }
+    CmdAbort = FALSE;
     /* data: FUNC [DATA] [; FUNC [DATA] ...] */
     while (*data) {
 	SKIP_BLANKS(data);
@@ -5780,6 +6037,11 @@
 	    continue;
 	}
 	p = getWord(&data);
+        {
+          char *x;
+          for(x=p; *x; x++) 
+            *x=TOUPPER(*x);
+        }
 	cmd = getFuncList(p);
 	if (cmd < 0)
 	    break;
@@ -5797,17 +6059,140 @@
 	    mouse_active();
 #endif
 	CurrentCmdData = NULL;
+        if (CmdAbort)
+            break;
     }
     displayBuffer(Currentbuf, B_NORMAL);
 }
 
+static char *
+getArg(char **str)
+{
+    char *p, *s;
+    int esc = 0;
+    Str tmp = Strnew();
+
+    p = *str;
+    SKIP_BLANKS(p);
+    for (; *p; p++) {
+        if (esc) {
+            if (*p == ';') {
+                Strcat_char(tmp, ';');
+                esc = 0;
+            }
+            else {
+                Strcat_char(tmp, '\\');
+                Strcat_char(tmp, *p);
+            }
+        } else if (*p == '\\')
+            esc = 1;
+        else if (*p == ';')
+            break;
+        else
+            Strcat_char(tmp, *p);
+    }
+    *str = p;
+    return tmp->ptr;
+}
+
+static void
+_execCmd2(char *defs)
+{
+    char *data, *p, *scmd;
+    int cmd;
+
+    CurrentKeyData = NULL;	/* not allowed in w3m-control: */
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+	data = inputStrHist("command [; ...]: ", defs, CommandHist);
+	if (data == NULL) {
+	    displayBuffer(Currentbuf, B_NORMAL);
+	    return;
+	}
+    }
+    CmdAbort = FALSE;
+    /* data: FUNC [DATA] [; FUNC [DATA] ...] */
+    while (*data) {
+	SKIP_BLANKS(data);
+	if (*data == ';') {
+	    data++;
+	    continue;
+	}
+	p = getWord(&data);
+        {
+          char *x;
+          for(x=p; *x; x++) 
+            *x=TOUPPER(*x);
+        }
+	cmd = getFuncList(p);
+        scmd = p;
+	p = getArg(&data);
+        if (w3m_debug)
+            fprintf(stderr, "arg = %s\n", p);
+        CurrentKey = -1;
+        CurrentKeyData = NULL;
+	if (cmd < 0) {          /* command_missing */
+            cmd = FUNCNAME_goURL;
+            CurrentCmdData = Sprintf("file:///cgi-bin/command_missing.cgi?%s%s%s",
+                                     url_quote(scmd),
+                                     (*p ? "%20" : ""),
+                                     (*p ? url_quote(p) : ""))->ptr;
+        } else {
+            CurrentCmdData = *p ? p : NULL;
+        }
+#ifdef USE_MOUSE
+        if (use_mouse)
+            mouse_inactive();
+#endif
+        w3mFuncList[cmd].func();
+#ifdef USE_MOUSE
+        if (use_mouse)
+            mouse_active();
+#endif
+        CurrentCmdData = NULL;
+        if (CmdAbort)
+            break;
+    }
+    displayBuffer(Currentbuf, B_NORMAL);
+}
+
+DEFUN(execCmd, COMMAND, "Execute w3m command(s)")
+{
+    _execCmd("");
+}
+
+DEFUN(colon, COLON, "Execute w3m command(s)")
+{
+    char *data;
+
+    CurrentKeyData = NULL;	/* not allowed in w3m-control: */
+    data = searchKeyData();
+    _execCmd(data);
+}
+
+DEFUN(execCmd2, COMMAND2, "Execute w3m command(s) (new parser)")
+{
+    _execCmd2("");
+}
+
+DEFUN(colon2, COLON2, "Execute w3m command(s) (new parser)")
+{
+    char *data;
+
+    CurrentKeyData = NULL;	/* not allowed in w3m-control: */
+    data = searchKeyData();
+    _execCmd2(data);
+}
+
+
+
 #ifdef USE_ALARM
 static MySignalHandler
 SigAlarm(SIGNAL_ARG)
 {
     char *data;
 
-    if (CurrentAlarm->sec > 0) {
+    if (CurrentAlarm->sec > 0 || CurrentAlarm->usec > 0) {
 	CurrentKey = -1;
 	CurrentKeyData = NULL;
 	CurrentCmdData = data = (char *)CurrentAlarm->data;
@@ -5823,6 +6208,7 @@
 	CurrentCmdData = NULL;
 	if (CurrentAlarm->status == AL_IMPLICIT_ONCE) {
 	    CurrentAlarm->sec = 0;
+	    CurrentAlarm->usec = 0;
 	    CurrentAlarm->status = AL_UNSET;
 	}
 	if (Currentbuf->event) {
@@ -5837,6 +6223,10 @@
 	    mySignal(SIGALRM, SigAlarm);
 	    alarm(CurrentAlarm->sec);
 	}
+	else if (CurrentAlarm->usec > 0) {
+	    mySignal(SIGALRM, SigAlarm);
+	    ualarm(CurrentAlarm->usec, 0);
+	}
     }
     SIGNAL_RETURN;
 }
@@ -5878,14 +6268,30 @@
 {
     if (event == NULL)
 	event = New(AlarmEvent);
+    event->usec = 0;
     event->sec = sec;
     event->status = status;
     event->cmd = cmd;
     event->data = data;
     return event;
 }
+
+AlarmEvent *
+setUAlarmEvent(AlarmEvent * event, int usec, short status, int cmd, void *data)
+{
+    if (event == NULL)
+	event = New(AlarmEvent);
+    event->usec = usec;
+    event->sec = 0;
+    event->status = status;
+    event->cmd = cmd;
+    event->data = data;
+    return event;
+}
+
 #endif
 
+
 DEFUN(reinit, REINIT, "Reload configuration files")
 {
     char *resource = searchKeyData();
@@ -6228,17 +6634,17 @@
 }
 
 static void
-tabURL0(TabBuffer * tab, char *prompt, int relative)
+tabURL0(TabBuffer * tab, char *prompt, int relative, int local)
 {
     Buffer *buf;
 
     if (tab == CurrentTab) {
-	goURL0(prompt, relative);
+	local ? _ldfile(prompt) : goURL0(prompt, relative);
 	return;
     }
     _newT();
     buf = Currentbuf;
-    goURL0(prompt, relative);
+    local ? _ldfile(prompt) : goURL0(prompt, relative);
     if (tab == NULL) {
 	if (buf != Currentbuf)
 	    delBuffer(buf);
@@ -6266,15 +6672,22 @@
 DEFUN(tabURL, TAB_GOTO, "Open URL on new tab")
 {
     tabURL0(prec_num ? numTab(PREC_NUM) : NULL,
-	    "Goto URL on new tab: ", FALSE);
+	    "Goto URL on new tab: ", FALSE, FALSE);
 }
 
 DEFUN(tabrURL, TAB_GOTO_RELATIVE, "Open relative URL on new tab")
 {
     tabURL0(prec_num ? numTab(PREC_NUM) : NULL,
-	    "Goto relative URL on new tab: ", TRUE);
+	    "Goto relative URL on new tab: ", TRUE, FALSE);
 }
 
+DEFUN(tabLd, TAB_LOAD, "Load local file on new tab")
+{
+    tabURL0(prec_num ? numTab(PREC_NUM) : NULL,
+	    Sprintf("(Load)Filename on new tab[%s]: ",CurrentDir)->ptr, FALSE, TRUE);
+}
+
+
 static void
 moveTab(TabBuffer * t, TabBuffer * t2, int right)
 {
@@ -6641,3 +7054,176 @@
     for (i = 0; i < PREC_NUM && b->next; i++, b = b->next) ;
     resetPos(b);
 }
+
+
+DEFUN(setNoRedraw, REDRAW_OFF, "Suppress redrawing")
+{
+    NoRedraw=TRUE;
+}
+
+DEFUN(unsetNoRedraw, REDRAW_ON, "Start redrawing")
+{
+    NoRedraw=FALSE;
+    displayBuffer(Currentbuf, B_NORMAL);
+}
+
+
+int
+_chdir_from_filename(char *filename)
+{
+  char *p, *dir;
+  struct stat st;
+  if (stat(filename, &st) < 0)
+    return 0;
+  if (S_ISDIR(st.st_mode)) 
+    dir = filename;
+  else
+    dir = mydirname(filename);
+  CurrentDir = dir;
+  chdir(dir);
+  return 1;
+}
+
+DEFUN(chDir, CHDIR CD, "Change current directory")
+{
+    char *data, *oldpwd;
+    Buffer *buf;
+
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+	data = inputStrHist("chdir: ", "", TextHist);
+	if (data == NULL) {
+	    displayBuffer(Currentbuf, B_NORMAL);
+	    return;
+	}
+    }
+    _chdir_from_filename(expandPath(data));
+}
+
+DEFUN(pushd, PUSHD, "Change current directory and execute command")
+{
+    char *data, *oldpwd;
+    Buffer *buf;
+
+    oldpwd = CurrentDir;
+    _chdir_from_filename(Currentbuf->filename);
+    
+    CurrentKeyData = NULL;	/* not allowed in w3m-control: */
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+	data = inputStrHist("command(pushd) [; ...]: ", "", TextHist);
+	if (data == NULL) {
+	    displayBuffer(Currentbuf, B_NORMAL);
+	    return;
+	}
+    }
+    pushEvent(FUNCNAME_execCmd, data);
+    pushEvent(FUNCNAME_chDir, oldpwd);
+}
+
+DEFUN(inputStrCmd, INPUT, "Input Strings")
+{
+    char *data, *p, *input;
+    int index=0;
+
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+        return;
+    }
+    /* data: sString  ;fFilename: ;.... */
+    //while (*data) {
+    if (w3m_debug)
+        fprintf(stderr,"data0=[%s]\n",data);
+    p=strtok(data, ";");
+    while(p!=NULL) {
+        if (w3m_debug)
+            fprintf(stderr, "p=[%s] data=[%s]\n", p, data);
+        if (*p) {
+            char c;
+            char *w3m_input = Sprintf("W3M_INPUT%d",index)->ptr;
+            char *def_str = NULL;
+        retry:
+            switch(c=(*p++)) {
+            case 'd':
+                def_str = getenv(w3m_input);
+                goto retry;
+            case 's':             /* String */
+                input = inputStrHist(p, def_str, TextHist);
+                break;
+            case 'f':             /* load filename */
+                input = inputFilenameHist(p, def_str, LoadHist);
+                break;
+            case 'u':             /* URL */
+                input = inputURL(p); /* todo:default */
+                break;
+            case '!':           /* shell command */
+                input = inputLineHist(Sprintf("%s[%s]: ",p,CurrentDir)->ptr, def_str, IN_COMMAND, ShellHist);
+                break;
+            case 'w':           /* save filename */
+                input = inputLineHist(Sprintf("%s[%s]: ",p,CurrentDir)->ptr, def_str, IN_COMMAND, SaveHist);
+                if (input != NULL) {
+                  if (input[0] != '/' && input[0] != '~')
+                      input = Strnew_m_charp(CurrentDir, "/", input, NULL)->ptr;
+                  if (checkOverWrite(input) < 0)
+                      input = NULL;
+                }
+                break;
+            case '0': case '1': case '2': case '3': case '4': 
+            case '5': case '6': case '7': case '8': case '9':
+                input = inputStrHist(p, def_str, UserHist[c-'0']);
+                break;
+            }
+            if (input == NULL) {
+                CmdAbort = TRUE;
+                break;
+            }
+                
+            set_environ(w3m_input, input);
+            index++;
+        }
+        p = strtok(NULL, ";");
+    }
+}
+
+DEFUN(dispMsg, MSG, "Display message")
+{
+    char *data;
+
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+        return;
+    }
+    disp_message(data, FALSE);
+}
+
+DEFUN(dispI3, REDRAW_IMAGES, "Redraw images for animation gifs(internal)")
+{
+    displayBuffer(Currentbuf, B_NORMAL);
+}
+
+DEFUN(setAnimateAlarm, ANIMATE, "Set alarm")
+{
+#ifdef USE_ALARM
+    char *data;
+    int millisec = 0, cmd = -1;
+
+    CurrentKeyData = NULL;	/* not allowed in w3m-control: */
+    data = searchKeyData();
+    if (data == NULL || *data == '\0') {
+	data = inputStrHist("(Alarm)millisec: ", "", TextHist);
+	if (data == NULL) {
+            setAlarmEvent(&DefaultAlarm, 0, AL_UNSET, FUNCNAME_nulcmd, NULL);
+	    displayBuffer(Currentbuf, B_NORMAL);
+	    return;
+	}
+    }
+    if (*data != '\0') {
+	millisec = atoi(getWord(&data));
+    }
+    cmd = FUNCNAME_dispI3;
+    data = NULL;
+    setUAlarmEvent(&DefaultAlarm, millisec*1000, AL_IMPLICIT, cmd, data);
+    displayBuffer(Currentbuf, B_NORMAL);
+#endif
+}  
+
diff -u /tmp/w3m/map.c /m/home/rubikitch/src/w3m/map.c
--- /tmp/w3m/map.c	2003-09-25 03:49:00.000000000 +0900
+++ /m/home/rubikitch/src/w3m/map.c	2007-10-23 08:35:25.000000000 +0900
@@ -522,6 +522,8 @@
 /* 
  * information of current page and link 
  */
+extern char *GetWord(Buffer *buf);
+
 Buffer *
 page_info_panel(Buffer *buf)
 {
@@ -561,7 +563,11 @@
 		   "<tr valign=top><td nowrap>Document Type<td>",
 		   buf->real_type ? html_quote(buf->real_type) : "unknown",
 		   "<tr valign=top><td nowrap>Last Modified<td>",
-		   html_quote(last_modified(buf)), NULL);
+		   html_quote(last_modified(buf)),
+                   "<tr valign=top><td nowrap>Filename<td>",
+                   html_quote(buf->filename ? buf->filename : ""),
+                   "<tr valign=top><tr nowrap>Sourcefile<td>",
+                   html_quote(buf->sourcefile ? buf->sourcefile : ""), NULL);
 #ifdef USE_M17N
     if (buf->document_charset != InnerCharset) {
 	list = wc_get_ces_list();
@@ -630,7 +636,25 @@
 #endif
 
     append_link_info(buf, tmp, buf->linklist);
-
+    {
+      Line *l;
+      l = buf->currentLine;
+
+      if (l) {
+        Strcat_charp(tmp, "<hr width=50%><h1>Current Position information</h1><pre>\n");
+        char *s = GetWord(buf);
+
+        Strcat_m_charp(tmp, "<table cellpadding=0>",
+                       "<tr valign=top><td nowrap>Current Word<td>",
+                       html_quote(s ? s : ""),
+                       "<tr valign=top><td nowrap>Current Line<td>",
+                       Sprintf("%d", l->real_linenumber)->ptr,
+                       "<tr valign=top><td nowrap>Current Column<td>",
+                       Sprintf("%d", buf->currentColumn + buf->cursorX + 1)->ptr, NULL);
+        Strcat_charp(tmp, "</table>\n");
+        Strcat_charp(tmp, "</pre>\n");
+      }
+    }
     if (buf->document_header != NULL) {
 	Strcat_charp(tmp, "<hr width=50%><h1>Header information</h1><pre>\n");
 	for (ti = buf->document_header->first; ti != NULL; ti = ti->next)
@@ -654,6 +678,20 @@
 	Strcat_m_charp(tmp, "<h1>SSL certificate</h1><pre>\n",
 		       html_quote(buf->ssl_certificate), "</pre>\n", NULL);
 #endif
+    {
+      int i;
+      Strcat_charp(tmp, "<hr width=50%><h1>Last Input information</h1><pre>\n");
+      Strcat_charp(tmp, "<table cellpadding=0>");
+
+      for(i=0;i<5;i++){
+        Str env;
+        env = Sprintf("W3M_INPUT%d", i);
+        Strcat_m_charp(tmp, "<tr valign=top><td nowrap>", env->ptr, "<td>",
+                       getenv(env->ptr), NULL);
+      }
+      Strcat_charp(tmp, "</table>\n");
+      Strcat_charp(tmp, "</pre>\n");
+    }
   end:
     Strcat_charp(tmp, "</body></html>");
     newbuf = loadHTMLString(tmp);
共通の下位ディレクトリー: /tmp/w3m/poと/m/home/rubikitch/src/w3m/po
diff -u /tmp/w3m/proto.h /m/home/rubikitch/src/w3m/proto.h
--- /tmp/w3m/proto.h	2006-04-07 22:21:12.000000000 +0900
+++ /m/home/rubikitch/src/w3m/proto.h	2007-10-23 08:35:25.000000000 +0900
@@ -17,11 +17,15 @@
 extern void ctrCsrH(void);
 extern void rdrwSc(void);
 extern void srchfor(void);
+extern void srchfor2(void);
 extern void isrchfor(void);
 extern void srchbak(void);
+extern void srchbak2(void);
 extern void isrchbak(void);
 extern void srchnxt(void);
 extern void srchprv(void);
+extern void srchnxtfore(void);
+extern void srchnxtback(void);
 extern void shiftl(void);
 extern void shiftr(void);
 extern void col1R(void);
@@ -31,6 +35,7 @@
 extern void pipesh(void);
 extern void readsh(void);
 extern void execsh(void);
+extern void execsh2(void);
 extern void ldfile(void);
 extern void ldhelp(void);
 extern void movL(void);
@@ -77,6 +82,7 @@
 extern void prevBf(void);
 extern void backBf(void);
 extern void deletePrevBuf(void);
+extern void deleteBuf(void);
 extern void goURL(void);
 extern void gorURL(void);
 extern void ldBmark(void);
@@ -285,6 +291,7 @@
 extern int readBufferCache(Buffer *buf);
 extern void fmTerm(void);
 extern void fmInit(void);
+extern void redrawCurrentLineIfNeeded(Buffer *buf);
 extern void displayBuffer(Buffer *buf, int mode);
 extern void addChar(char c, Lineprop mode);
 #ifdef USE_M17N
@@ -781,4 +788,22 @@
 long lrand48(void);
 #endif
 
+extern void setNoRedraw(void);
+extern void unsetNoRedraw(void);
+
+
 #include "indep.h"
+extern void pushd(void);
+extern void chDir(void);
+extern void inputStrCmd(void);
+extern void tabLd(void);
+extern void dispMsg(void);
+extern void vsetOpt(void);
+extern void set_params_environ(void);
+extern void colon(void);
+extern void dispI2(void);
+extern void setAnimateAlarm(void);
+extern void dispI3(void);
+extern void dispI4(void);
+extern void execCmd2(void);
+extern void colon2(void);
diff -u /tmp/w3m/rc.c /m/home/rubikitch/src/w3m/rc.c
--- /tmp/w3m/rc.c	2007-05-24 00:06:06.000000000 +0900
+++ /m/home/rubikitch/src/w3m/rc.c	2007-10-23 08:35:25.000000000 +0900
@@ -120,6 +120,9 @@
 #define CMT_DROOT       N_("Directory corresponding to / (document root)")
 #define CMT_PDROOT      N_("Directory corresponding to /~user")
 #define CMT_CGIBIN      N_("Directory corresponding to /cgi-bin")
+#define CMT_DDIR        N_("Default download directory")
+#define CMT_TMPDIR      N_("Temporary directory")
+
 #define CMT_CONFIRM_QQ  N_("Confirm when quitting with q")
 #define CMT_CLOSE_TAB_BACK N_("Close tab if buffer is last when back")
 #ifdef USE_MARK
@@ -232,6 +235,7 @@
 #endif
 
 #define CMT_KEYMAP_FILE N_("keymap file")
+#define CMT_HL_LINE N_("Underline current line")
 
 #define PI_TEXT    0
 #define PI_ONOFF   1
@@ -398,6 +402,7 @@
      CMT_LABEL_TOPLINE, NULL},
     {"nextpage_topline", P_INT, PI_ONOFF, (void *)&nextpage_topline,
      CMT_NEXTPAGE_TOPLINE, NULL},
+    {"hl_line", P_CHARINT, PI_ONOFF, (void *)&hl_line, CMT_HL_LINE, NULL},
     {NULL, 0, 0, NULL, NULL, NULL},
 };
 
@@ -515,6 +520,8 @@
      (void *)&personal_document_root, CMT_PDROOT, NULL},
     {"cgi_bin", P_STRING, PI_TEXT, (void *)&cgi_bin, CMT_CGIBIN, NULL},
     {"index_file", P_STRING, PI_TEXT, (void *)&index_file, CMT_IFILE, NULL},
+    {"download_dir", P_STRING, PI_TEXT, (void *)&download_dir, CMT_DDIR, NULL},
+    {"tmp_dir", P_STRING, PI_TEXT, (void *)&tmp_dir, CMT_TMPDIR, NULL},
     {NULL, 0, 0, NULL, NULL, NULL},
 };
 
@@ -870,6 +877,24 @@
     }
 }
 
+void
+set_params_environ(void)
+{
+    int i, j, l;
+    char *t = NULL;
+    char *cmt;
+
+    for (j = 0; sections[j].name != NULL; j++) {
+        cmt = sections[j].name;
+	i = 0;
+	while (sections[j].params[i].name) {
+            set_environ(Sprintf("W3M_%s",sections[j].params[i].name)->ptr,
+                        to_str(&sections[j].params[i])->ptr);
+	    i++;
+	}
+    }
+}
+
 int
 str_to_bool(char *value, int old)
 {
@@ -939,6 +964,8 @@
 }
 #endif
 
+extern int setopt_verbose;
+
 static int
 set_param(char *name, char *value)
 {
@@ -1005,6 +1032,8 @@
 	    *(double *)p->varptr = ppc;
 	break;
     }
+    if (setopt_verbose)
+      disp_message(Sprintf("SET_OPTION: %s=%s",name,to_str(p)->ptr)->ptr, FALSE);
     return 1;
 }
 
共通の下位ディレクトリー: /tmp/w3m/scriptsと/m/home/rubikitch/src/w3m/scripts
diff -u /tmp/w3m/search.c /m/home/rubikitch/src/w3m/search.c
--- /tmp/w3m/search.c	2004-03-24 01:44:02.000000000 +0900
+++ /m/home/rubikitch/src/w3m/search.c	2007-10-23 08:35:25.000000000 +0900
@@ -6,10 +6,10 @@
 #include <unistd.h>
 
 static void
-set_mark(Line *l, int pos, int epos)
+set_smark(Line *l, int pos, int epos)
 {
     for (; pos < epos && pos < l->size; pos++)
-	l->propBuf[pos] |= PE_MARK;
+	l->propBuf[pos] |= PE_SMARK;
 }
 
 #ifdef USE_MIGEMO
@@ -141,7 +141,7 @@
 	if (l != buf->currentLine)
 	    gotoLine(buf, l->linenumber);
 	arrangeCursor(buf);
-	set_mark(l, pos, pos + last - first);
+	set_smark(l, pos, pos + last - first);
 	return SR_FOUND;
     }
     for (l = l->next;; l = l->next) {
@@ -179,7 +179,7 @@
 	    buf->currentLine = l;
 	    gotoLine(buf, l->linenumber);
 	    arrangeCursor(buf);
-	    set_mark(l, pos, pos + last - first);
+	    set_smark(l, pos, pos + last - first);
 	    return SR_FOUND | (wrapped ? SR_WRAPPED : 0);
 	}
 	if (wrapped && l == begin)	/* no match */
@@ -258,7 +258,7 @@
 	    if (l != buf->currentLine)
 		gotoLine(buf, l->linenumber);
 	    arrangeCursor(buf);
-	    set_mark(l, pos, pos + found_last - found);
+	    set_smark(l, pos, pos + found_last - found);
 	    return SR_FOUND;
 	}
     }
@@ -297,7 +297,7 @@
 	    buf->pos = pos;
 	    gotoLine(buf, l->linenumber);
 	    arrangeCursor(buf);
-	    set_mark(l, pos, pos + found_last - found);
+	    set_smark(l, pos, pos + found_last - found);
 	    return SR_FOUND | (wrapped ? SR_WRAPPED : 0);
 	}
 	if (wrapped && l == begin)	/* no match */
diff -u /tmp/w3m/table.c /m/home/rubikitch/src/w3m/table.c
--- /tmp/w3m/table.c	2007-05-23 22:07:44.000000000 +0900
+++ /m/home/rubikitch/src/w3m/table.c	2007-10-23 08:35:25.000000000 +0900
@@ -2753,8 +2753,18 @@
 	    break;
     case HTML_DT:
     case HTML_DD:
-    case HTML_H:
-    case HTML_N_H:
+    case HTML_H1:
+    case HTML_H2:
+    case HTML_H3:
+    case HTML_H4:
+    case HTML_H5:
+    case HTML_H6:
+    case HTML_N_H1:
+    case HTML_N_H2:
+    case HTML_N_H3:
+    case HTML_N_H4:
+    case HTML_N_H5:
+    case HTML_N_H6:
     case HTML_LI:
     case HTML_PRE:
     case HTML_N_PRE:
diff -u /tmp/w3m/tagtable.tab /m/home/rubikitch/src/w3m/tagtable.tab
--- /tmp/w3m/tagtable.tab	2006-12-10 20:06:12.000000000 +0900
+++ /m/home/rubikitch/src/w3m/tagtable.tab	2007-10-23 08:35:25.000000000 +0900
@@ -5,18 +5,18 @@
 /a		HTML_N_A
 _id		HTML_NOP
 hr		HTML_HR
-h1		HTML_H
-h2		HTML_H
-h3		HTML_H
-h4		HTML_H
-h5		HTML_H
-h6		HTML_H
-/h1		HTML_N_H
-/h2		HTML_N_H
-/h3		HTML_N_H
-/h4		HTML_N_H
-/h5		HTML_N_H
-/h6		HTML_N_H
+h1		HTML_H1
+h2		HTML_H2
+h3		HTML_H3
+h4		HTML_H4
+h5		HTML_H5
+h6		HTML_H6
+/h1		HTML_N_H1
+/h2		HTML_N_H2
+/h3		HTML_N_H3
+/h4		HTML_N_H4
+/h5		HTML_N_H5
+/h6		HTML_N_H6
 p		HTML_P
 br		HTML_BR
 b		HTML_B
@@ -161,6 +161,10 @@
 bgsound		HTML_BGSOUND
 applet		HTML_APPLET
 embed		HTML_EMBED
+iframe          HTML_IFRAME
+/iframe         HTML_N_IFRAME
+object          HTML_OBJECT
+/object          HTML_N_OBJECT
 internal	HTML_INTERNAL
 /internal	HTML_N_INTERNAL
 select_int	HTML_SELECT_INT
diff -u /tmp/w3m/terms.c /m/home/rubikitch/src/w3m/terms.c
--- /tmp/w3m/terms.c	2007-06-07 19:54:10.000000000 +0900
+++ /m/home/rubikitch/src/w3m/terms.c	2007-10-23 08:35:25.000000000 +0900
@@ -494,7 +494,7 @@
     {W3M_TERM_INFO("rxvt", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
     {W3M_TERM_INFO("Eterm", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
     {W3M_TERM_INFO("mlterm", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
-    {W3M_TERM_INFO("screen", SCREEN_TITLE, 0)},
+    {W3M_TERM_INFO("screen", XTERM_TITLE, (NEED_XTERM_ON|NEED_XTERM_OFF))},
 #ifdef __CYGWIN__
     {W3M_TERM_INFO("cygwin", CYGWIN_TITLE, (NEED_CYGWIN_ON|NEED_CYGWIN_OFF))},
 #endif
diff -u /tmp/w3m/url.c /m/home/rubikitch/src/w3m/url.c
--- /tmp/w3m/url.c	2007-05-24 00:06:06.000000000 +0900
+++ /m/home/rubikitch/src/w3m/url.c	2007-10-23 08:35:25.000000000 +0900
@@ -1532,6 +1532,7 @@
     switch (pu->scheme) {
     case SCM_LOCAL:
     case SCM_LOCAL_CGI:
+        set_params_environ();
 	if (request && request->body)
 	    /* local CGI: POST */
 	    uf.stream = newFileStream(localcgi_post(pu->real_file, pu->query,
共通の下位ディレクトリー: /tmp/w3m/w3m-docと/m/home/rubikitch/src/w3m/w3m-doc
/m/home/rubikitch/src/w3mだけに発見: w3m-hl-line.jpg
共通の下位ディレクトリー: /tmp/w3m/w3mimgと/m/home/rubikitch/src/w3m/w3mimg
