]> code.delx.au - gnu-emacs/commitdiff
Add xref--etags-backend to xref-backing-functions using add-hook
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 20 Nov 2015 23:57:00 +0000 (01:57 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 20 Nov 2015 23:57:15 +0000 (01:57 +0200)
* 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.

lisp/progmodes/elisp-mode.el
lisp/progmodes/xref.el

index bf0f4b0c9b9bba6f215184048b5b58086513f5d3..7e55c8e14bceda0ca10b44fc69a885b3a328d9a9 100644 (file)
@@ -228,7 +228,6 @@ Blank lines separate paragraphs.  Semicolons start comments.
 
 \\{emacs-lisp-mode-map}"
   :group 'lisp
-  (defvar xref-backend-functions)
   (defvar project-library-roots-function)
   (lisp-mode-variables nil nil 'elisp)
   (add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
index dcaffa4bbfb13b9ae4f1fecdaa11efe5852a6cad..c5518907aec8d86ac5497e5c2c1968fee0c2727d 100644 (file)
@@ -201,15 +201,17 @@ LENGTH is the match length, in characters."
 \f
 ;;; 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))