From: "Francesco Potortì" <pot@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 20629@debbugs.gnu.org
Subject: bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files.
Date: Sat, 30 May 2015 21:35:14 +0200 [thread overview]
Message-ID: <E1YymXK-0003o3-R0@tucano.isti.cnr.it> (raw)
In-Reply-To: <5569FDCA.4030801@yandex.ru>
>> Sorry if I don't closely follow the discussion (I do not know all the
>> internals of etags.el), and consequently sorry if I am misanderstanding
>> anything. In that case, please discard my observations below.
>
>I don't think I'm misunderstanding: it's mainly a problem of terminology.
I was fearing *I* was the one who misunderstands :)
Anyway, probably it's also a terminology problem, and that's my fault
too. You are right that what I called "implicit / explicit tag" is in
fact an "implicit / explicit tag name". Sorry about that, it has been a
long time since I worked on that. In the etc/ETAGS.EBNF file you can
read the complete description that I made at that time. Here it is:
======================= 2) discussion of tag names =======================
- WHAT ARE TAG NAMES
Tag lines in a tags file are usually made from the above defined pattern
and by an optional tag name. The pattern is a string that is searched
in the source file to find the tagged line.
- WHY TAG NAMES ARE GOOD
When a user looks for a tag, Emacs first compares the tag with the tag
names contained in the tags file. If no match is found, Emacs compares
the tag with the patterns. The tag name is then the preferred way to
look for tags in the tags file, because when the tag name is present
Emacs can find a tag faster and more accurately. These tag names are
part of tag lines in the tags file, so we call them "explicit".
- WHY IMPLICIT TAG NAMES ARE EVEN BETTER
When a tag line has no name, but a name can be deduced from the pattern,
we say that the tag line has an implicit tag name. Often tag names are
redundant; this happens when the name of a tag is an easily guessable
substring of the tag pattern. We define a set of rules to decide
whether it is possible to deduce the tag name from the pattern, and make
an unnamed tag in those cases. The name deduced from the pattern of an
unnamed tag is the implicit name of that tag.
When the user looks for a tag, and Emacs finds no explicit tag names
that match it, Emacs then looks for an tag whose implicit tag name
matches the request. etags.c uses implicit tag names when possible, in
order to reduce the size of the tags file.
An implicit tag name is deduced from the pattern by discarding the
last character if it is one of ` \f\t\n\r()=,;', then taking all the
rightmost consecutive characters in the pattern which are not one of
those.
===================== end of discussion of tag names =====================
>> Implicit tags are semantically the same as explicit tags. Whether a tag
>> is implicit or explicit, it's only a matter of efficiency in building
>> the TAGS file. For a given TAGS file entry, there is either no tag, or
>> an implicit tag, or an explicit tag.
>
>Maybe we should say that there's always a "tag name", for a given entry.
>And we can determine it by looking at the tag name field, or, in the
>absence of it, implicitly determine from the pattern.
Right. But thereés more. We can have either:
1) explicit tag name
2) implicit tag name (unnamed tag whose name can be deduced from pattern)
3) no tag name (unnamed tag)
In some languages, like C++ and derived, most tags are named. In
others, most are unnamed, usually in the simplest languages.
>It's easier to call the value of the tag name field an "explicit tag",
>and the value that we can derive from the pattern an "implicit tag". And
>if the explicit tag is present, naturally they'll be different.
Well, no. Or at least, it's not how they were intended. The parser
finds a tag, then it decides whether it should be named or not and in
the latter case, depending on the tag and the language, what is the
appropriate tag name. If the tag should have no name, an unnamed tag is
created. If the tag should be named, and if the name can be deduced
from the pattern, then it creates no explicit name (thus creating an
unnamed tag with an implicit tag name), else it creates a tag with an
explicit name.
The idea is that when you look for a tag, you first look for the
(explicit) names in the tag, which are contained in the relevant field.
If you find one, it's done. If it is not, you can try and see if the
tag you are looking for matches an implicit name. If you find one, it's
done. If you don't, then you should try and match the unnamed patterns
(in practice, I think that etags.el tries and matches all the patterns).
So there is no such thing as an explicit name plus an implicit name for
the same tag. Or at least, it was never intended to work like that.
>> The latter two cases should be
>> treated exactly alike by whichever program is reading the TAGS file.
>> Nor is it possible that for a given entry its implicit tag does not
>> match its explicit tag, because either the former or the latter are
>> present, not both.
>
>This confirms that we should always disregard implicit tag when the
>explicit tag is present.
I suppose you can view it like this so. In my language, I would say
that when an explicit name is present, we have found a name. That's
all, no thing like an "implicit tag name" is there to be disregarded.
next prev parent reply other threads:[~2015-05-30 19:35 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 5:57 bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files Jan D.
2015-05-23 11:54 ` Jan Djärv
2015-05-23 12:04 ` Dmitry Gutov
2015-05-23 12:15 ` Jan Djärv
2015-05-23 12:18 ` Dmitry Gutov
2015-05-23 12:28 ` Jan Djärv
2015-05-23 12:39 ` Dmitry Gutov
2015-05-23 13:51 ` Eli Zaretskii
2015-05-23 13:50 ` Eli Zaretskii
2015-05-23 14:46 ` Eli Zaretskii
2015-05-23 15:56 ` Eli Zaretskii
2015-05-25 15:15 ` Eli Zaretskii
2015-05-25 21:17 ` Dmitry Gutov
2015-05-26 2:35 ` Eli Zaretskii
2015-05-26 10:16 ` Dmitry Gutov
2015-05-26 15:06 ` Eli Zaretskii
2015-05-26 19:00 ` Dmitry Gutov
2015-05-26 19:23 ` Eli Zaretskii
2015-05-26 21:01 ` Stefan Monnier
2015-05-28 11:54 ` Dmitry Gutov
2015-05-28 12:59 ` Dmitry Gutov
2015-05-26 23:56 ` Dmitry Gutov
2015-05-27 14:28 ` Eli Zaretskii
2015-05-27 15:28 ` Dmitry Gutov
2015-05-27 15:46 ` Eli Zaretskii
2015-05-27 15:54 ` Dmitry Gutov
2015-05-27 16:23 ` Eli Zaretskii
2015-05-27 23:50 ` Dmitry Gutov
2015-05-28 2:50 ` Eli Zaretskii
2015-05-28 10:22 ` Dmitry Gutov
2015-05-28 14:56 ` Eli Zaretskii
2015-05-28 15:32 ` Dmitry Gutov
2015-05-28 16:34 ` Eli Zaretskii
2015-05-29 0:09 ` Dmitry Gutov
2015-05-29 6:48 ` Glenn Morris
2015-05-29 8:09 ` Eli Zaretskii
2015-05-29 12:34 ` Francesco Potortì
2015-05-29 9:27 ` Dmitry Gutov
2015-05-29 8:12 ` Eli Zaretskii
2015-05-29 14:05 ` Dmitry Gutov
2015-05-29 16:51 ` Stefan Monnier
2015-05-29 17:12 ` Dmitry Gutov
2015-05-29 19:19 ` Stefan Monnier
2015-05-29 20:33 ` Dmitry Gutov
2015-05-29 21:41 ` etags completion table (was: bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files) Stefan Monnier
2015-05-29 23:58 ` etags completion table Dmitry Gutov
2015-05-30 4:00 ` Stefan Monnier
2015-05-30 11:50 ` Dmitry Gutov
2015-05-31 0:57 ` Stefan Monnier
2015-05-29 18:28 ` bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files Eli Zaretskii
2015-05-29 20:01 ` Dmitry Gutov
2015-05-29 20:35 ` Eli Zaretskii
2015-05-29 22:36 ` Dmitry Gutov
2015-05-30 6:52 ` Eli Zaretskii
2015-05-30 12:52 ` Dmitry Gutov
2015-05-30 13:03 ` Eli Zaretskii
2015-05-30 14:21 ` Francesco Potortì
2015-05-30 14:44 ` Dmitry Gutov
2015-05-28 11:35 ` Francesco Potortì
2015-05-28 11:46 ` Dmitry Gutov
2015-05-28 12:16 ` Francesco Potortì
2015-05-28 13:00 ` Dmitry Gutov
2015-05-28 13:12 ` Francesco Potortì
2015-05-28 15:04 ` Eli Zaretskii
2015-05-28 15:14 ` Francesco Potortì
2015-05-28 15:29 ` Francesco Potortì
2015-05-29 17:13 ` Dmitry Gutov
2015-05-30 12:06 ` Eli Zaretskii
2015-05-30 12:30 ` Dmitry Gutov
2015-05-30 12:46 ` Eli Zaretskii
2015-05-30 13:42 ` Dmitry Gutov
2015-05-30 14:31 ` Eli Zaretskii
2015-05-30 15:03 ` Dmitry Gutov
2015-05-30 16:37 ` Eli Zaretskii
2015-05-30 17:46 ` Dmitry Gutov
2015-05-30 18:46 ` Eli Zaretskii
2015-05-30 19:42 ` Dmitry Gutov
2015-11-26 3:23 ` Dmitry Gutov
2015-11-26 15:43 ` Eli Zaretskii
2015-11-26 16:12 ` Dmitry Gutov
2015-11-26 16:32 ` Eli Zaretskii
2015-11-27 3:54 ` Dmitry Gutov
2016-03-19 18:45 ` Eli Zaretskii
2015-05-30 17:01 ` Francesco Potortì
2015-05-30 18:13 ` Dmitry Gutov
2015-05-30 18:42 ` Eli Zaretskii
2015-05-30 19:35 ` Francesco Potortì [this message]
2015-05-30 20:04 ` Dmitry Gutov
2015-05-30 22:35 ` Francesco Potortì
2015-05-31 0:34 ` Dmitry Gutov
2015-05-31 21:46 ` bug#20629: Fwd: bug#20703: 24.4; Stack overflow in regexp matcher Francesco Potortì
2015-05-31 22:20 ` Dmitry Gutov
2015-05-31 22:40 ` Francesco Potortì
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1YymXK-0003o3-R0@tucano.isti.cnr.it \
--to=pot@gnu.org \
--cc=20629@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.