unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: query-replace-interactive
Date: Wed, 07 Jul 2004 08:11:43 +0300	[thread overview]
Message-ID: <876590iepc.fsf@mail.jurta.org> (raw)
In-Reply-To: <E1Bhxz0-0006uJ-ES@fencepost.gnu.org> (Richard Stallman's message of "Tue, 06 Jul 2004 18:00:10 -0400")

Richard Stallman <rms@gnu.org> 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
http://www.jurta.org/emacs/

  reply	other threads:[~2004-07-07  5:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-03 22:59 query-replace-interactive Stefan
2004-07-04  9:54 ` query-replace-interactive Juri Linkov
2004-07-04 16:13   ` query-replace-interactive Stefan
2004-07-05  6:08     ` query-replace-interactive Juri Linkov
2004-07-05 12:44       ` query-replace-interactive Stefan
2004-07-06  9:56         ` query-replace-interactive Juri Linkov
2004-07-06 22:00           ` query-replace-interactive Richard Stallman
2004-07-07  5:11             ` Juri Linkov [this message]
2004-07-07  5:42               ` query-replace-interactive Miles Bader
2004-07-07  9:35               ` query-replace-interactive David Kastrup
2004-07-07 20:58               ` query-replace-interactive Richard Stallman
2004-07-06 22:00           ` query-replace-interactive Richard Stallman
2004-07-06 22:11             ` query-replace-interactive David Kastrup
2004-07-06 11:53       ` query-replace-interactive Richard Stallman
2004-07-06 12:24         ` query-replace-interactive Stefan
2004-07-07  6:41           ` query-replace-interactive Richard Stallman
2004-07-06 11:53       ` query-replace-interactive Richard Stallman
2004-07-06 12:09         ` query-replace-interactive David Kastrup
2004-07-07  6:41           ` query-replace-interactive Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2004-10-11  1:10 query-replace-interactive Luc Teirlinck
2004-10-11  1:18 ` query-replace-interactive Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876590iepc.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).