[Top][All Lists]

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

Re: Generalizing find-definition

From: Stefan Monnier
Subject: Re: Generalizing find-definition
Date: Mon, 08 Dec 2014 09:33:25 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> This said, I think the most urgent step is to get such a generalized
>> find-definition into Emacs.
> Here is a patch:

What happened to the other contenders?

> --- a/lisp/progmodes/elisp-mode.el
> +++ b/lisp/progmodes/elisp-mode.el
> @@ -231,6 +231,7 @@ Blank lines separate paragraphs.  Semicolons start 
> comments.
>    (setq imenu-case-fold-search nil)
>    (setq-local eldoc-documentation-function
>                #'elisp-eldoc-documentation-function)
> +  (setq-local xref-backend-function 'xref-elisp-backend-function)
>    (add-hook 'completion-at-point-functions
>              #'elisp-completion-at-point nil 'local))

Hmm, so xref-elisp-backend-function is not in elisp-mode.el?
That's too bad.

> +(defvaralias 'find-tag-marker-ring 'xref--marker-ring)
> +(make-obsolete-variable 'find-tag-marker-ring nil "25.1")

You can use define-obsolete-variable-alias.

> +;; and `etags--xref-backend' classes for examples.
> +
> +(require 'cl-lib)

You need a ";;; Code:" up there.  Try C-u M-x checkdoc-current-buffer
(you don't have to heed all its recommendations, tho).

> +;; For now, make the etags backend the default.
> +(defvar xref-backend-function 'etags-xref-backend-function)

IIUC this is the main interface between xref and its backends, so it
very much needs a good docstring.

Also, I don't understand why it should be a function that returns
a "backend object" rather than being the backend object itself.


reply via email to

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