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).
This commit is contained in:
Dmitry Gutov 2023-08-12 03:39:32 +03:00
parent de093d49f2
commit 0bd58dd2d6

View file

@ -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))))