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:
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user