[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 1 Oct 2001 15:46:39 +0200
In GNU Emacs 20.4.1 (i686-pc-linux-gnu, X toolkit)
of Fri Oct 29 1999 on tfkp02
configured using `configure --prefix=/nfs/common --libexecdir=/nfs/common/lib
--bindir=/nfs/common/lib/emacs/bin/i686-Linux --with-gcc --with-pop --with-x
Always when I use query-replace-regexp I am fooled by the fact that
this function requires a slightly different syntax for its regexps
than what I need when hacking regexps for noninteractive use in my
personal lisp functions:
For a function like re-search-forward the newline character is `\n'.
But for query-replace-regexp the newline character is `^J'.
Therefore, when I write a regexp for query-replace-regexp I can
follow only partly the node regexps in the emacs info file.
(And, frankly speaking, an alternative "[ ^J]" looks weird.)
I know that `^J' is also the newline character for other interactive
functions like isearch-forward and query-replace. Hence, for someone
using regexps most often interactively, the `^J' might be the most
natural. For me it is the other way round: Most often, I need `\n',
and only rarely I need query-replace-regexp and `^J'.
Is it possible to modify query-replace-regexp such that it
understands both `^J' and `\n'?
Roland Winkler <=