From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#22292: 25.0.50; xref-find-references doesn't find anything for Lisp symbols Date: Sat, 2 Jan 2016 16:05:33 +0200 Message-ID: <5687D92D.3090905@yandex.ru> References: <83mvsoazet.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1451743589 21129 80.91.229.3 (2 Jan 2016 14:06:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jan 2016 14:06:29 +0000 (UTC) To: Eli Zaretskii , 22292@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 02 15:06:14 2016 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 1aFMos-0003e9-6f for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jan 2016 15:06:10 +0100 Original-Received: from localhost ([::1]:38564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFMor-0000Wj-BR for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jan 2016 09:06:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFMon-0000Wd-He for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2016 09:06:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFMok-0004Cl-5k for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2016 09:06:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFMok-0004Ch-28 for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2016 09:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aFMoj-00005v-Qd for bug-gnu-emacs@gnu.org; Sat, 02 Jan 2016 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jan 2016 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22292 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22292-submit@debbugs.gnu.org id=B22292.1451743543338 (code B ref 22292); Sat, 02 Jan 2016 14:06:01 +0000 Original-Received: (at 22292) by debbugs.gnu.org; 2 Jan 2016 14:05:43 +0000 Original-Received: from localhost ([127.0.0.1]:34323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aFMoR-00005O-9u for submit@debbugs.gnu.org; Sat, 02 Jan 2016 09:05:43 -0500 Original-Received: from mail-wm0-f42.google.com ([74.125.82.42]:35885) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aFMoQ-00005B-CL for 22292@debbugs.gnu.org; Sat, 02 Jan 2016 09:05:42 -0500 Original-Received: by mail-wm0-f42.google.com with SMTP id l65so121435041wmf.1 for <22292@debbugs.gnu.org>; Sat, 02 Jan 2016 06:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=dWIJvGL8spV4hFBnSRKSShyokKU+2zt2JRVoXAiTDIo=; b=APdkIB9y4sq05+Toi2qZDfAs6jb3VpcrZld21DjiUkO1mUS5eSnAUd5+CWj/5rRorw ZtnAjFL5/e687Sm0OI+A1aO09CdNar2vY59Iyl3AM1UQ0t/YWRyyNiY51e71FsavWuvi mZPeSpm+fR8wZPThNqsSnaBEUsKFIBOmgkRAgI7syumyNptS/lMVE0qqSruR0KS5Gk0T yPjbxON/RnJJ2evfrUqBhwf1MGoBFxXqMJCHfwBQJhPHTrKhNEOlV78nR30iA/uWOMjc 7m6Yay4uE5B3RhUUJAmtN/wtFAxcbpF9BLLJ1TugfCbZ5BJxO7NTB1ml9awuMfoV51b8 fHhA== X-Received: by 10.28.126.84 with SMTP id z81mr73678426wmc.29.1451743536554; Sat, 02 Jan 2016 06:05:36 -0800 (PST) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id x125sm66429542wmg.1.2016.01.02.06.05.34 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jan 2016 06:05:34 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Thunderbird/43.0 In-Reply-To: <83mvsoazet.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:111103 Archived-At: Hi Eli, On 01/02/2016 03:23 PM, Eli Zaretskii wrote: > To reproduce: > > emacs -Q > C-x C-f lisp/subr.el RET > M-? executing-kbd-macro RET This scenario works for me, and I get ~100 matches, with emacs-25 HEAD. > The result is disappointing: > > No references found for: executing-kbd-macro > > The equivalent command in a C buffer (for a C symbol) does work as > expected. I'd expect the problem to be OS-specific, but it working in C buffers is clearly odd. You should be able to edebug xref-collect-references to see what happens (*). > I'm guessing that something is missing in the Lisp xref back-end that > doesn't let us support this operation. However, I don't think we can > ship Emacs 25.1 with such an omission. Lisp is one of the 2 languages > in which Emacs is written, so we ought to support it well. Agreed. > Can someone please implement the necessary functionality on the > emacs-25 branch? Bonus points for doing that for a few more popular > languages for which we have support in lisp/progmodes/. The implementation is largely language-agnostic. Basically, it greps, and then checks the returned hits for matches for "\\_". Which depends on each buffer's syntax table and syntax-propertize-function. We are going to encounter cases where the "current symbol" is detected wrong due to this heuristic, but the fixes will probably go into syntax tables and s-p-function values. (*) However (!), for xref-find-references only, we delegate to semantic-symref-find-references-by-name. And it might call any of the registered tools (such as id-utils), if the respective database file is present. Might it be that id-utils doesn't parse Elisp files? If you recall, I mentioned this as a source of a possible user confusion. I don't know how to make it friendlier. > (This came up in the context of rewriting the "Tags Tables" section of > the user manual, where etags.el functionality now takes a back seat to > xref.el. Part of that is documenting the xref-find-references > command. To be fair, we could leave xref-find-references unadvertised, because it's not replacing any of the existing etags commands. But yeah, it should work.