[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] insert HTML tag in the line which was warned
From: |
Shigio Yamaguchi |
Subject: |
Re: [PATCH] insert HTML tag in the line which was warned |
Date: |
Thu, 20 Mar 2003 09:08:29 +0900 |
Committed but by a little different way.
Additionally to your patch, I have added config variable 'colorize_warned_line'
and added two definitions to the configuratio file like this:
[gtags.conf]
:warned_line_begin=<SPAN STYLE="background-color\:yellow">:\
:warned_line_end=</SPAN>:\
You can enjoy colorize warning line with the following configuration:
[gtags.conf]
+-------------------------
|htags:\
| :colorize_warned_line:\
Thank you!
> This patch includes the change in
> http://mail.gnu.org/archive/html/bug-global/2003-03/msg00020.html
> and
> http://mail.gnu.org/archive/html/bug-global/2003-03/msg00023.html
>
>
>
> Index: gtags.conf
> ===================================================================
> RCS file: /cvsroot/global/global/gtags.conf,v
> retrieving revision 1.14
> diff -u -r1.14 gtags.conf
> --- gtags.conf 5 Jul 2002 07:16:46 -0000 1.14
> +++ gtags.conf 11 Mar 2003 15:50:52 -0000
> @@ -116,6 +116,7 @@
> :comment_begin=<I><FONT COLOR=green>:comment_end=</FONT></I>:\
> :sharp_begin=<FONT COLOR=darkred>:sharp_end=</FONT>:\
> :brace_begin=<FONT COLOR=blue>:brace_end=</FONT>:\
> + :warned_line_begin=<SPAN STYLE="background-color\:yellow">:warned_line_
end=</SPAN>:
> :reserved_begin=<B>:reserved_end=</B>:script_alias=/cgi-bin/:\
> :ncol#4:tabs#8:normal_suffix=html:gzipped_suffix=ghtml:\
> :definition_header=after:
> Index: htags/htags.in
> ===================================================================
> RCS file: /cvsroot/global/global/htags/htags.in,v
> retrieving revision 1.99
> diff -u -r1.99 htags.in
> --- htags/htags.in 6 Mar 2003 15:09:13 -0000 1.99
> +++ htags/htags.in 11 Mar 2003 15:50:53 -0000
> @@ -99,6 +99,8 @@
> $'reserved_end = '</B>';
> $'position_begin = '<FONT COLOR=gray>';
> $'position_end = '</FONT>';
> +$'warned_line_begin = '';
> +$'warned_line_end = '';
> #
> # Reserved words for C and Java are hard coded.
> # (configuration parameter 'reserved_words' was deleted.)
> @@ -266,6 +268,10 @@
> $'position_begin = $var1;
> $'position_end = $var2;
> }
> +if (($var1 = &'getconf('warned_line_begin')) && ($var2 = &'getconf('warned_l
ine_end'))) {
> + $'warned_line_begin = $var1;
> + $'warned_line_end = $var2;
> +}
> # insert htags_options into the head of ARGSV array.
> if (($var1 = &'getconf('htags_options'))) {
> $'htags_options = $var1;
> @@ -2096,6 +2102,7 @@
> local($define_line) = 0;
> local(@links) = ();
> local($count) = 0;
> + local($warned) = 0;
>
> print "<A NAME=$.>";
> for (; int($LNO) == $.; ($LNO, $TAG, $TYPE) = &anchor'n
ext()) {
> @@ -2152,7 +2159,10 @@
> $count++;
> push(@links, $href);
> } else {
> - print STDERR "Error: $f
ile $LNO $TAG($TYPE) tag must exist.\n" if ($'wflag);
> + if ($'wflag) {
> + print STDERR "W
arning: $file $LNO $TAG($TYPE) tag must exist.\n";
> + $warned = 1;
> + }
> }
> } else {
> if (s/\b$TAG([ \t\004]*\()/\005
$count\005$1/ || s/\b$TAG\b/\005$count\005/ || s/\b_$TAG\b/_\005
> $count\005/)
> @@ -2160,19 +2170,26 @@
> $count++;
> push(@links, $href);
> } else {
> - print STDERR "Error: $f
ile $LNO $TAG($TYPE) tag must exist.\n" if ($'wflag);
> + if ($'wflag) {
> + print STDERR "W
arning: $file $LNO $TAG($TYPE) tag must exist.\n";
> + $warned = 1;
> + }
> }
> }
> } else {
> - print STDERR "Warning: $file $LNO $TAG(
$TYPE) found but not referred.\n" if ($'wflag);
> + if (($TYPE eq 'R' || $TYPE eq 'Y') && $
'wflag) {
> + print STDERR "Warning: $file $L
NO $TAG($TYPE) found but not defined.\n";
> + $warned = 1;
> + }
> }
> }
> # implant links
> local($s);
> for ($count = 0; @links; $count++) {
> $s = shift @links;
> - unless (s/\005$count\005/$s/) {
> - print STDERR "Error: $file $LNO $TAG($T
YPE) tag must exist.\n" if ($'wflag);
> + unless (s/\005$count\005/$s/ && $'wflag) {
> + print STDERR "Warning: $file $LNO $TAG(
$TYPE) tag must exist.\n";
> + $warned = 1;
> }
> }
> s/\016/$'brace_begin/g;
> @@ -2182,6 +2199,10 @@
> s/\022/$'reserved_begin/g;
> s/\023/$'reserved_end/g;
> &unprotect_line();
> + if ($warned) {
> + s/^/$'warned_line_begin/;
> + s/$/$'warned_line_end/;
> + }
> # make guide
> if ($define_line) {
> $guide = '';
> Index: htags/manual.in
> ===================================================================
> RCS file: /cvsroot/global/global/htags/manual.in,v
> retrieving revision 1.32
> diff -u -r1.32 manual.in
> --- htags/manual.in 19 Oct 2002 04:05:23 -0000 1.32
> +++ htags/manual.in 11 Mar 2003 15:50:53 -0000
> @@ -172,6 +172,10 @@
> Begin tag for posiotion mark. The default is '<FONT COLOR=gray>
'.
> @address@hidden(string)}
> End tag for posiotion mark. The default is '</FONT>'.
> + @address@hidden(string)}
> + Begin tag for line which htags warned. The default is ''.
> + @address@hidden(string)}
> + End tag for line which htags warned. The default is ''.
> @address@hidden(number)}
> Columns of line number. The default is 4.
> @address@hidden(number)}
>
> ----
> Hideki IWAMOTO address@hidden
>
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-global
>
>
--
Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3