aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEshel Yaron2024-11-11 19:45:10 +0100
committerDmitry Gutov2024-11-14 04:26:54 +0200
commit6bc44ccf287a398d47563ddf60d13784cd64720f (patch)
treea04cc7b513f6b9544e0f528136056d3612587e55
parent8afcfed825ae60c8947c41d84b431b21f32b2714 (diff)
downloademacs-6bc44ccf287a398d47563ddf60d13784cd64720f.tar.gz
emacs-6bc44ccf287a398d47563ddf60d13784cd64720f.zip
Update 'xref-num-matches-found' when reverting *xref* buffer
* lisp/progmodes/xref.el (xref--insert-xrefs): Update 'xref-num-matches-found' here... (xref--show-xref-buffer): ...instead of here (bug#74313).
-rw-r--r--lisp/progmodes/xref.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 5ecb8664da0..125616398f0 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1140,6 +1140,7 @@ XREF-ALIST is of the form ((GROUP . (XREF ...)) ...), where
1140GROUP is a string for decoration purposes and XREF is an 1140GROUP is a string for decoration purposes and XREF is an
1141`xref-item' object." 1141`xref-item' object."
1142 (require 'compile) ; For the compilation faces. 1142 (require 'compile) ; For the compilation faces.
1143 (setq xref-num-matches-found 0)
1143 (cl-loop for (group . xrefs) in xref-alist 1144 (cl-loop for (group . xrefs) in xref-alist
1144 for max-line = (cl-loop for xref in xrefs 1145 for max-line = (cl-loop for xref in xrefs
1145 maximize (xref-location-line 1146 maximize (xref-location-line
@@ -1159,6 +1160,7 @@ GROUP is a string for decoration purposes and XREF is an
1159 (xref--insert-propertized '(face xref-file-header xref-group t) 1160 (xref--insert-propertized '(face xref-file-header xref-group t)
1160 group "\n") 1161 group "\n")
1161 (dolist (xref xrefs) 1162 (dolist (xref xrefs)
1163 (cl-incf xref-num-matches-found)
1162 (pcase-let (((cl-struct xref-item summary location) xref)) 1164 (pcase-let (((cl-struct xref-item summary location) xref))
1163 (let* ((line (xref-location-line location)) 1165 (let* ((line (xref-location-line location))
1164 (prefix 1166 (prefix
@@ -1248,7 +1250,6 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)."
1248 (xref--ensure-default-directory dd (current-buffer)) 1250 (xref--ensure-default-directory dd (current-buffer))
1249 (xref--xref-buffer-mode) 1251 (xref--xref-buffer-mode)
1250 (xref--show-common-initialize xref-alist fetcher alist) 1252 (xref--show-common-initialize xref-alist fetcher alist)
1251 (setq xref-num-matches-found (length xrefs))
1252 (setq mode-line-process (list xref-mode-line-matches)) 1253 (setq mode-line-process (list xref-mode-line-matches))
1253 (pop-to-buffer (current-buffer)) 1254 (pop-to-buffer (current-buffer))
1254 (setq buf (current-buffer))) 1255 (setq buf (current-buffer)))