[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generalizing find-definition
From: |
Jorgen Schaefer |
Subject: |
Re: Generalizing find-definition |
Date: |
Thu, 20 Nov 2014 21:21:11 +0100 |
On Wed, 19 Nov 2014 23:19:28 -0500
Stefan Monnier <address@hidden> wrote:
> >>> +(defvar find-definition-identifier-function nil
> >> I suggest you collapse those two function variables into one: if
> >> called with a nil value (or without argument), then just find the
> >> definitions of "thing at point" and if called with a string, then
> >> find the definitions of that identifier.
> > Keeping two variables puts that logic in the front-end, so all the
> > backends don't have to implement it, and we can change it for
> > everyone consistently.
>
> I think both in the front-end and in many backends, the two cases will
> share a lot of code, so using a single var will simplify code in the
> front-end and in many backends as well.
As one concrete example, for Elpy, the two will share absolutely no
code. But the difference is minuscle:
(setq find-definition-function 'elpy-find-definition-by-location)
(setq find-definition-identifier-function 'elpy-find-definition-by-identifier)
vs.
(setq find-definition-function 'elpy-find-definition-by-location-or-identifier)
(defun elpy-find-definition-by-location-or-identifier (&optional identifier)
(if symbol
(elpy-find-definition-by-identifier identifier)
(elpy-find-definition-by-location)))
So I do not really care either way.
Jorgen
- Re: Generalizing find-definition, (continued)
- Re: Generalizing find-definition, Dmitry Gutov, 2014/11/18
- Re: Generalizing find-definition, Helmut Eller, 2014/11/18
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/19
- Re: Generalizing find-definition, Ivan Shmakov, 2014/11/19
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/19
- Re: Generalizing find-definition, Stephen Leake, 2014/11/19
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/19
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/18
- Re: Generalizing find-definition, Stephen Leake, 2014/11/19
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/19
- Re: Generalizing find-definition,
Jorgen Schaefer <=
- Re: Generalizing find-definition, Helmut Eller, 2014/11/20
- Re: Generalizing find-definition, Jorgen Schaefer, 2014/11/20
- Re: Generalizing find-definition, Helmut Eller, 2014/11/20
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/20
- Re: Generalizing find-definition, Jorgen Schaefer, 2014/11/20
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/20
- Re: Generalizing find-definition, martin rudalics, 2014/11/21
- Re: Generalizing find-definition, Stefan Monnier, 2014/11/30
- Re: Generalizing find-definition, Johan Claesson, 2014/11/23
Re: Generalizing find-definition, Stephen Leake, 2014/11/02