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

From: Juri Linkov <[email-masked]>
Date: Fri, 02 Aug 2013 00:13:06 +0300

> Thanks for your interest in my bug report.  The use case I had in mind
> was changing a couple of instances of a word backwards from the point.
> Typing M-- C-M-% is fewer keystrokes than pressing C-r a few times then
> C-M-%.  It is also fewer keystrokes than setting the mark, then moving
> through the document to find a proper starting point and finally pressing
> C-M-%.
>
> The best solution would be if the functions query-replace and
> query-replace-regexp are changed so that they step backwards when
> receiving a negative argument.

One unclear point: you said that you want to replace words backwards.
Currently a numeric argument or C-u means to replace words forwards
(delimited by word boundary characters).  If a negative argument
will mean normal non-word replacement backwards, then what a prefix
should mean word replacement backwards?  To summarize the question:

no prefix M-% - normal non-word replacement forwards
C-u M-% - word replacement forwards
M-- M-% (negative argument) - normal non-word replacement backwards
??? - word replacement backwards

The same question for regexp replacements:

no prefix C-M-% - regexp replacement forwards
C-u C-M-% - word replacement forwards
M-- C-M-% (negative argument) - regexp replacement backwards
??? - word replacement backwards

> I have come across the website freedomsponsors.org and thought it would
> be an interesting experiment to put a prize on fixing this bug.

Thank you.  It would be nice if your example will encourage more
people to donate money to more difficult tasks in Emacs development.
As I can see freedomsponsors.org is a very promising site since
it supports donations to the development of free software.
This is in stark contrast with freelance sites where
customers pay money for developing highly custom
Emacs packages that are useless for most users.