From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Generalizing find-definition Date: Fri, 05 Dec 2014 03:43:19 -0600 Message-ID: <85tx1amnyg.fsf@stephe-leake.org> References: <20141102151524.0d9c665c@forcix> <20141117211039.37f03409@forcix> <877fymghgb.fsf@bredband.net> <85ppc0qf9a.fsf@stephe-leake.org> <85zjb3o09d.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417772628 7800 80.91.229.3 (5 Dec 2014 09:43:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2014 09:43:48 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 10:43:41 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XwpQK-0007q2-98 for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 10:43:40 +0100 Original-Received: from localhost ([::1]:49417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwpQJ-0006Y3-CR for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 04:43:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwpQ9-0006Xt-Vl for emacs-devel@gnu.org; Fri, 05 Dec 2014 04:43:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwpQ1-0000au-TG for emacs-devel@gnu.org; Fri, 05 Dec 2014 04:43:29 -0500 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.227]:41168 helo=dnvrco-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwpQ1-0000aX-OJ for emacs-devel@gnu.org; Fri, 05 Dec 2014 04:43:21 -0500 Original-Received: from [70.94.38.149] ([70.94.38.149:50303] helo=TAKVER) by dnvrco-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 0F/F2-22296-83E71845; Fri, 05 Dec 2014 09:43:20 +0000 In-Reply-To: (Helmut Eller's message of "Thu, 04 Dec 2014 17:49:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) X-RR-Connecting-IP: 107.14.64.118:25 X-Authority-Analysis: v=2.1 cv=C/xnyG/+ c=1 sm=1 tr=0 a=AppmJ/7ZOOFWL/q6u6u93g==:117 a=AppmJ/7ZOOFWL/q6u6u93g==:17 a=ayC55rCoAAAA:8 a=fNEgcOh0sVsA:10 a=9i_RQKNPAAAA:8 a=pGLkceISAAAA:8 a=TT1AUVwqxDZf1Pk2G6sA:9 a=32ezC7eJgITJdTDR:21 a=4ZXPBc7FV9EfLjP6:21 X-Cloudmark-Score: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 107.14.73.227 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178895 Archived-At: Helmut Eller writes: > On Thu, Dec 04 2014, Stephen Leake wrote: > >>> Hmm, xref-find-definition does this, except for the case when it's not >>> called interactively. >> >> I bound xref-find-definition to a key. When I invoke that key, I'm >> prompted for the identifier; the default is the identifier at point, but >> I still have to hit enter. > > Something's odd here. xref-find-definition does NOT prompt by > default. Ah. It only prompts if xref-identifier-at-point returns nil; I must have tested find-definition before I finished implementing identifier-at-point. Sorry for the noise. Other comments: xref.el needs (provide 'xref). For elisp, when I have a variable and function with the same name, the *xref* buffer shows: c:/Projects/org.emacs.ada-mode/wisi.el wisi-number-p (defvar wisi-number-p) That would be more consistent if the first reference was shown as: (defun wisi-number-p) In ada-mode, I use compilation-mode for showing multiple references; that is a familiar UI. I gather the mode you implemented is similar to SLIME? Perhaps we need another dispatch/user option to choose this UI? For Ada, only "find uses of identifier" returns multiple locations. That function is not in xref.el yet. I suggest: (defun xref-find-references (&optional identifier) (interactive (list (xref--read-identifier "Find references of: "))) (xref--find-references identifier nil)) similar to find-definitions. Hmm, the dispatching name has to be different; perhaps xref-find-references-m (for 'method')? I'd actually prefer xref-find-definitions as the user function, and xref-find-defintions-m as the dispatching function; the user function can show more than one definition. -- -- Stephe