]> git.eshelyaron.com Git - emacs.git/commitdiff
Update project-find-regexp for the new xref API
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 15 Nov 2015 04:31:51 +0000 (06:31 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 15 Nov 2015 04:32:13 +0000 (06:32 +0200)
* lisp/progmodes/project.el (project--read-regexp):
Update to use the new xref API methods.

* lisp/progmodes/xref.el (xref-find-backend): Autoload.

lisp/progmodes/project.el
lisp/progmodes/xref.el

index 398339ee59014eec7d896257b16b4b4300373488..40d7e03baf47030894ec51fceff470ced363f953 100644 (file)
@@ -213,6 +213,7 @@ DIRS must contain directory names."
 (declare-function grep-read-files "grep")
 (declare-function xref-collect-matches "xref")
 (declare-function xref--show-xrefs "xref")
+(declare-function xref-backend-identifier-at-point "xref")
 
 ;;;###autoload
 (defun project-find-regexp (regexp)
@@ -240,10 +241,8 @@ pattern to search for."
     (project--find-regexp-in dirs regexp pr)))
 
 (defun project--read-regexp ()
-  (defvar xref-identifier-at-point-function)
-  (require 'xref)
   (read-regexp "Find regexp"
-               (funcall xref-identifier-at-point-function)))
+               (xref-backend-identifier-at-point (xref-find-backend))))
 
 (defun project--find-regexp-in (dirs regexp project)
   (require 'grep)
index 7e3b5600f1a17d07481896ce310e208c023fa2c9..40f8d23c64a49ade3f48aea5496a17447ad82819 100644 (file)
@@ -210,6 +210,7 @@ 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.")
 
+;;;###autoload
 (defun xref-find-backend ()
   (run-hook-with-args-until-success 'xref-backend-functions))