Subject: bug#14979: 24.3; Feature Request: query-replace-backward

From: Juri Linkov <[email-masked]>
Date: Tue, 30 Jul 2013 00:02:55 +0300

> it's straightforward to implement this in Emacs where
> `(isearch-forward t)' in `replace-search' could be replaced
> with `(isearch-forward replace-forward)' where `replace-forward'
> is a new option that can be changed in `isearch-query-replace'
> according to the current value of `isearch-forward'.

Actually using the value of `isearch-forward' to make
decision about the direction of replacements is not good
because often `C-r' is used to find the uppermost match
from which to run forward replacements.

Maybe it would help if after the last replacement
`query-replace' asked whether to wrap and continue
replacements from the beginning of the buffer.
Then no matches will be missed when `query-replace'
happens to be started in the middle of the buffer.