From 0bd58dd2d605d5237483960c283e9e24706894e4 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 12 Aug 2023 03:39:32 +0300 Subject: [PATCH] xref-find-references-and-replace: Use identifier-at-point in prompt * lisp/progmodes/xref.el (xref-find-references-and-replace): Use identifier-at-point in prompt as defined by backend (bug#63939). --- lisp/progmodes/xref.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 643eea1b0a3..3f75f8d7132 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1613,7 +1613,8 @@ is nil, prompt only if there's no usable symbol at point." (defun xref-find-references-and-replace (from to) "Replace all references to identifier FROM with TO." (interactive - (let* ((query-replace-read-from-default 'find-tag-default) + (let* ((query-replace-read-from-default + (lambda () (xref-backend-identifier-at-point (xref-find-backend)))) (common (query-replace-read-args "Query replace identifier" nil))) (list (nth 0 common) (nth 1 common)))) -- 2.39.2