1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Add xref--etags-backend to xref-backing-functions using add-hook

* lisp/progmodes/xref.el (xref-backend-functions): Move the
default value into a separate `add-hook' call (bug#21964).

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
Don't declare the xref-backend-functions variable.
It doesn't make any difference.
This commit is contained in:
Dmitry Gutov 2015-11-21 01:57:00 +02:00
parent 033811ceec
commit a5fd38c3a6
2 changed files with 5 additions and 4 deletions

View file

@ -201,15 +201,17 @@ LENGTH is the match length, in characters."
;;; API
;; We make the etags backend the default for now, until something
;; better comes along.
(defvar xref-backend-functions (list #'xref--etags-backend)
(defvar xref-backend-functions nil
"Special hook to find the xref backend for the current context.
Each functions on this hook is called in turn with no arguments
and should return either nil to mean that it is not applicable,
or an xref backend, which is a value to be used to dispatch the
generic functions.")
;; We make the etags backend the default for now, until something
;; better comes along.
(add-hook 'xref-backend-functions #'xref--etags-backend)
;;;###autoload
(defun xref-find-backend ()
(run-hook-with-args-until-success 'xref-backend-functions))