emacs-devel
[Top][All Lists]
Advanced

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

Re: Generalizing find-definition


From: Dmitry Gutov
Subject: Re: Generalizing find-definition
Date: Sat, 13 Dec 2014 11:56:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> That's the idea behind using the value t as an "identifier at point".
> It seems like a reasonable constraint on the use of
> xref-find-definitions.

Here's another example why we could reconsider using simply t or marker
as a return value there:

- Suppose, for the current backend, xref-identifier-at-point-function
  never returns strings, as described.

- User calls `xref-find-definitions' with a prefix argument, this
  triggers completing read, but we can't use anything as the initial
  input.

For a popular OOP language, the identifier completion table might
contain entries like "package.Class#method", and if the point is on
"foo.method", and if completion doesn't require prefix matching, having
"method" as the initial input would save the user some typing.

Anyway, updated patch attached. Aside from what was already discussed,
the changes are:

- Added `xref-find-apropos' and its implementation in the Etags backend,
  as a replacement for reading and jumping to a "regexp identifier".

- `xref-identifier-completion-table' ->
  `xref-identifier-table-function'. Apparently, it should be a function
  returning a completion table, for the same reason as why
  `tags-lazy-completion-table' exists. Please correct me if I'm wrong.

Attachment: xref-find-function.diff
Description: Plain function API with EIEIO locations


reply via email to

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