all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: isearch-query-replace-regexp and stuff
Date: Thu, 08 Jul 2004 19:45:59 +0300	[thread overview]
Message-ID: <87oemqs8f2.fsf@mail.jurta.org> (raw)
In-Reply-To: <x51xjnk3y0.fsf@lola.goethe.zz> (David Kastrup's message of "07 Jul 2004 21:33:27 +0200")

David Kastrup <dak@gnu.org> writes:
> Juri Linkov <juri@jurta.org> writes:
>> David Kastrup <dak@gnu.org> writes:
>> > Juri Linkov <juri@jurta.org> writes:
>> >> The current behavior of C-M-s to repeat the non-regexp search is not
>> >> the most reasonable one.  More correct would be to switch the search
>> >> to regexp mode before doing the search again.  I guess it works now
>> >> that way because it was simpler to implement and nobody cared about
>> >> handling this case specially.  But we could change the behavior of
>> >> C-M-s in non-regexp mode to switch to regexp mode for consistency
>> >> with C-M-%.
>> >
>> > But that's inconsistent with being able to use both C-s and M-C-s in
>> > regexp searches.
>> >
>> > Don't you see that?
>> 
>> You can see the following comments for `isearch-mode-map' in isearch.el
>> (underlining is mine):
>> 
>>     ;; Define M-C-s and M-C-r like C-s and C-r so that the same key
>>     ;; combinations can be used to repeat regexp isearches that can
>>                                           ================
>>     ;; be used to start these searches.
>> 
>> So the meaning of C-M-s in a non-regexp search is still undefined,
>
> Because of some internal comment?

There is no other source of information about the current implementation,
but this comment explicitly states the intention of introducing those
keybindings.  The intention was to allow to repeat regexp isearches
with the same key that started these searches.

>> and the fact that C-M-s can repeat a non-regexp search is a side
>> effect of the current implementation.
>
> If you want to call explicitly coded "consistency" a side effect.

The current behavior is a consequence of a simpler implementation
that ignores the case of using C-M-s in normal searches as unimportant.

>> And there is no symmetry between normal and regexp searches
>
> Not?  Considering that both behave the same with regard to C-s and
> C-M-s I would think there was.  And intentionally so.

According to comments in isearch.el (supposedly written by authors of
the current implementation) it is not intentional.

Anyway, I don't want to make C-M-% consistent with accidental features,
but what I want is to make it more convenient.  Invoking `query-replace-regexp'
makes sense even in a non-regexp search for the sake of using features
available only in regexp replacements (like using \# and \,), for example:

C-s foo C-M-% \&<\#> RET

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2004-07-08 16:45 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
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 [this message]
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=87oemqs8f2.fsf@mail.jurta.org \
    --to=juri@jurta.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.