unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: spaces in isearch
Date: Sun, 21 Nov 2004 19:09:48 +0200	[thread overview]
Message-ID: <87u0rjjfh1.fsf@jurta.org> (raw)
In-Reply-To: <871xen4fzi.fsf@confusibombus.emacswiki.org> (Alex Schroeder's message of "Sun, 21 Nov 2004 12:08:01 +0100")

Alex Schroeder <alex@emacswiki.org> writes:
> Juri Linkov <juri@jurta.org> writes:
>> Since C-q in isearch mode is processed by isearch-quote-char,
>> it could intercept SPC and insert [ ] into the search string.
>
> I'm not sure I like that.  C-q <something> should insert <something>,

No, C-q <something> should be used to insert <something_different>.
There is no sense to use C-q <something> to insert the same <something>.

> I didn't know about the special behaviour of <space> in
> isearch-forward-regexp.

The old behavior: SPC inserts \\(?:\\s-+\\), C-q SPC inserts SPC.
The new behavior: SPC inserts SPC (which now internally means \\(?:\\s-+\\)).

So C-q SPC inserting SPC has no sense anymore since SPC now is
inserted by SPC itself.

Moreover, to achieve backward compatibility for users using C-q SPC
to match just a space, C-q SPC should do something to preserve the
literal meaning of a space.  Adding [ ] to the search string in regexp
isearch mode is the most natural thing to do.

>From implementation point of view this means moving the old code from
`isearch-whitespace-chars' to `isearch-quote-char' and replacing

    (isearch-process-search-string search-whitespace-regexp " ")

with

    (isearch-process-search-string "[ ]" " ")

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

  reply	other threads:[~2004-11-21 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-21  1:10 spaces in isearch Richard Stallman
2004-11-21  2:43 ` Juri Linkov
2004-11-21 11:08   ` Alex Schroeder
2004-11-21 17:09     ` Juri Linkov [this message]
2004-11-22  0:35       ` Stefan Monnier
2004-11-22 14:07   ` Richard Stallman
2004-11-22 18:39     ` Kevin Rodgers
2004-11-23  6:07 ` Harald Maier
2004-11-23  6:52   ` Juri Linkov
2004-11-24  5:37     ` Harald Maier

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=87u0rjjfh1.fsf@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 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).