From: Juri Linkov <juri@jurta.org>
To: David Reitter <david.reitter@gmail.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: query-replace doesn't match spaces with soft newlines
Date: Mon, 11 Feb 2008 00:52:40 +0200 [thread overview]
Message-ID: <87hcgh3cy2.fsf@jurta.org> (raw)
In-Reply-To: <02026F45-DC05-41B1-9D95-A8DB53F9B018@gmail.com> (David Reitter's message of "Fri, 8 Feb 2008 12:08:52 +0000")
> It appears that `query-replace' (or whatever this runs) does not properly
> match spaces in the search string with soft newlines. It should do that
> just like isearch does now.
>
> I encountered this when I had `longlines-mode' turned on and tried to
> replace a string in the following line(s):
>
> \item Adjoin: Combine the \slot{New Type} with the {\sc Context
> Type} according to one of the combinatorial rules.
>
> Note that this is one paragraph, with a soft newline in between "Context"
> and "Type". To reproduce, enter it as one line and have longlines-mode
> turned on (perhaps adjusting fill-column) so that it breaks right there.
>
> Then do M-% {\s Context Type} RET bar RET
>
> The string will not be replaced.
Perhaps I missed a discussion about the design of longlines-mode,
so I don't understand why longlines-mode doesn't put a `display'
property with a newline on whitespace to display it as soft newlines.
This would avoid many such problems.
If this is not possible, and replacing spaces with newlines is unavoidable,
then I suggest changing the plain search to the regexp search and
using `search-spaces-regexp' to convert spaces to newlines to be able
to match them in search and replace commands.
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2008-02-10 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-08 12:08 query-replace doesn't match spaces with soft newlines David Reitter
2008-02-10 22:52 ` Juri Linkov [this message]
2008-02-11 1:45 ` Miles Bader
2008-02-12 0:16 ` Juri Linkov
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=87hcgh3cy2.fsf@jurta.org \
--to=juri@jurta.org \
--cc=david.reitter@gmail.com \
--cc=emacs-pretest-bug@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).