From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 2/3] lisp/progmodes/etags.el don't (forward-char) as it's overriden next line Date: Mon, 18 Mar 2019 12:43:16 +0300 Message-ID: <1552902196.12639.1@yandex.ru> References: <20190316015314.2335-1-Hi-Angel@yandex.ru> <20190316015314.2335-2-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100304"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 18 10:57:00 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5p0t-000Pzy-O1 for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 10:56:59 +0100 Original-Received: from localhost ([127.0.0.1]:38613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5p0s-00057r-DN for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 05:56:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5onl-00044q-JH for emacs-devel@gnu.org; Mon, 18 Mar 2019 05:43:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5onk-0006Wo-C7 for emacs-devel@gnu.org; Mon, 18 Mar 2019 05:43:25 -0400 Original-Received: from forward104o.mail.yandex.net ([2a02:6b8:0:1a2d::607]:44284) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5onh-0006VR-NR; Mon, 18 Mar 2019 05:43:22 -0400 Original-Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward104o.mail.yandex.net (Yandex) with ESMTP id A92D9941958; Mon, 18 Mar 2019 12:43:18 +0300 (MSK) Original-Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MlrWkk1xZd-hIEqEbqB; Mon, 18 Mar 2019 12:43:18 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1552902198; bh=zf1s0vvpjGFeQ1cQqTD9Bk9y/7IuiogtRN8Qz7UJbE8=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=PmwcOURfJsZ2Wd/0keRx2WXQ3Oep/V8POeS7SA47HGGSxHrKonaWJMwED3V22Bt9T yDwlZ/s2LEVMGN1S05wkPqonUu9JY5Yy7OON5hJ6yz5VqtcExPCGBlvq632evYqQmO VDfX0W0ZS6XH//UQeS4bU/jER4rFay7Z+oD7J6/A= Authentication-Results: mxback4j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id DQY2AWyAxG-hHvCxwir; Mon, 18 Mar 2019 12:43:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) In-Reply-To: <838sxcx3dj.fsf@gnu.org> X-Mailer: =?UTF-8?Q?geary=2F=C3=8E=C2=B2=2Dtesting=2Dbran?= =?UTF-8?Q?ch=7Eg4db93c55?= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:1a2d::607 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234317 Archived-At: On =CF=ED, Mar 18, 2019 at 06:34:00, Eli Zaretskii wrote: >> Date: Sun, 17 Mar 2019 23:44:28 +0300 >> From: Konstantin Kharlamov >> Cc: emacs-devel@gnu.org >>=20 >> > 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=20 >> beginning >> > of the line. And in selective-display mode ^M counts as the=20 >> beginning >> > of a line. >>=20 >> Great, now that we established that part, to reply your question=20 >> why we >> don't care about the beginnging of the line let me quote my other=20 >> mail: >>=20 >> > The pattern that this functions searches for determines the tag >> uniquely. But here's a catch: no programming language creates=20 >> distinc >> entities (ones that end up in the tag), based only on trailing=20 >> space. >> I.e. "foo()" and " foo() " always refer to the same thing. >=20 > I'm not talking about whitespace. I'm talking about a tags table file > 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. > Right? Not exactly. Here's an alternative bad situation: let's say you do=20 anchor the text, and you search for tag 'foo'. And=85 you still match=20 'foobar'! Actually, it's interesting, that such name clashes are possible right=20 now: let's say we have: #define FOO #define FOO_BAR If source code is intact, you should get FOO. But if code changed, then=20 emacs tries to find where did it go, and may as well stumble upon=20 FOO_BAR. 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-*' ? =