From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#22692: docstring for xref-find-definitions Date: Thu, 18 Feb 2016 10:48:16 -0800 Message-ID: <2736.1455821296@allegro.localdomain> References: <20283.1455584523@allegro.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: ger.gmane.org 1455821362 5492 80.91.229.3 (18 Feb 2016 18:49:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Feb 2016 18:49:22 +0000 (UTC) Cc: 22692@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 18 19:49:11 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 1aWTdX-0005ir-0x for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 19:49:11 +0100 Original-Received: from localhost ([::1]:44414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTdW-000513-Fs for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Feb 2016 13:49:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTdR-0004yz-TD for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 13:49:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWTdO-0002hT-I4 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 13:49:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWTdO-0002hL-EI for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 13:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aWTdO-0002Bg-44 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2016 13:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Feb 2016 18:49:02 +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.14558213058362 (code B ref 22692); Thu, 18 Feb 2016 18:49:02 +0000 Original-Received: (at 22692) by debbugs.gnu.org; 18 Feb 2016 18:48:25 +0000 Original-Received: from localhost ([127.0.0.1]:33190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWTcm-0002An-Qh for submit@debbugs.gnu.org; Thu, 18 Feb 2016 13:48:25 -0500 Original-Received: from shell1.rawbw.com ([198.144.192.42]:23842 ident=root) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWTcl-0002Af-2K for 22692@debbugs.gnu.org; Thu, 18 Feb 2016 13:48:23 -0500 Original-Received: from allegro.localdomain (m208-249.dsl.rawbw.com [198.144.208.249]) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTP id u1IImKxJ084479; Thu, 18 Feb 2016 10:48:21 -0800 (PST) (envelope-from m.kupfer@acm.org) X-Authentication-Warning: shell1.rawbw.com: Host m208-249.dsl.rawbw.com [198.144.208.249] claimed to be allegro.localdomain In-Reply-To: Your message of "Thu, 18 Feb 2016 18:50:45 +0200." <83ziuyt122.fsf@gnu.org> X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.0.91 Content-ID: <2735.1455821296.1@allegro.localdomain> 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:113250 Archived-At: Eli Zaretskii wrote: > > 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. Okay. Is there an easy way for the user to tell which backend is in use? If there is, then maybe the docstring could say something general and then note that the user could also check the backend's documentation. > 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? Not that I know of, but I don't know much about Emacs's documentation infrastructure. > 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. Yes, I think that would be an improvement. Thanks. > > 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): Interesting. I use M-. a lot, and I never noticed this. I suppose it's because I know I'm going to type in the name that I'm looking for, so I ignore the default. > 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.) Okay. I'll add this to my spare-time projects list. thanks, mike