[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25071: 26.0.50; Various Forth related improvements for etags
From: |
Helmut Eller |
Subject: |
bug#25071: 26.0.50; Various Forth related improvements for etags |
Date: |
Wed, 30 Nov 2016 17:55:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
On Wed, Nov 30 2016, Eli Zaretskii wrote:
>> With the patch, etags creates explicit tag names. That works better in
>> combination with tag-exact-match-p.
>
> Can you explain more about this? Explicit tag names bloat the TAGS
> files, so other languages don't use that by default, except where
> really needed.
Yes, the TAGS file becomes at most twice as big. That's a minor
disadvantage that I'm happy to trade for even tiny improvements in
precision.
I also note that, Gforth (the GNU Forth implementation) ships a TAGS
file for the built-in definitions with explicit tag names (usually
installed in /usr/share/gforth/<version>/TAGS). They use the Gforth
compiler, not etags, to create this TAGS file. Obviously they aren't
bothered by the bloat either.
> Could it be that only some tags need to be written as
> explicit, e.g. because they contain some special characters?
Yes, that's the main reason. E.g. with the old version a source file
test.fth with this content:
: (foo) 123 ;
produced this TAGS file:
test.fth,17
: (foo)(foo.1,0
Hmm, it already created explicit tag names before. But with "(foo" as
name, which is wrong. The name should be "(foo)".
In case your are not familiar with Forth syntax: names in Forth are
separated by whitespace and can contain "(", ")", "," or other
non-whitespace characters. A word in parentheses like "(foo)" is a
widely used naming convention for internal/auxiliary definitions.
The old version of etags.c used get_tag which uses notinname to find the
end of the name, but that excludes ")", which is wrong for Forth.
> Also, it sounds like you send a patch wrt emacs-25 branch; if so,
> please rebase on master, since that is where the patch will be pushed
> eventually. The test files are in a different place on master.
The patch is against master, but I wrote the wrong filenames in the
changelog, because I copied part of it from an old commit message.
Helmut