applied suggested fix for xhv_array sizing, with portability tweaks
[p5sagit/p5-mst-13.2.git] / emacs / ptags
index 8831988..d8d4926 100755 (executable)
@@ -22,17 +22,20 @@ topfiles="`echo ' ' *.y *.c *.h ' ' | sed 's/ embed.h / /'`"
 subdirfiles="`( find ./*/* -name '*.[cy]' -print | sort ; find ./*/* -name '*.[hH]' -print | sort )`"
 xsfiles="`find . -name '*.xs' -print | sort`"
 
-# What is `etags -d'?
+# etags -d : process defineds too (default now)
 
 # These are example lines for global variables and PP-code:
 ## IEXT SV *       Iparsehook;
 ## IEXT char *     Isplitstr IINIT(" ");
 ## dEXTCONST char rcsid[] = "perl.c\nPatch level: ###\n";
 ## PP(pp_const)
+## PERLVARI(Grsfp, PerlIO *, Nullfp)
+## PERLVAR(cvcache,      HV *)
 
 set x  -d -l c \
        -r '/[dI]?EXT\(CONST\)?[ \t*]+\([a-zA-Z_0-9]+[ \t*]+\)*\([a-zA-Z_0-9]+\)[ \t]*\($\|;\|\[\|[ \t]I+NIT[ \t]*(\|\/\*\)/\3/' \
        -r '/IEXT[ \t][^\/]*[ \t*]I\([a-zA-Z_][a-zA-Z_0-9]*\)[\[; \t]/\1/'  \
+       -r '/PERLVAR[a-zA-Z_0-9]*[ \t]*([ \t]*[GIT]?\([a-zA-Z_][a-zA-Z_0-9]*\)[ \t]*,/\1/'  \
        -r '/PP[ \t]*([ \t]*\([^ \t()]*\)[ \t]*)/\1/'
 
 shift
@@ -46,6 +49,18 @@ etags -o TAGS.tmp \
 etags -o TAGS.tmp -a "$@" $topfiles
 etags -o TAGS.tmp -a -D -l none -r '/#define.*\t\(Perl_.*\)/\1/' embed.h
 
+perl -w014pe 'if (s/^( [^\n\x7F\x1]*\b # 1:   TAG group
+                      (\w+)            #   2: word
+                      [^\w\x7X\x1\n]*  #      Most anything
+                      \x7F             #      End of description
+                    )
+                    (\d+,\d+\n)        # 3:   TAGS Trail
+                  /$1$2\x1$3/mgx) {    # Add specific marking
+                 $chars = chomp;
+                 s/^((\n.+,)\d+)/ $2 . (length($_) - length($1) - 1) /e;
+                 $_ .= ("\f" x $chars);
+             }' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
+
 # Add MODULE lines to TAG files (to be postprocessed later),
 #   and BOOT: lines (in DynaLoader processed twice?)
 
@@ -68,7 +83,7 @@ etags -o TAGS.tmp -a -d -l c \
 
 etags -o TAGS.tmp -a "$@" $subdirfiles
 
-if ! test -f emacs/cperl-mode.elc ; then
+if test ! -f emacs/cperl-mode.elc ; then
     ( cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el )
 fi