Update project-find-regexp for the new xref API

* lisp/progmodes/project.el (project--read-regexp):
Update to use the new xref API methods.

* lisp/progmodes/xref.el (xref-find-backend): Autoload.
This commit is contained in:
Dmitry Gutov 2015-11-15 06:31:51 +02:00
parent bc2cec6b20
commit 1a3c4541c3
2 changed files with 3 additions and 3 deletions

View 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)

View 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))