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 11:41:09 -0600 Message-ID: <85egsem1u2.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> <85tx1amnyg.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417801309 6867 80.91.229.3 (5 Dec 2014 17:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2014 17:41:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 18:41:43 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 1Xwwsx-0002VU-1d for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 18:41:43 +0100 Original-Received: from localhost ([::1]:51653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwwsw-0005ty-NG for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 12:41:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwwsb-0005Yj-Br for emacs-devel@gnu.org; Fri, 05 Dec 2014 12:41:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwwsU-0003GO-PE for emacs-devel@gnu.org; Fri, 05 Dec 2014 12:41:21 -0500 Original-Received: from dnvrco-outbound-snat.email.rr.com ([107.14.73.227]:41314 helo=dnvrco-oedge-vip.email.rr.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwwsU-0003Cw-LA for emacs-devel@gnu.org; Fri, 05 Dec 2014 12:41:14 -0500 Original-Received: from [70.94.38.149] ([70.94.38.149:50806] helo=TAKVER) by dnvrco-oedge03 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 39/29-16169-63EE1845; Fri, 05 Dec 2014 17:41:11 +0000 In-Reply-To: (Helmut Eller's message of "Fri, 05 Dec 2014 14:25:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) X-RR-Connecting-IP: 107.14.64.142:25 X-Authority-Analysis: v=2.1 cv=W762VHmk 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=mDV3o1hIAAAA:8 a=mYkQSZINUM0ifZJt_mEA:9 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:178961 Archived-At: Helmut Eller writes: >> Perhaps we need another dispatch/user option to choose this UI? > > I added a variable xref-show-xrefs-function so that people can > experiment with alternative UIs. I'm not sure if compilation-mode is > able to handle locations that can't be represented as simple strings. Ok, I'll give that a try. > [...] >> 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. > > I decided to call the backend functions xref-lookup-defintions and > xref-lookup-references and the commands xref-find-defintions > resp. xref-find-references. Ok. Another aspect of "cross reference" is to follow links such as: 1) http://www.gnu.org/software/emacs 2) admin/notes/commits 3) (info "(elisp)Syntax Class Table" "*info syntax class table*") Currently, 1) is handled by browse-url-at-point, which is not bound to any key by default. Similarly, 2) is find-file-at-point 3) is handled by C-x C-e; I don't think we need to change that. I have a function that combines 1 and 2 and similar links; it calls ffap-string-at-point, compares that to an alist of (regexp . command), and then defaults to find-file. The alist has: (cons "^ftp://" 'browse-url-at-point) (cons "^http://" 'browse-url-at-point) (cons "^https://" 'browse-url-at-point) (cons "\\.bmp$" 'sal-w32-open) (cons "\\.bz2$" 'sal-w32-open) etc. Perhaps a similar function could be included in xref? -- -- Stephe