all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: isearch-query-replace-regexp and stuff
Date: 06 Jul 2004 19:29:17 +0200	[thread overview]
Message-ID: <x5vfh1m4cy.fsf@lola.goethe.zz> (raw)
In-Reply-To: <87zn6dqei0.fsf@mail.jurta.org>

Juri Linkov <juri@jurta.org> writes:

> David Kastrup <dak@gnu.org> writes:
> > Juri Linkov <juri@jurta.org> writes:
> >> C-M-% is a standard key binding to start regexp replacement,
> >> so it should be available in isearch too.
> >
> > Well, C-s is a standard key binding to start literal searches, so the
> > same argument would apply for its meaning of continuing a regexp
> > search.
> 
> This analogy is appropriate (even C-M-s can continue a non-regexp
> search), but at the same time I think no one would have an incentive
> to type C-M-% in a non-regexp search to start a non-regexp replacement.

So what incentive would there be to continue a non-regexp search with
C-M-s?  The point is that it makes sense to make the bindings
identical in regexp searches, so it would be strange to separate them
again in non-regexp searches.

> C-M-% is quite hard to type, and if someone still decided to type
> it, this means only that it was typed with the intention to start a
> regexp replacement.

C-M-s is quite hard to type, and if someone still decided to type it,
this means only that it was typed with the intention to start a
regexp search.

In short: you are arguing against consistency.

> > Well, if I do C-s e[e] M-r on this mail, then a "failed isearch"
> > turns into a "failed regexp isearch" until I press C-s
> > again. While this has the advantage that M-r M-r is a noop, it
> > seems counterintuitive.  Maybe switching with M-r should do
> > something like the following?
> >
> > If looking-at (or its non-regexp equivalent) returns non-nil after the
> > change, remove a potentially previous "failed" tag.  If looking-at
> > returns nil, call the search "pending" instead of "failed" until C-s
> > is pressed again.
> 
> Maybe it's better to always clear the failed flag after switching
> with M-r, because repeating the failed search after switching the
> search type has such undesirable behavior as wrapping the search and
> starting from the beginning of the buffer.

Well, my proposal would not have "failed" in the display after the
switch, so it would be natural not to have the flag set, either.  The
question is just whether one should change the display to "pending"
to indicate this change, or simply don't mention this somewhat
peculiar state at all.

> After switching the search type it should continue from the same
> point even if the previous search type failed.

Definitely.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2004-07-06 17:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 23:18 isearch-query-replace-regexp and stuff David Kastrup
2004-07-02  0:05 ` David Kastrup
2004-07-02 17:51   ` Richard Stallman
2004-07-02  6:55 ` Juri Linkov
2004-07-02  7:55   ` David Kastrup
2004-07-02 13:44     ` Stefan
2004-07-03  6:59     ` Juri Linkov
2004-07-03 18:20 ` Richard Stallman
2004-07-05 19:07   ` David Kastrup
2004-07-06  9:59     ` Juri Linkov
2004-07-06 11:20       ` David Kastrup
2004-07-06 16:36         ` Juri Linkov
2004-07-06 17:29           ` David Kastrup [this message]
2004-07-07  5:08             ` Juri Linkov
2004-07-07  9:29               ` David Kastrup
2004-07-07 18:29                 ` Juri Linkov
2004-07-07 19:33                   ` David Kastrup
2004-07-08 16:45                     ` Juri Linkov
2004-07-08 18:12                       ` David Kastrup
2004-07-09 20:54                         ` Juri Linkov
2004-07-08 23:17                 ` Richard Stallman
2004-07-06 22:00         ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=x5vfh1m4cy.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.