emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 a5fd38c: Add xref--etags-backend to xref-backing-


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 a5fd38c: Add xref--etags-backend to xref-backing-functions using add-hook
Date: Fri, 20 Nov 2015 23:58:03 +0000

branch: emacs-25
commit a5fd38c3a6f263185ce5838010e7a0d64b49bec2
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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.
---
 lisp/progmodes/elisp-mode.el |    1 -
 lisp/progmodes/xref.el       |    8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index bf0f4b0..7e55c8e 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -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)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index dcaffa4..c551890 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -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))



reply via email to

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