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 22:15:27 +0300 Message-ID: <1552936527.7027.0@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="144426"; 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 20:17:51 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 1h5xlf-000bVG-Gw for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 20:17:51 +0100 Original-Received: from localhost ([127.0.0.1]:46273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5xle-00069J-DE for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 15:17:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5xjV-0005aU-QH for emacs-devel@gnu.org; Mon, 18 Mar 2019 15:15:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5xjU-0006lq-Ut for emacs-devel@gnu.org; Mon, 18 Mar 2019 15:15:37 -0400 Original-Received: from forward102p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:102]:55722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5xjR-0006hk-Cc; Mon, 18 Mar 2019 15:15:34 -0400 Original-Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward102p.mail.yandex.net (Yandex) with ESMTP id EAD281D40F77; Mon, 18 Mar 2019 22:15:28 +0300 (MSK) Original-Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id N3G0hoeqp9-FSwaECx2; Mon, 18 Mar 2019 22:15:28 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1552936528; bh=eeMMFiaDZHKYQdFOAGmFQ2hgSWTuw2Mdk69EVUvf5H4=; h=In-Reply-To:Cc:To:Subject:From:References:Date:Message-Id; b=pJVDJWbZ2bzTOappGvAzuPUNbohe5H6U++HdANvxkArcgdSwLY5hdTauBs/OmyPDg BvNmYLhhDvDDpgzbYf/l5EmeREm76aUsPZajSvOkGzwtcsBvChl25G+YAoB+iGBJkr u8Xxv3et4mQmb1sLqPe8mICnaQRqa0vNxZeoGphw= Authentication-Results: mxback7j.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jNT4epv1sV-FRD8wHP3; Mon, 18 Mar 2019 22:15:28 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) In-Reply-To: <83zhpsunge.fsf@gnu.org> X-Mailer: geary/master~g91967edc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a02:6b8:0:1472:2741:0:8b7:102 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:234336 Archived-At: =C2 =CF=ED, =EC=E0=F0 18, 2019 at 8:00 =CF=CF (PM), Eli Zaretskii=20 =ED=E0=EF=E8=F1=E0=EB: >> Date: Mon, 18 Mar 2019 12:43:16 +0300 >> From: Konstantin Kharlamov >> Cc: emacs-devel@gnu.org >>=20 >> > I'm not talking about whitespace. I'm talking about a tags table=20 >> file >> > that names a symbol 'foobar', say. If you search for a tag "bar"=20 >> and >> > do not anchor the search at the beginning of a line, you will=20 >> decide >> > that "bar" is present on the "foobar" line, although it really=20 >> isn't. >> > Right? >>=20 >> Not exactly. Here's an alternative bad situation: let's say you do >> anchor the text, and you search for tag 'foo'. And=85 you still=20 >> match >> 'foobar'! >=20 > That's expected, and how etags.el should work: it finds tags that > _begin_ with the specified text. Partial matches are filtered out by > higher-level routines, if needed. >=20 > But with your proposed change the match will be in the middle of a > symbol as well, something the callers don't expect. >=20 >> #define FOO >> #define FOO_BAR >>=20 >> If source code is intact, you should get FOO. But if code changed,=20 >> then >> emacs tries to find where did it go, and may as well stumble upon >> FOO_BAR. >=20 > That's okay, that's how this low-level stuff is supposed to work. >=20 >> So, I suggest an improvement to my patch: how about we >>=20 >> 1. anchor the regexp to the end of the line also >> 2. replace trailing space with "any whitespace" regex '\s-*' >>=20 >> ? >=20 > etags.el is used by/supports many major modes, and in general I don't > think we want to assume that whitespace in a tag is insignificant, > certainly not as a global change in behavior. >=20 > So I would actually suggest to make one step back and describe in more > detail the actual problem you had with the current code. The anjuta > issue to which you pointed doesn't have enough details, like why the > change in leading whitespace was deemed a problem, and so I cannot > make up my mind what is the actual problem and why it should be fixed > in etags.el. >=20 > Can you provide those additional details? I'm not sure what additional details you want. I found a usecase where=20 heuristic for finding a tag can be improved. I can make even stronger=20 statement: all whitespace within a tag is insignificant, not only the=20 trailing part. Let's make it the other way around: please, provide any language=20 example, where having the trailing space may be significant for=20 unambigiously determining the tag. =