]> git.eshelyaron.com Git - emacs.git/commitdiff
Public-ize xref-show-xrefs
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 21 Feb 2022 01:09:32 +0000 (03:09 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 21 Feb 2022 01:57:27 +0000 (03:57 +0200)
* lisp/progmodes/xref.el (xref-show-xrefs):
New function (wrapper for an older, private one, bug#42967).

etc/NEWS
lisp/dired-aux.el
lisp/progmodes/project.el
lisp/progmodes/xref.el

index b7ceb1c2fb53ebbf3e21fc7dbf78e18ce085566e..b08bdc6451ed7213b020dc47aa1565d303f82611 100644 (file)
--- 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
 
 +++
index 2449d11c0720259bcccbcc74173603ece30722f8..56897826cbc4c6e92c5d58c72ab4c1d76dc785ef 100644 (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)
index f606a25575ef4a46a4d807dda59cdd94c2c3faba..880c5b55179ce7e0ced9c879ee6548f357f1095d 100644 (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)))
 
index 747151cd94e1d0d7a4bf4b6414406857b1587d43..784c7454774a6bfd7f88836a7f0a93ff1fc58d0b 100644 (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)