aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-12-04 17:00:44 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-12-04 17:00:44 +0000
commit650e90ad7502f25da1b0883950eca7cadba3ea86 (patch)
tree399233ce3a8a88ea140ec5e9ca129113c3cfe8e4
parent[w3m-dev 03522] newline around <pre>..</pre> (diff)
downloadw3m-650e90ad7502f25da1b0883950eca7cadba3ea86.tar.gz
w3m-650e90ad7502f25da1b0883950eca7cadba3ea86.zip
[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>
-rw-r--r--ChangeLog15
-rw-r--r--file.c29
-rw-r--r--fm.h4
-rw-r--r--rc.c6
-rw-r--r--table.c25
-rw-r--r--table.h7
6 files changed, 69 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 85978a2..2a13b43 100644
--- 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
@@ -5420,4 +5433,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.585 2002/12/04 16:55:04 ukai Exp $
+$Id: ChangeLog,v 1.586 2002/12/04 17:00:44 ukai Exp $
diff --git a/file.c b/file.c
index 8b17e05..0830b7a 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.144 2002/12/04 16:55:06 ukai Exp $ */
+/* $Id: file.c,v 1.145 2002/12/04 17:00:48 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -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
index 268b9cd..f6abd9c 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.91 2002/12/03 15:35:10 ukai Exp $ */
+/* $Id: fm.h,v 1.92 2002/12/04 17:00:50 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -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
index 17cba1c..d94a77c 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.68 2002/11/26 18:03:28 ukai Exp $ */
+/* $Id: rc.c,v 1.69 2002/12/04 17:00:51 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -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
index 5065eaf..c032b2f 100644
--- a/table.c
+++ b/table.c
@@ -1,4 +1,4 @@
-/* $Id: table.c,v 1.34 2002/12/03 15:49:56 ukai Exp $ */
+/* $Id: table.c,v 1.35 2002/12/04 17:00:53 ukai Exp $ */
/*
* HTML table
*/
@@ -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
index f001315..8d7761f 100644
--- a/table.h
+++ b/table.h
@@ -1,4 +1,4 @@
-/* $Id: table.h,v 1.9 2002/12/03 15:35:11 ukai Exp $ */
+/* $Id: table.h,v 1.10 2002/12/04 17:00:54 ukai Exp $ */
#if (defined(MESCHACH) && !defined(MATRIX))
#define MATRIX
#endif /* (defined(MESCHACH) && !defined(MATRIX)) */
@@ -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;