From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: Generalizing find-definition Date: Sat, 06 Dec 2014 09:55:13 +0100 Message-ID: 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> <85egsem1u2.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417856156 6681 80.91.229.3 (6 Dec 2014 08:55:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Dec 2014 08:55:56 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 06 09:55:49 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 1XxB9X-0002za-Qr for ged-emacs-devel@m.gmane.org; Sat, 06 Dec 2014 09:55:47 +0100 Original-Received: from localhost ([::1]:53789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxB9X-0005UP-7T for ged-emacs-devel@m.gmane.org; Sat, 06 Dec 2014 03:55:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxB9N-0005U8-IP for emacs-devel@gnu.org; Sat, 06 Dec 2014 03:55:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxB9G-0000hW-1T for emacs-devel@gnu.org; Sat, 06 Dec 2014 03:55:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:58123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxB9F-0000hQ-Pu for emacs-devel@gnu.org; Sat, 06 Dec 2014 03:55:29 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XxB9C-0002oU-2F for emacs-devel@gnu.org; Sat, 06 Dec 2014 09:55:26 +0100 Original-Received: from 212.46.172.140 ([212.46.172.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Dec 2014 09:55:26 +0100 Original-Received: from eller.helmut by 212.46.172.140 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Dec 2014 09:55:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 212.46.172.140 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:vZRjHX5/HlKUHVuOJTL2yVnkKqs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:179112 Archived-At: On Fri, Dec 05 2014, Stephen Leake wrote: [...] > 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: [...] > Perhaps a similar function could be included in xref? Just thinking aloud: I guess such filenames or URLs (URIs?) typically occur in comments, string literals, or perhaps in things like #include or (require 'some-library). M-x ffap seems cover this partially, but then there's also M-x find-library. Certainly a lot of things to find! A problem seems to be that xref-identifier-at-point would need a possibly complicated heuristic to determine if we are at such a filename or a "normal" identifier. Maybe it's easier to have a separate xref-file-name-at-point which would by default do what ffap-guess-file-name-at-point does. For ELisp it should additionally recognize (require 'foo) and somehow reuse find-library. There's also the problem which keybinding to use. We will probably steal the global bindings for M-. and M-, from etags but beyond that we don't have keys for our commands. At least one additional prefix key for a xref keymap would be nice. Helmut