[docs] xmldocs - docelic modified bin/refs-autogen

docs at icdevgroup.org docs at icdevgroup.org
Wed Oct 20 13:02:33 EDT 2004


User:      docelic
Date:      2004-10-20 17:02:33 GMT
Modified:  bin      refs-autogen
Log:
- bin/refs-autogen: fixes regarding line number display in source
  contexts. Now, files we show completely only have "Lines: $num" instead
  of generic and inappropriate "Line $num (context shows ....)".

Revision  Changes    Path
1.51      +10 -4     xmldocs/bin/refs-autogen


rev 1.51, prev_rev 1.50
Index: refs-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/refs-autogen,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- refs-autogen	20 Oct 2004 16:48:02 -0000	1.50
+++ refs-autogen	20 Oct 2004 17:02:33 -0000	1.51
@@ -242,15 +242,16 @@
 					my $loc = $$ctx{file};
 					
 					my ( $cstart, $cend, $ctxmeta ) = ("", "", "");
+					my $all = 0; # Showing all for an item?
 					#if (0) { use Data::Dumper; print Dumper $ctx; sleep 10; }
 					# WE SHOW ONLY PART OF CONTEXT FOR THOSE
-					$ctxmeta = "<sbr/>Line $ln";
-					if ( $gkey !~ /(tag|conf)$/ ) {
+					if ( $gkey !~ /(tag|conf|filter)$/ ) {
 						$cstart = $$ctx{lnum}-$$ctx{ctxpre};
 						$cend = $$ctx{lnum}+$$ctx{ctxpost};
 
 					} else {
 						# WE SHOW ALL FOR THOSE
+						$all++;
 						$cstart = $$ctx{ctxs} || 1;
 						$cend = $cstart + scalar @{$$ctx{ctx}}-1;
 						$cstart == 1 and $cend -= 1;
@@ -260,7 +261,12 @@
 					$cstart <= 0 and $cstart = 1;
 					$cend > @{ $$ctx{ctx} } and $cend = @{ $$ctx{ctx} }-1;
 
-					$ctxmeta .= " (context shows lines " . ( $cstart . "-" .  $cend );
+					if ( ! $all ) {
+						$ctxmeta = "<sbr/>Line $ln";
+						$ctxmeta .= " (context shows lines " . ( $cstart . "-" .  $cend );
+					} else {
+						$ctxmeta = "<sbr/>Lines: $cend";
+					}
 					# XXX - eliminate negative numbers in source context spans
 					# ( 0-6 == OK, -4-6 != OK )
 					#if ( $cstart < 0 ) {
@@ -271,7 +277,7 @@
 					if ( $$ctx{funclnum} ) {
 						$ctxmeta .= " in $$ctx{func}():$$ctx{funclnum}" ;
 					}
-					$ctxmeta .= ")";
+					$ctxmeta .= ")" unless $all;
 					my $r = $hash{revision}{$plf}->[0];
 					my $d = $hash{revision}{$plf}->[1];
 					my $revinfo = "";








More information about the docs mailing list