On Пн, Mar 18, 2019 at 06:34:00, Eli Zaretskii <address@hidden> wrote:
Date: Sun, 17 Mar 2019 23:44:28 +0300
From: Konstantin Kharlamov <address@hidden>
> But that's incorrect: a tag in a tags table always begins at the
> beginning of a line, so it must be a search anchored at the
> of the line. And in selective-display mode ^M counts as the
> of a line.
Great, now that we established that part, to reply your question
don't care about the beginnging of the line let me quote my other
> The pattern that this functions searches for determines the tag
uniquely. But here's a catch: no programming language creates
entities (ones that end up in the tag), based only on trailing
I.e. "foo()" and " foo() " always refer to the same thing.
I'm not talking about whitespace. I'm talking about a tags table
that names a symbol 'foobar', say. If you search for a tag "bar" and
do not anchor the search at the beginning of a line, you will decide
that "bar" is present on the "foobar" line, although it really isn't.
Not exactly. Here's an alternative bad situation: let's say you do
anchor the text, and you search for tag 'foo'. And… you still match
Actually, it's interesting, that such name clashes are possible right
now: let's say we have:
If source code is intact, you should get FOO. But if code changed,
then emacs tries to find where did it go, and may as well stumble
So, I suggest an improvement to my patch: how about we
1. anchor the regexp to the end of the line also
2. replace trailing space with "any whitespace" regex '\s-*'