GNU bug report logs - #63939
28.2; xref-find-references-and-replace (xref-1.6.3)

Previous Next

Package: emacs;

Reported by: Aidan Hall <aidan.hall202 <at> gmail.com>

Date: Wed, 7 Jun 2023 01:52:03 UTC

Severity: normal

Found in version 28.2

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 63939 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Aidan Hall <aidan.hall202 <at> gmail.com>, 63939 <at> debbugs.gnu.org
Subject: Re: bug#63939: 28.2; xref-find-references-and-replace (xref-1.6.3)
Date: Tue, 20 Jun 2023 05:37:24 +0300
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))))





This bug report was last modified 1 year and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.