> Apologies- in the event that this patch is satisfactory, the following > includes `xref-find-references-and-replace`. I didn’t realize it > would be a simple replacement. > [...] > @@ -1072,9 +1072,11 @@ project-query-replace-regexp > - (pcase-let ((`(,from ,to) > - (query-replace-read-args "Query replace (regexp)" t t))) > - (list from to))) > + (let ((read-regexp-defaults-function (lambda () > + (find-tag-default-as-regexp)))) > + (pcase-let ((`(,from ,to) > + (query-replace-read-args "Query replace (regexp)" t t))) > + (list from to)))) The problem was in let-binding 'read-regexp-defaults-function' to a lambda. It should work when using 'find-tag-default-as-regexp' as a symbol: