From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21934: 24.5; find-tag: reading TAGS file incorrectly Date: Sat, 21 Nov 2015 15:07:24 +0200 Message-ID: <83egfj4i2b.fsf@gnu.org> References: <87ziyd20cb.fsf@winky.hogwarts> <564AA697.9000203@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1448111445 24003 80.91.229.3 (21 Nov 2015 13:10:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2015 13:10:45 +0000 (UTC) Cc: andreas.matthias@gmail.com, 21934@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 14:10:32 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a07vh-0005JW-13 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 14:10:13 +0100 Original-Received: from localhost ([::1]:52301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a07vf-0004Ro-SJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 08:10:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a07vb-0004Nh-VS for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 08:10:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a07vX-0007eh-0k for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 08:10:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a07vW-0007eX-Tc for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 08:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a07vW-0005aK-4Y for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Nov 2015 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21934 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21934-submit@debbugs.gnu.org id=B21934.144811135421403 (code B ref 21934); Sat, 21 Nov 2015 13:10:02 +0000 Original-Received: (at 21934) by debbugs.gnu.org; 21 Nov 2015 13:09:14 +0000 Original-Received: from localhost ([127.0.0.1]:46684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a07uj-0005Z8-QV for submit@debbugs.gnu.org; Sat, 21 Nov 2015 08:09:14 -0500 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:58821) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a07ug-0005Yz-K7 for 21934@debbugs.gnu.org; Sat, 21 Nov 2015 08:09:12 -0500 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NY6007001PQP700@mtaout26.012.net.il> for 21934@debbugs.gnu.org; Sat, 21 Nov 2015 15:10:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NY600L961XLAVA0@mtaout26.012.net.il>; Sat, 21 Nov 2015 15:10:33 +0200 (IST) In-reply-to: <564AA697.9000203@yandex.ru> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109013 Archived-At: > Cc: Andreas Matthias > From: Dmitry Gutov > Date: Tue, 17 Nov 2015 06:01:27 +0200 Sorry for the delay; Lifeā„¢ intervened. > Eli, please take a look at TAGS attached to this bug report. Do the > entries there satisfy the "implicit name" conditions? Yes, they do. Etags doesn't treat a period '.' as ending an identifier, except in C-like languages. And that is good, since Lua evidently wants to support identifiers with embedded periods. > I also have a different etags in my system, that comes from Exuberant > Ctags, and it generates a different TAGS, looking like this: > > test.lua,98 > function Rectangle.getPos ()^?Rectangle.getPos ^A2,15 > function Circle.getPos ()^?Circle.getPos ^A6,61 > > And that one works with `find-tag' just fine. So it would be nice if Eli > could comment on the difference, and whether etags should be patched > instead. I've looked at the related code, and my conclusion is that there's more to this than meets the eye. The OP complained about _completion_ on tag names, and suggested to fix a regexp used by etags-tags-completion-table. That regexp indeed doesn't allow a period in an identifier name (probably because it's disallowed in C-like languages). However, find-tag itself doesn't use that regexp, so typing "M-x find-tag RET Rectangle.getPos RET" finds that identifier with no problems. Now, find-tag is deprecated in Emacs 25, and M-. invokes xref-find-definitions instead. AFAIU, etags-tags-completion-table is no longer relevant with xref. xref-find-definitions, if it's invoked with a prefix argument, and if you type "Rectangle.getPos RET" at its prompt, not surprisingly also finds the identifier. Trying to invoke completion after "C-u M-.", with test.lua as the current buffer, doesn't succeed to complete even on Rectangle, so the situation here is somewhat worse, but I'm not sure why. If we want "M-." without prefix argument to be able to find these identifiers, we need first to take care of how it determines the symbol at point. Currently, it calls (thing-at-point 'symbol), which predictably guesses wrong. IOW, we could fix the regexp as suggested by the OP (AFAICS, that should not cause any regressions for etags.el), but that won't solve the problems "M-." in Emacs 25 will have with such identifiers in Lua sources. Suggestions and comments are welcome.