The other question is should we try to support pcre + Emacs
extensions, or just use the simpler syntax.
What Emacs extensions do you mean?
Interactively we already support single-slash input. Recent XEmacs
21.5 supports a raw string syntax. #r"stri\ng" for example is lexed
as a string with a single backslash and no line breaks. The
equivalent to "\s" in Emacs syntax is "\s-".
I had forgotten that #r existed. I really should use that more...
I imagine you know all that already; what I'm interested in here
precisely what your requirement is. Less typing? Avoiding confusion
in the muscle memory?
when I'm back in Emacs-land, doing a query-replace or a keyboard macro or something, I
have to switch mental gears, and do a lot more typing on the Emacs side of things. And I
never remember what the Emacs equivalents of \d and \s are, so I end up typing those out
in even longer forms, like
[ SPC C-q TAB C-q C-j ]
which I type all the time, but it's still pretty hard to touch-type right the first
time! (One of my biggest frustrations is when I'm composing a keyboard macro, and all
the C-q contortions when typing a regexp cause me to do something that rings the bell and
aborts the whole macro.)
It also sure would be nice if copying a regexp from some random piece of perl code and
pasting it into emacs-lisp code just worked, and vice versa. Many times I've tried to
re-use old work and had to spend a while converting it manually, which is very
Also, the perl "x" syntax (allowing inline whitespace and comments) is really
nice. You can fake most of that in emacs by splitting a regexp into multiple lines and
using concat, but the more concise syntax would be better.
Random thought: what if the #r syntax allowed arbitrary delimiters like sed's
"s" does, so that #r"foo\bar" was equivalent to #r/foo\bar/ and
#r＠foo\bar＠ ? That would also allow trailing regexp flags like #r/foo/i and #r/foo \s+
Bound variables can be a PITA deep in a function, and re-search-* are
used in a lot of code.
True. case-fold-search is an analogous precedent, but that doesn't necessarily make
it a good idea.
Jamie Zawinski http://www.jwz.org/ http://www.dnalounge.com/
XEmacs-Beta mailing list