aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/xref.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index b7bfb192d87..fd788ec8f32 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -638,6 +638,18 @@ If SELECT is non-nil, select the target window."
638 "Face used to highlight matches in the xref buffer." 638 "Face used to highlight matches in the xref buffer."
639 :version "28.1") 639 :version "28.1")
640 640
641(defvar-local xref-num-matches-found 0)
642
643(defvar xref-num-matches-face 'compilation-info
644 "Face name to show the number of matches on the mode line.")
645
646(defconst xref-mode-line-matches
647 `(" [" (:propertize (:eval (int-to-string xref-num-matches-found))
648 face ,xref-num-matches-face
649 help-echo "Number of matches so far")
650 "]"))
651(put 'xref-mode-line-matches 'risky-local-variable t)
652
641(defmacro xref--with-dedicated-window (&rest body) 653(defmacro xref--with-dedicated-window (&rest body)
642 `(let* ((xref-w (get-buffer-window xref-buffer-name)) 654 `(let* ((xref-w (get-buffer-window xref-buffer-name))
643 (xref-w-dedicated (window-dedicated-p xref-w))) 655 (xref-w-dedicated (window-dedicated-p xref-w)))
@@ -1235,6 +1247,8 @@ Return an alist of the form ((GROUP . (XREF ...)) ...)."
1235 (xref--ensure-default-directory dd (current-buffer)) 1247 (xref--ensure-default-directory dd (current-buffer))
1236 (xref--xref-buffer-mode) 1248 (xref--xref-buffer-mode)
1237 (xref--show-common-initialize xref-alist fetcher alist) 1249 (xref--show-common-initialize xref-alist fetcher alist)
1250 (setq xref-num-matches-found (length xrefs))
1251 (setq mode-line-process (list xref-mode-line-matches))
1238 (pop-to-buffer (current-buffer)) 1252 (pop-to-buffer (current-buffer))
1239 (setq buf (current-buffer))) 1253 (setq buf (current-buffer)))
1240 (xref--auto-jump-first buf (assoc-default 'auto-jump alist)) 1254 (xref--auto-jump-first buf (assoc-default 'auto-jump alist))