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#22692: docstring for xref-find-definitions Date: Thu, 18 Feb 2016 18:50:45 +0200 Message-ID: <83ziuyt122.fsf@gnu.org> References: <20283.1455584523@allegro.localdomain> <673.1455767121@allegro.localdomain> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455814287 9157 80.91.229.3 (18 Feb 2016 16:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Feb 2016 16:51:27 +0000 (UTC) Cc: 22692@debbugs.gnu.org To: Mike Kupfer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 18 17:51:17 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 1aWRnN-000878-NQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 17:51:14 +0100 Original-Received: from localhost ([::1]:43037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRnN-0001dz-3t for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 11:51:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRnG-0001dU-1i for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 11:51:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWRnC-0007Aq-1O for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 11:51:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRnB-0007Aj-TP for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 11:51:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aWRnB-0006B7-P1 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 11:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Feb 2016 16:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22692 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22692-submit@debbugs.gnu.org id=B22692.145581424023722 (code B ref 22692); Thu, 18 Feb 2016 16:51:01 +0000 Original-Received: (at 22692) by debbugs.gnu.org; 18 Feb 2016 16:50:40 +0000 Original-Received: from localhost ([127.0.0.1]:33138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWRmq-0006AY-A3 for submit@debbugs.gnu.org; Thu, 18 Feb 2016 11:50:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40922) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWRmo-0006AL-7s for 22692@debbugs.gnu.org; Thu, 18 Feb 2016 11:50:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWRmf-0006ou-8k for 22692@debbugs.gnu.org; Thu, 18 Feb 2016 11:50:33 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWRmf-0006oj-4u; Thu, 18 Feb 2016 11:50:29 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1847 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aWRme-0000ZO-C2; Thu, 18 Feb 2016 11:50:28 -0500 In-reply-to: <673.1455767121@allegro.localdomain> (message from Mike Kupfer on Wed, 17 Feb 2016 19:45:21 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:113246 Archived-At: > From: Mike Kupfer > Date: Wed, 17 Feb 2016 19:45:21 -0800 > > Based on the behavior that I observe (using "emacs -Q" to visit > src/frame.c), the docstring for xref-find-definitions would be more > accurate if the first paragraph were replaced by > > Find the definition of the identifier at point. > If there is no identifier at point, use an identifier (or numeric > literal) near point on the same line. We cannot be this specific, not as long as the doc string is literal text defined as part of 'defun'. The exact definition of what is "the identifier at point" depends on the xref backend set up by the major mode. That definition could be very smart or it could be less smart. The command doesn't know. If we want to be accurate here, we will need to come up with a way for the back-end to supply its definition, and incorporate that in the doc string that is created dynamically. Do we have infrastructure for that? Failing that, the only band-aid I can offer is something like Find the definition of the identifier at or near point. If you think it's better, we can make that change now. > Trying to look up the definition for a numeric literal strikes me as > odd, but that's the behavior I'm seeing. Did you use M-. in Emacs 24 and before? Because that's exactly what it did in this case, it would say this in the echo area: Find tag (default 1): The reason is that this is what etags.el does when asked to find "the identifier at or near point". Patches to make it smarter are welcome. (The relevant function is find-tag-default-bounds.) Thanks.