emacs-devel
[Top][All Lists]
Advanced

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

Re: Generalizing find-definition


From: Stephen Leake
Subject: Re: Generalizing find-definition
Date: Tue, 04 Nov 2014 09:54:18 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt)

Jorgen Schaefer <address@hidden> writes:

> On Mon, 03 Nov 2014 09:13:45 +0100
> Helmut Eller <address@hidden> wrote:
>
>> On Mon, Nov 03 2014, Jorgen Schaefer wrote:
>> 
>> >> I have my own hack for this; It requires me to distinguish between
>> >> variable and defun names and invoke separate keys; I hope you can
>> >> remove that annoyance.
>> >
>> > I'm not sure how I can remove that annoyance - is that not
>> > language-dependent?  What kind of functionality would you require
>> > there? 
>> 
>> One way to solve this is to merge the list of candidates for functions
>> and variables.  At least that's what we do in SLIME.  In elisp-mode
>> M-. could combine the candidates of find-function and find-variable.
>> Most of the time the merged list would only contain a single
>> candidate.
>
> Why would the proposed find-definition interface make a distinction
> between variables and functions at all? So far, there has been none
> proposed?

I agree, it should not.

> Does that mean that this is not an issue? 

No, the problem is the backend functions currently provided by elisp;
function-called-at-point vs variable-at-point. There is no current
elisp function that provides 'identifier-at-point'.

In addition, symbol-file requires 'defun or 'defvar to return the
appropriate file name.

The proposed solution for the elisp backend for
find-definition-function is to call both function-called-at-point and
variable-at-point; if only one gives a result, go there. Otherwise, show
the list of two locations.

That's still not quite right; if point is on an argument to a function,
function-called-at-point will return the function symbol, not the
argument. So we really need just identifier-at-point, which is the first
portion of variable-at-point and function-called-at-point.

-- 
-- Stephe



reply via email to

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