1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Public-ize xref-show-xrefs

* lisp/progmodes/xref.el (xref-show-xrefs):
New function (wrapper for an older, private one, bug#42967).
This commit is contained in:
Dmitry Gutov 2022-02-21 03:09:32 +02:00
parent 7159c1af08
commit 3d106897fd
4 changed files with 13 additions and 6 deletions

View file

@ -747,6 +747,8 @@ replacing entire matches.
*** New variable 'xref-current-item' (renamed from a private version).
*** New function 'xref-show-xrefs'.
** File notifications
+++

View file

@ -3252,7 +3252,6 @@ with the command \\[tags-loop-continue]."
delimited)
(fileloop-continue))
(declare-function xref--show-xrefs "xref")
(declare-function xref-query-replace-in-results "xref")
(declare-function project--files-in-directory "project")
@ -3296,7 +3295,7 @@ REGEXP should use constructs supported by your local `grep' command."
(user-error "No matches for: %s" regexp))
(message "Searching...done")
xrefs))))
(xref--show-xrefs fetcher nil)))
(xref-show-xrefs fetcher nil)))
;;;###autoload
(defun dired-do-find-regexp-and-replace (from to)

View file

@ -2,7 +2,7 @@
;; Copyright (C) 2015-2022 Free Software Foundation, Inc.
;; Version: 0.8.1
;; Package-Requires: ((emacs "26.1") (xref "1.0.2"))
;; Package-Requires: ((emacs "26.1") (xref "1.4.0"))
;; This is a GNU ELPA :core package. Avoid using functionality that
;; not compatible with the version of Emacs recorded above.
@ -776,7 +776,6 @@ The following commands are available:
(define-key tab-prefix-map "p" #'project-other-tab-command))
(declare-function grep-read-files "grep")
(declare-function xref--show-xrefs "xref")
(declare-function xref--find-ignores-arguments "xref")
;;;###autoload
@ -802,7 +801,7 @@ requires quoting, e.g. `\\[quoted-insert]<space>'."
(project--files-in-directory dir
nil
(grep-read-files regexp))))))
(xref--show-xrefs
(xref-show-xrefs
(apply-partially #'project--find-regexp-in-files regexp files)
nil)))
@ -830,7 +829,7 @@ pattern to search for."
(project-files pr (cons
(project-root pr)
(project-external-roots pr)))))
(xref--show-xrefs
(xref-show-xrefs
(apply-partially #'project--find-regexp-in-files regexp files)
nil)))

View file

@ -1340,6 +1340,13 @@ definitions."
(defvar xref--read-pattern-history nil)
;;;###autoload
(defun xref-show-xrefs (fetcher display-action)
"Display some Xref values produced by FETCHER using DISPLAY-ACTION.
The meanings of both arguments are the same as documented in
`xref-show-xrefs-function'."
(xref--show-xrefs fetcher display-action))
(defun xref--show-xrefs (fetcher display-action &optional _always-show-list)
(xref--push-markers)
(unless (functionp fetcher)