From 4d60d9face04bbbd22b4ecf69db208165b670b4f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 17 Apr 2022 12:17:30 +0200 Subject: [PATCH] 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. --- etc/NEWS | 10 +++++++--- lisp/progmodes/xref.el | 7 +++++-- 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. It is bound to 'C-M-,' and jumps to the location where 'xref-go-back' ('M-,', also known as 'xref-pop-marker-stack') was invoked previously. -*** 'xref-query-replace-in-results' does not prompt for FROM when -called without prefix argument, to make the most common case faster: -replacing entire matches. ++++ +*** 'xref-query-replace-in-results' prompting change. +This command no longer prompts for FROM when called without prefix +argument. This makes the most common case faster: replacing entire +matches. ++++ *** New command 'xref-find-references-and-replace' to rename one identifier. +--- *** New variable 'xref-current-item' (renamed from a private version). *** 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." (defcustom xref-after-jump-hook '(recenter xref-pulse-momentarily) - "Functions called after jumping to an xref." + "Functions called after jumping to an xref. +Also see `xref-current-item'." :type 'hook) (defcustom xref-after-return-hook '(xref-pulse-momentarily) @@ -490,7 +491,9 @@ To undo, use \\[xref-go-forward]." 'xref-current-item "29.1") -(defvar xref-current-item nil) +(defvar xref-current-item nil + "Dynamically bound to the current item being processed. +This can be used from `xref-after-jump-hook', for instance.") (defun xref-pulse-momentarily () (pcase-let ((`(,beg . ,end) -- 2.39.2