# Move autogenerated less-informative files to the end:
# Hard to do embed.h and embedvar.h in one sweep:
-topfiles="`echo ' ' *.y *.c *.h ' ' | sed 's/ \(embed\(var\|\)\.h\|obj\(pp\|XSUB\)\.h\|globals\.c\) \(\(embedvar\|objpp\).h \|\)/ /g'`"
+topfiles="`echo ' ' *.y *.c *.h ' ' | sed 's/ / /g' | sed 's/ embedvar\.h\|embed\.h\|obj\(pp\|XSUB\)\.h\|\(globals\|perlapi\)\.c / /g'`"
subdirs="`find ./* -maxdepth 0 -type d`"
subdirfiles="`find $subdirs -name '*.[cy]' -print | sort`"
subdirfiles1="`find $subdirs -name '*.[hH]' -print | sort`"
}' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
+# Now remove these Perl_, add empty- and perl_-flavors:
+perl -w014pe 'if (s/^(Perl_ # 1: First group
+ (\w+) \( # 2: Stripped name
+ \x7F # End of description
+ ) # End of description
+ (\d+,\d+\n) # 3: TAGS Trail
+ /$1$3$1$2\x01$3$1perl_$2\x01$3/mgx) { # Repeat, add empty and perl_ flavors
+ $chars = chomp;
+ s/^((\n.+,)\d+)/ $2 . (length($_) - length($1) - 1) /e;
+ $_ .= ("\f" x $chars);
+ }' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
+
+# Now remove these S_, add empty-flavor:
+perl -w014pe 'if (s/^(S_ # 1: First group
+ (\w+) \( # 2: Stripped name
+ \x7F # End of description
+ ) # End of description
+ (\d+,\d+\n) # 3: TAGS Trail
+ /$1$3$1$2\x01$3/mgx) { # Repeat, add empty_ flavor
+ $chars = chomp;
+ s/^((\n.+,)\d+)/ $2 . (length($_) - length($1) - 1) /e;
+ $_ .= ("\f" x $chars);
+ }' TAGS.tmp > TAGS.tm1 && mv TAGS.tm1 TAGS.tmp
etags -o TAGS.tmp -a -D -l none -r '/#define.*\t\(Perl_.*\)/\1/' embed.h
-etags -o TAGS.tmp -a globals.c embedvar.h objXSUB.h objpp.h
+etags -o TAGS.tmp -a globals.c embedvar.h objXSUB.h perlapi.c
+# The above processes created a lot of descriptions with an
+# an explicitly specified tag. Such descriptions have higher
+# precedence than descriptions without an explicitely specified tag.
+# To restore the justice, make all the descriptions explicit.
perl -w014pe 'if (s/^( [^\n\x7F\x01]*\b # 1: TAG group
(\w+) # 2: word
[^\w\x7F\x01\n]* # Most anything