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: Thu, 04 Dec 2014 02:07:28 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt)

Stephen Leake <address@hidden> writes:

> Using the code at: https://github.com/ellerh/xref, I've written an
> ada-mode backend (not completion yet). It was quite straight-forward,
> and I like the dispatching that eieio provides.
>
> So I recommend we merge this code into emacs master.
>
> A couple comments:

I used xref--file-location, which is an internal symbol:

(defmethod xref-find-definitions ((_ xref-ada-backend) identifier)
    ...
    (list
     (xref-make
     ""
     (make-instance
      'xref--file-location
      :file (nth 0 target)
      :line (nth 1 target)
      :column (nth 2 target))))
    ))

There is a non-internal alternative xref-file-location:

(defmethod xref-find-definitions ((_ xref-ada-backend) identifier)
    ...
    (list
     (xref-make
     ""
     (xref-file-location
      (nth 0 target)
      (nth 1 target)
      (nth 2 target)))
    ))

I find the first more readable; that's part of the point of using the
class paradigm.

So I suggest promoting the classes in xref.el to a supported part of the
API.

In addition, that allows the code in '...' to change to also use the
xref--file-location class, which would be a Good Thing.

-- 
-- Stephe



reply via email to

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