emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3d106897fd: Public-ize xref-show-xrefs


From: Dmitry Gutov
Subject: master 3d106897fd: Public-ize xref-show-xrefs
Date: Sun, 20 Feb 2022 20:57:47 -0500 (EST)

branch: master
commit 3d106897fdd5546797b2fb5bb5a7704f327c4da3
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Public-ize xref-show-xrefs
    
    * lisp/progmodes/xref.el (xref-show-xrefs):
    New function (wrapper for an older, private one, bug#42967).
---
 etc/NEWS                  | 2 ++
 lisp/dired-aux.el         | 3 +--
 lisp/progmodes/project.el | 7 +++----
 lisp/progmodes/xref.el    | 7 +++++++
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b7ceb1c2fb..b08bdc6451 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 2449d11c07..56897826cb 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 f606a25575..880c5b5517 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]<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)))
 
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 747151cd94..784c745477 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]