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

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

Re: query-replace-regexp


From: Stefan Monnier
Subject: Re: query-replace-regexp
Date: 01 Oct 2001 18:28:13 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.106

>>>>> "Roland" == Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> writes:
> "Stefan Monnier" <monnier+gnu.emacs.bug/news/@RUM.cs.yale.edu> writes:
>> >>>>> "Roland" == Roland Winkler writes:
>> > For a function like re-search-forward the newline character is `\n'.
>> 
>> Note that ^J works there as well ;-).
> Thanks, I didn't know that. But when I look through the emacs lisp
> files, it seems to me that I am not the only one who is always
> using `\n' for re-search-forward but never `^J'.

Indeed.  And I would not recommend using ^J too much.

>> > Is it possible to modify query-replace-regexp such that it
>> > understands both `^J' and `\n'?
>> Of course, you can modify it to do that.  But that will basically
>> mean that you need to double your backslashes in other cases like
>> \\(blkbl\\).
> Frankly speaking, I've got used to all these backslashes.

In that case, do C-h f query-replace-regexp, follow the link to
the definition of the function and hack away.

> My point is simply that I am always fooled by the fact that `\n' doesn't
> work with query-replace-regexp. I don't know: If this happens only to me,
> I don't want to complain anymore.

I can relate to your frustration.  Having two different ways to enter
special textual elements and having to remember which one to use where
is a pain.  I recently got fooled by the second argument to
query-replace-regexp (where a real backslash needs to be doubled as well
because you can use \1, \2 ...).

But the problem is that I don't find "double the backslashes" to be a
good solution either.


        Stefan



reply via email to

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