Subject: Re: bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 May 2015 17:31:21 +0300

> Cc: [email-masked]
> From: Dmitry Gutov <[email-masked]>
> Date: Sat, 30 May 2015 16:42:57 +0300
> 
> On 05/30/2015 03:46 PM, Eli Zaretskii wrote:
> 
> > It seemed to show both qualified and unqualified names, AFAICS.
> 
> I'd rather the comparison was made when TAGS is using 2-lines-per-item. 

Feel free to describe a full recipe for comparing.  I needed to guess
what you wanted me to test; I'd be happy to just follow instructions
and report back what I saw.

> - Like you mentioned, it's not always that qualified name occurs in the 
> pattern. Sometimes it's creates using curly braces and such, and thus 
> can only occur in an explicit tag name (which the discussed patch won't 
> account for). Thus, some qualified names would be present in 
> completions, and some won't. This is bad.

Do you have an actual example?  AFAIU, this shouldn't happen: etags
only decides that an explicit tag name is unneeded when it can be
deduced from the pattern.  So if the explicit tag is not in TAGS, it
means etags.el can find it in the pattern.  (Qualified tag names that
are constructed by etags are never in the pattern, so they will always
get explicit tag names.)

> >> Err, these changes are orthogonal, if not to say complete opposites. If
> >> there are two lines in TAGS for each item, no change to
> >> etags-tags-completion-table should be necessary.
> >
> > The question still stands.
> 
> It's only the question of the default behavior that's still undecided. 

Yes, but I'd like to make a decision before making the change for
placing 2 entries, so that the number of backward-incompatible changes
could be minimized.

> > But tag-implicit-name-match-p is called after tag-exact-match-p, so
> > the latter cannot be the fallback for the former.
> 
> I'm not sure what you mean. Why fallback?

Because if tag-exact-match-p finds a match, tag-implicit-name-match-p
will not be invoked, AFAIU.

> Consider this: if the explicit tag name is present, then the tag name we 
> can guess from the pattern implicitly is _incorrect_, so it's wrong to 
> match it.

And AFAIU we don't, because the match methods are invoked in order,
until one of them yields a match.

> For instance, visit lisp/TAGS and try to navigate to "'edit-abbrevs-map" 
> (yes, including a quote). There will be a match, but it was in fact a 
> faulty search: an Elisp identifier can't include a quote.

Which is why there's an explicit tag there.  But I'm afraid I don't
see what you meant to demonstrate by this example.  Which code will
look for 'edit-abbrevs-map, and under what circumstances?

> It's harder to present a realistic case of a user looking for one thing 
> and getting another, but the point is, is the Etags parser decided that 
> the implicit tag doesn't match the explicit tag, we should ignore the 
> former (because we don't really know the way they mismatch).

I think we already do.