diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index c812f28c1b..f606a25575 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1072,9 +1072,10 @@ project-query-replace-regexp If you exit the `query-replace', you can later continue the `query-replace' loop using the command \\[fileloop-continue]." (interactive - (pcase-let ((`(,from ,to) - (query-replace-read-args "Query replace (regexp)" t t))) - (list from to))) + (let ((query-replace-read-from-regexp-default 'find-tag-default-as-regexp)) + (pcase-let ((`(,from ,to) + (query-replace-read-args "Query replace (regexp)" t t))) + (list from to)))) (fileloop-initialize-replace from to (project-files (project-current t)) 'default) (fileloop-continue)) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 37e2159782..4efa652084 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1481,8 +1481,9 @@ xref-find-references (defun xref-find-references-and-replace (from to) "Replace all references to identifier FROM with TO." (interactive - (let ((common - (query-replace-read-args "Query replace identifier" nil))) + (let* ((query-replace-read-from-default 'find-tag-default) + (common + (query-replace-read-args "Query replace identifier" nil))) (list (nth 0 common) (nth 1 common)))) (require 'xref) (with-current-buffer