emacs-devel
[Top][All Lists]
Advanced

[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: Thu, 11 Dec 2014 21:31:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

On Thu, Dec 11 2014, Stefan Monnier wrote:

>>> - If we restrict identifier to "a string or nil or t", then we can get
>>> rid of identifier-to-string.
>> Doesn't look like a great idea to me.  identifier-to-string is used to
>> create error messages like: "No known definitions for: fooo".  How would
>> the message look like for the t case?
>
> The message could look like "No known definition for ident at point".
>
> The use case for `t' is when the backend doesn't even know how to name
> the identifier at point.  It just passes the whole file along with the
> position of point to some external program which returns the possible
> definitions.  So there really might really be no good string
> representation, regardless of our API (maybe the external program could
> give us some kind of textual representation name for it, but then again
> maybe it doesn't support this functionality and maybe this description
> would be too long/complex).

A identifier representation like 

 (list (thing-at-point 'line) (current-buffer) (point))

doesn't cost anything and would go a long way to give a better error
message.  If thing-at-point returns nil or an empty line then
identifier-at-point should just return nil.

Helmut



reply via email to

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