aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-04-17 12:17:30 +0200
committerLars Ingebrigtsen2022-04-17 12:17:30 +0200
commit4d60d9face04bbbd22b4ecf69db208165b670b4f (patch)
tree164df4d322b163d268598672872ad90f3054b58c
parentd951e9e650aed1fbe9a587282a8614a4a3b9d35b (diff)
downloademacs-4d60d9face04bbbd22b4ecf69db208165b670b4f.tar.gz
emacs-4d60d9face04bbbd22b4ecf69db208165b670b4f.zip
Add a doc string to xref-current-item
* lisp/progmodes/xref.el (xref-after-jump-hook): Link to it. (xref-current-item): Add a doc string to the now-public variable.
-rw-r--r--etc/NEWS10
-rw-r--r--lisp/progmodes/xref.el7
2 files changed, 12 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 560d3eecfd4..445e3ae89f0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -942,12 +942,16 @@ to enable the display of the buffer list.
942It is bound to 'C-M-,' and jumps to the location where 'xref-go-back' 942It is bound to 'C-M-,' and jumps to the location where 'xref-go-back'
943('M-,', also known as 'xref-pop-marker-stack') was invoked previously. 943('M-,', also known as 'xref-pop-marker-stack') was invoked previously.
944 944
945*** 'xref-query-replace-in-results' does not prompt for FROM when 945+++
946called without prefix argument, to make the most common case faster: 946*** 'xref-query-replace-in-results' prompting change.
947replacing entire matches. 947This command no longer prompts for FROM when called without prefix
948argument. This makes the most common case faster: replacing entire
949matches.
948 950
951+++
949*** New command 'xref-find-references-and-replace' to rename one identifier. 952*** New command 'xref-find-references-and-replace' to rename one identifier.
950 953
954---
951*** New variable 'xref-current-item' (renamed from a private version). 955*** New variable 'xref-current-item' (renamed from a private version).
952 956
953*** New function 'xref-show-xrefs'. 957*** New function 'xref-show-xrefs'.
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 277934c08a2..958d4e8b9d7 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -381,7 +381,8 @@ elements is negated: these commands will NOT prompt."
381 381
382(defcustom xref-after-jump-hook '(recenter 382(defcustom xref-after-jump-hook '(recenter
383 xref-pulse-momentarily) 383 xref-pulse-momentarily)
384 "Functions called after jumping to an xref." 384 "Functions called after jumping to an xref.
385Also see `xref-current-item'."
385 :type 'hook) 386 :type 'hook)
386 387
387(defcustom xref-after-return-hook '(xref-pulse-momentarily) 388(defcustom xref-after-return-hook '(xref-pulse-momentarily)
@@ -490,7 +491,9 @@ To undo, use \\[xref-go-forward]."
490 'xref-current-item 491 'xref-current-item
491 "29.1") 492 "29.1")
492 493
493(defvar xref-current-item nil) 494(defvar xref-current-item nil
495 "Dynamically bound to the current item being processed.
496This can be used from `xref-after-jump-hook', for instance.")
494 497
495(defun xref-pulse-momentarily () 498(defun xref-pulse-momentarily ()
496 (pcase-let ((`(,beg . ,end) 499 (pcase-let ((`(,beg . ,end)