[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Whitespace search and regex.c
From: |
Stefan Monnier |
Subject: |
Whitespace search and regex.c |
Date: |
Mon, 22 Nov 2004 12:24:26 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
What is this recent change to regex.c w.r.t whitespace search all about?
This is really ugly.
As best as I can tell, this is to avoid the problem where
(replace-regexp-in-string " " "\\(?:\s-+\\)" ...) does not give the right
result because the " " could be inside brackets.
I think that changing regex.c for this one special case is a mistake.
Not only because it dirties up the regex.[ch] abstraction even further by
adding yet a bit more Emacs specific code in regex.[ch].
After all this problem manifests itself at a few other places (such as
regexp-opt-depth) as well. So I think a more general solution would be much
more useful and cleaner. E.g. a function (parse-partial-regex REGEXP POS)
which would return a value indicating whether POS is within brackets or not.
Stefan
- Whitespace search and regex.c,
Stefan Monnier <=