[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generalizing find-definition

From: Helmut Eller
Subject: Re: Generalizing find-definition
Date: Sat, 06 Dec 2014 09:55:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

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 <stdio.h> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]