commit ee625eef9163df87eb4d463c6372eb57fe074089
parent 34acb4dd88e658abd9b181b0c5bf87d060bb5eaa
Author: ukai <ukai>
Date: Fri, 29 Mar 2002 16:39:37 +0000
[w3m-dev 03160] Re: "ttp:" is marked instead of "http:" by MARL_URL
* NEWS:
* anchor.c (reAnchorAny): check MarkAllPages
* fm.h (MarkAllPages): added
* rc.c (CMT_MARK_ALL_PAGES): added
(mark_all_pages): added
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat:
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,14 @@
2002-03-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03160] Re: "ttp:" is marked instead of "http:" by MARL_URL
+ * NEWS:
+ * anchor.c (reAnchorAny): check MarkAllPages
+ * fm.h (MarkAllPages): added
+ * rc.c (CMT_MARK_ALL_PAGES): added
+ (mark_all_pages): added
+
+2002-03-30 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03159] "ttp:" is marked instead of "http:" by MARL_URL
* main.c (chkURLBuffer): check internal URLs first
diff --git a/NEWS b/NEWS
@@ -1,5 +1,6 @@
w3m 0.4?
+* rc: mark_all_pages
* configure: -mandir
* func: COMMAND
* -title option: set buffer name to terminal title
diff --git a/anchor.c b/anchor.c
@@ -295,7 +295,9 @@ reAnchorAny(Buffer *buf, char *re,
if ((re = regexCompile(re, 1)) != NULL) {
return re;
}
- for (l = buf->firstLine; l != NULL; l = l->next) {
+ for (l = MarkAllPages ? buf->firstLine : buf->topLine; l != NULL &&
+ (MarkAllPages || l->linenumber < buf->topLine->linenumber + LASTLINE);
+ l = l->next) {
p = l->lineBuf;
for (;;) {
if (regexMatch(p, &l->lineBuf[l->len] - p, p == l->lineBuf) == 1) {
diff --git a/fm.h b/fm.h
@@ -866,6 +866,7 @@ global int FoldTextarea init(FALSE);
#define DEFAULT_URL_CURRENT 1
#define DEFAULT_URL_LINK 2
global int DefaultURLString init(DEFAULT_URL_EMPTY);
+global int MarkAllPages init(FALSE);
#ifdef USE_MIGEMO
global int use_migemo init(FALSE);
diff --git a/rc.c b/rc.c
@@ -138,6 +138,7 @@ static char *config_file = NULL;
#define CMT_ACCEPTLANG "受けつける言語(Accept-Language:)"
#define CMT_DOCUMENTCODE "文書の文字コード"
#define CMT_SYSTEMCODE "システムの文字コード"
+#define CMT_MARK_ALL_PAGES "全てのページのURL風の文字列をリンクにする"
#define CMT_WRAP "折り返し検索"
#define CMT_VIEW_UNSEENOBJECTS "背景画像等へのリンクを作る"
#ifdef __EMX__
@@ -272,6 +273,7 @@ static char *config_file = NULL;
#define CMT_ACCEPTLANG "Accept-Language"
/* #define CMT_DOCUMENTCODE "Document Charset" */
/* #define CMT_SYSTEMCODE "System Kanji Code" */
+#define CMT_MARK_ALL_PAGES "Mark URL-like strings as anchors in all pages"
#define CMT_WRAP "Wrap search"
#define CMT_VIEW_UNSEENOBJECTS "Display unseenobjects (e.g. bgimage) tag"
#ifdef __EMX__
@@ -539,6 +541,8 @@ struct param_ptr params3[] = {
{"vi_prec_num", P_INT, PI_ONOFF, (void *)&vi_prec_num, CMT_VI_PREC_NUM,
NULL},
#endif
+ {"mark_all_pages", P_INT, PI_ONOFF, (void *)&MarkAllPages,
+ CMT_MARK_ALL_PAGES, NULL},
{"wrap_search", P_INT, PI_ONOFF, (void *)&WrapDefault, CMT_WRAP, NULL},
{"ignorecase_search", P_INT, PI_ONOFF, (void *)&IgnoreCase,
CMT_IGNORE_CASE, NULL},