From: Dmitry Gutov Date: Mon, 21 Feb 2022 01:09:32 +0000 (+0200) Subject: Public-ize xref-show-xrefs X-Git-Tag: emacs-29.0.90~2188 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3d106897fdd5546797b2fb5bb5a7704f327c4da3;p=emacs.git Public-ize xref-show-xrefs * lisp/progmodes/xref.el (xref-show-xrefs): New function (wrapper for an older, private one, bug#42967). --- diff --git a/etc/NEWS b/etc/NEWS index b7ceb1c2fb5..b08bdc6451e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -747,6 +747,8 @@ replacing entire matches. *** New variable 'xref-current-item' (renamed from a private version). +*** New function 'xref-show-xrefs'. + ** File notifications +++ diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 2449d11c072..56897826cbc 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -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) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f606a25575e..880c5b55179 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -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]'." (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))) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 747151cd94e..784c7454774 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -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)