emacs-devel
[Top][All Lists]
Advanced

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

Re: Whitespace search and regex.c


From: Richard Stallman
Subject: Re: Whitespace search and regex.c
Date: Wed, 24 Nov 2004 21:21:39 -0500

    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.

It has nothing to do with replace-regexp-in-string, which doesn't use
this feature.  It is for the sake of user-level search features that
want a series of SPCs to stand for some broader kind of whitespace.

    Not only because it dirties up the regex.[ch] abstraction even further by
    adding yet a bit more Emacs specific code in regex.[ch].

The Emacs version of regex.c is forever forked from the others.  A new
version of the regex code is being adopted in all our other packages,
but it doesn't handle a split buffer, so Emacs can't use it.

    After all this problem manifests itself at a few other places (such as
    regexp-opt-depth) as well.

I don't follow how this relates to regexp-opt-depth.
Would you please spell that out?

    E.g. a function (parse-partial-regex REGEXP POS)
    which would return a value indicating whether POS is within brackets or not.

That would be helpful for making C-q SRC in I-search DTRT both
inside and outside brackets.




reply via email to

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