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

From: Jambunathan K <[email-masked]>
Date: Mon, 29 Jul 2013 12:42:49 +0530

Ben A. <[email-masked]> writes:

> Hi,
>
> A feature request: I often make use of query-replace and
> query-replace-regexp.  It would be useful to have a
> query-replace-backward and a query-replace-regexp-backward.  The
> backward variant would be executed when the forward variant is given a
> negative argument.

One way of achieving this with the existing scheme of things is:

  1. M-<
  2. C-x n n
  3. C-M-%
  4. M->
  6. C-x n w

Narrow from beginning of buffer (or a defun or wherever) to point, do
replacement and widen.

(I think) forward searches are more efficient than backward searches
through the buffer.

May I know what is your specific usage scenario?  Are you editing a text
file or a program source?  Why is that you want only backward
replacements and STRICTLY AVOID forward replacements.

> Much Appreciation,
> Ben