[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63939: 28.2; xref-find-references-and-replace (xref-1.6.3)
From: |
Dmitry Gutov |
Subject: |
bug#63939: 28.2; xref-find-references-and-replace (xref-1.6.3) |
Date: |
Tue, 20 Jun 2023 05:37:24 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 |
On 06/06/2023 22:40, Aidan Hall wrote:
xref-find-references-and-replace uses query-replace-read-args to read
the identifier to replace, but I think it would make more sense for it
to use xref--read-identifier for consistency with the other xref
commands.
Does this help?
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 @@ xref-find-references
(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))))