Subject: Re: bug#41692: 26.3; Enhancement request, `query-replace': let user use text at point as default

From: Juri Linkov <[email-masked]>
Date: Fri, 05 Jun 2020 01:05:27 +0300

> I see, for `C-M-%', only these two defaults:
>
> 1. A word at point (e.g. `foo'),
> 2. A regexp that matches a symbol at point (e.g. `\_<foo\_>'.
>
> But yes, that's better than nothing - a good start.
> `query-replace' could likewise use some love.

I agree that `query-replace' should at least do the same as
`query-replace-regexp', and `query-replace-regexp' could be extended.
Currently `query-replace-read-from' has:

                (if regexp-flag
                    (read-regexp prompt nil 'minibuffer-history)
                  (read-from-minibuffer
                   prompt nil nil nil nil (car search-ring) t))

It's easy to extend `read-regexp' with more options,
but what to do for non-regexp case?

Maybe to try to use `read-string' and extend it with more M-n options
like in `read-regexp'.