commit 0684b11ec49e587043d87c9d799f180965801e5d
parent cb761902970ea449c0faa3c3cb969d06bd6488a6
Author: ukai <ukai>
Date: Wed, 4 Dec 2002 17:00:44 +0000
[w3m-dev 03523] Re: del/ins
* file.c (HTMLtagproc1): check displayInsDel, RB_DEL
* fm.h (RB_DEL): added
(displayInsDel): added
* rc.c (CMT_DISP_INS_DEL): added
(display_ins_del): added
* table.c (feed_table_tag): check displayInsDel, TBLM_DEL
* table.h (TBLM_DEL): added
(TBLM_ANCHOR): renum
(struct table_mode): unsigned int pre_mode
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat:
6 files changed, 63 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,18 @@
2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03523] Re: del/ins
+ * file.c (HTMLtagproc1): check displayInsDel, RB_DEL
+ * fm.h (RB_DEL): added
+ (displayInsDel): added
+ * rc.c (CMT_DISP_INS_DEL): added
+ (display_ins_del): added
+ * table.c (feed_table_tag): check displayInsDel, TBLM_DEL
+ * table.h (TBLM_DEL): added
+ (TBLM_ANCHOR): renum
+ (struct table_mode): unsigned int pre_mode
+
+2002-12-05 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03522] newline around <pre>..</pre>
* file.c (HTMLtagproc1): break before <pre>/after </pre> if necessary
diff --git a/file.c b/file.c
@@ -4713,27 +4713,38 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_AREA:
return 0;
case HTML_DEL:
- HTMLlineproc1("<U>[DEL:</U>", h_env);
+ if (displayInsDel)
+ HTMLlineproc1("<U>[DEL:</U>", h_env);
+ else
+ obuf->flag |= RB_DEL;
return 1;
case HTML_N_DEL:
- HTMLlineproc1("<U>:DEL]</U>", h_env);
+ if (displayInsDel)
+ HTMLlineproc1("<U>:DEL]</U>", h_env);
+ else
+ obuf->flag &= ~RB_DEL;
return 1;
case HTML_INS:
- HTMLlineproc1("<U>[INS:</U>", h_env);
+ if (displayInsDel)
+ HTMLlineproc1("<U>[INS:</U>", h_env);
return 1;
case HTML_N_INS:
- HTMLlineproc1("<U>:INS]</U>", h_env);
+ if (displayInsDel)
+ HTMLlineproc1("<U>:INS]</U>", h_env);
return 1;
case HTML_SUP:
- HTMLlineproc1("^", h_env);
+ if (!(obuf->flag & RB_DEL))
+ HTMLlineproc1("^", h_env);
return 1;
case HTML_N_SUP:
return 1;
case HTML_SUB:
- HTMLlineproc1("[", h_env);
+ if (!(obuf->flag & RB_DEL))
+ HTMLlineproc1("[", h_env);
return 1;
case HTML_N_SUB:
- HTMLlineproc1("]", h_env);
+ if (!(obuf->flag & RB_DEL))
+ HTMLlineproc1("]", h_env);
return 1;
case HTML_FONT:
case HTML_N_FONT:
@@ -5677,6 +5688,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
continue;
}
+ if (obuf->flag & RB_DEL)
+ continue;
while (*str) {
mode = get_mctype(str);
delta = get_mclen(mode);
diff --git a/fm.h b/fm.h
@@ -582,6 +582,7 @@ struct readbuffer {
#ifdef FORMAT_NICE
#define RB_FILL 0x80000
#endif /* FORMAT_NICE */
+#define RB_DEL 0x100000
#define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
#define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }
@@ -932,6 +933,7 @@ global int UseDictCommand init(FALSE);
global char *DictCommand init("file:///$LIB/w3mdict" CGI_EXTENSION);
#endif /* USE_DICT */
global int ignore_null_img_alt init(TRUE);
+global int displayInsDel init(TRUE);
global int FoldTextarea init(FALSE);
#define DEFAULT_URL_EMPTY 0
#define DEFAULT_URL_CURRENT 1
diff --git a/rc.c b/rc.c
@@ -81,6 +81,7 @@ static char *config_file = NULL;
#define CMT_MULTICOL "ファイル名のマルチカラム表示"
#define CMT_ALT_ENTITY "エンティティを ASCII の代替表現で表す"
#define CMT_FOLD_TEXTAREA "TEXTAREA の行を折り返して表示"
+#define CMT_DISP_INS_DEL "DEL タグの内容を表示する。"
#define CMT_COLOR "カラー表示"
#define CMT_B_COLOR "文字の色"
#define CMT_A_COLOR "アンカーの色"
@@ -235,6 +236,7 @@ static char *config_file = NULL;
#define CMT_MULTICOL "Display file names in multi-column format"
#define CMT_ALT_ENTITY "Use ASCII equivalents to display entities"
#define CMT_FOLD_TEXTAREA "Fold lines in TEXTAREA"
+#define CMT_DISP_INS_DEL "Display INS and DEL tag"
#define CMT_COLOR "Display with color"
#define CMT_B_COLOR "Color of normal character"
#define CMT_A_COLOR "Color of anchor"
@@ -524,6 +526,8 @@ struct param_ptr params1[] = {
NULL},
{"fold_textarea", P_CHARINT, PI_ONOFF, (void *)&FoldTextarea,
CMT_FOLD_TEXTAREA, NULL},
+ {"display_ins_del", P_INT, PI_ONOFF, (void *)&displayInsDel,
+ CMT_DISP_INS_DEL, NULL},
{"ignore_null_img_alt", P_INT, PI_ONOFF, (void *)&ignore_null_img_alt,
CMT_IGNORE_NULL_IMG_ALT, NULL},
{"view_unseenobject", P_INT, PI_ONOFF, (void *)&view_unseenobject,
diff --git a/table.c b/table.c
@@ -2969,14 +2969,29 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
suspend_or_pushdata(tbl, line);
break;
case HTML_DEL:
+ if (displayInsDel)
+ feed_table_inline_tag(tbl, line, mode, 5); /* [DEL: */
+ else
+ mode->pre_mode |= TBLM_DEL;
+ break;
case HTML_N_DEL:
+ if (displayInsDel)
+ feed_table_inline_tag(tbl, line, mode, 5); /* :DEL] */
+ else
+ mode->pre_mode &= ~TBLM_DEL;
+ break;
case HTML_INS:
case HTML_N_INS:
+ if (displayInsDel)
+ feed_table_inline_tag(tbl, line, mode, 5); /* [INS:, :INS] */
+ break;
case HTML_SUP:
- case HTML_N_SUP:
case HTML_SUB:
case HTML_N_SUB:
- feed_table_inline_tag(tbl, line, mode, 5);
+ if (!(mode->pre_mode & TBLM_DEL))
+ feed_table_inline_tag(tbl, line, mode, 1); /* ^, [, ] */
+ break;
+ case HTML_N_SUP:
break;
case HTML_TABLE_ALT:
id = -1;
@@ -3102,6 +3117,10 @@ feed_table(struct table *tbl, char *line, struct table_mode *mode,
return -1;
}
}
+ else {
+ if (mode->pre_mode & TBLM_DEL)
+ return -1;
+ }
if (mode->caption) {
Strcat_charp(tbl->caption, line);
return -1;
diff --git a/table.h b/table.h
@@ -124,12 +124,13 @@ struct table {
#define TBLM_INSELECT RB_INSELECT
#define TBLM_PREMODE (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_INTXTA)
#define TBLM_SPECIAL (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_NOBR)
-#define TBLM_ANCHOR 0x100000
+#define TBLM_DEL RB_DEL
+#define TBLM_ANCHOR 0x200000
#define uchar unsigned char
#define ushort unsigned short
struct table_mode {
- ushort pre_mode;
+ unsigned int pre_mode;
char indent_level;
char caption;
short nobr_offset;