help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search in filled text does not work correctly


From: bitterspetey
Subject: Re: Search in filled text does not work correctly
Date: Sun, 26 Feb 2012 11:41:46 -0800 (PST)

Certainly you can learn to do it - but I found it a bit remarkable that such
a sophisticated regexp was required to allow for the possibility of breaking
over lines (and catch the other usual whitespace).  I'm not a power user by
a longshot (like I very rarely do any lisp) - but I've been a user for over
a decade, and I picked up some amount of regular expression stuff, and it
still took me some time to figure out that '\s-' does not match line feeds,
contrary to explicit statement in 
http://www.emacswiki.org/emacs/RegularExpression the manual :

Note also that \s- matches space, tab, newline and carriage return. This can
be handy in a [^ … ] construct.
If I had this trouble, I'm guessing a totally new user, curious about the
power of emacs, is going to be totally at sea.
So I think if the emacs community cares about new users, this is a default
that should be changed.  You should have the option to search for an
explicit space, of course, but the default in searches should be a
whitespace of any of the generic sorts.


gregben wrote:
> 
> I happened to want to convert a list like this:
> 
> "apple" "banana" "cherry"
> 
> to this format:
> 
> apple
> banana
> cherry
> 
> the other day. I started our with 'replace-regexp' and learned about
> C-q C-j in a matter of minutes after first trying \n, \\n, C-j,
> etc. before googling. 
> 
> Perhaps it would be better to educate rather than change emacs'
> behavior. The built-in tutorial could have a few words added about
> using C-q C-j with respect to searching and replacing, or the single
> tutorial now provided could be broken into several, with one dedicated
> to searching, replacing, highlighting, displaying only the lines
> containing a pattern, etc.
> 

-- 
View this message in context: 
http://old.nabble.com/Search-in-filled-text-does-not-work-correctly-tp33390451p33395942.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]