[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-replace-interactive

From: Juri Linkov
Subject: Re: query-replace-interactive
Date: Wed, 07 Jul 2004 08:11:43 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:
> I misunderstood the idea of "(default a->b)".  Now that I see what
> it really does, I agree with you that it has lots of problems.
> Here's what I THOUGHT the idea was.
> The idea is that M-x query-replace would read just one minibuffer argument.
> That argument would have the form FROM->TO.  After the arg is read,
> the interactive spec would split it apart at the -> to get the FROM
> and TO strings, and they would become the arguments in the call
> to query-replace.
> Further, the default for this one argument would be the previous
> argument to query-replace.  The default would be used if you type RET
> and available to edit with M-n.
> This is radical, perhaps too radical, but it is clean and coherent.

The original Stefan's idea was to display "(default a->b)" in the
prompt for the from-string and to interpret empty input of the
from-string as a request for repeating the last replacement.

I extended this idea to what you described above, i.e. splitting the
from-string argument in the form "FROM -> TO".  This would be more
consistent with standard Emacs handling of default values, but it has
one drawback: the separator should not appear in the text to replace.
But if the string " -> " is rare enough to appear in replacement strings
we could use it as a default separator and to allow to quote it (e.g.
" \-\> ") if someone really wants to use it in the from-string.

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]