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: Fri, 19 Feb 2016 17:34:06 +0200 Message-ID: <83vb5kr9xt.fsf@gnu.org> References: <20283.1455584523@allegro.localdomain> <673.1455767121@allegro.localdomain> <83ziuyt122.fsf@gnu.org> <56C7123A.6040408@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455896127 15938 80.91.229.3 (19 Feb 2016 15:35:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Feb 2016 15:35:27 +0000 (UTC) Cc: 22692@debbugs.gnu.org, m.kupfer@acm.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 19 16:35:12 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 1aWn5L-0003MT-7y for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Feb 2016 16:35:11 +0100 Original-Received: from localhost ([::1]:53187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWn5K-000392-IZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Feb 2016 10:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWn5G-00037D-56 for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2016 10:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWn5C-0000g2-3L for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2016 10:35:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWn5C-0000fx-0M for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2016 10:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aWn5B-00039Q-SK for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2016 10:35: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: Fri, 19 Feb 2016 15:35: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.145589607012069 (code B ref 22692); Fri, 19 Feb 2016 15:35:01 +0000 Original-Received: (at 22692) by debbugs.gnu.org; 19 Feb 2016 15:34:30 +0000 Original-Received: from localhost ([127.0.0.1]:34189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWn4g-00038b-7s for submit@debbugs.gnu.org; Fri, 19 Feb 2016 10:34:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41920) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWn4e-00038P-Mi for 22692@debbugs.gnu.org; Fri, 19 Feb 2016 10:34:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWn4V-0000YR-MO for 22692@debbugs.gnu.org; Fri, 19 Feb 2016 10:34:23 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWn4V-0000YM-Iy; Fri, 19 Feb 2016 10:34:19 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3914 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aWn4U-0008Pw-8w; Fri, 19 Feb 2016 10:34:18 -0500 In-reply-to: <56C7123A.6040408@yandex.ru> (message from Dmitry Gutov on Fri, 19 Feb 2016 15:01:46 +0200) 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:113301 Archived-At: > Cc: 22692@debbugs.gnu.org > From: Dmitry Gutov > Date: Fri, 19 Feb 2016 15:01:46 +0200 > > On 02/18/2016 06:50 PM, Eli Zaretskii wrote: > > > 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. > > Do we really want to codify that behavior? I've switched to use > find-tag--default because it seemed appropriate for the etags backend, > but the "near point" aspect looks fairly awkward to me, and I imagine > third-party backends might choose to omit it. > > I'd prefer to use the more precise behavior in find-tag-default-bounds > as well. And if there's general agreement here, I wouldn't mind taking > care of that patch. Making such a change is fine with me, thanks. > > 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.) > > Not necessarily. Every major mode that knows better should define its > own find-tag-default-function (but none do, so far). See the dispatch > inside find-tag--default. If find-tag-default-function is also used by xref-find-references, then it won't be TRT to reject constants up front. A request to find all the places where a certain constant is used is a valid use case. It is indeed unlikely to have such a request for the constant 1, but think about constants like 3.14159 or 3.0e+8.