[Top][All Lists]

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

Re: Matches for multiline regexps

From: Luc Teirlinck
Subject: Re: Matches for multiline regexps
Date: Sun, 19 Jun 2005 20:57:18 -0500 (CDT)

Richard Stallman wrote:

   The code appears to be designed for uniline matches.  However, the
   Emacs 21 behavior you described is not desirable behavior.  It was
   merely how things happened to be.  Returning to that should not be
   the goal.

I took a closer look at the current occur code.  It definitely does
not make the slightest attempt at handling regexps that can match more
than one line.  The fact that the regexp does not match a newline
seems to be a basic assumption made in the current occur code.  The
fact that it seemed to try (but not succeed) to handle regexps that
could match newlines was merely an optical illusion.  The current
occur code does not make any attempt to handle overlapping matches
either.  The fact that it seemed to try was again an optical illusion.

The current occur code completely fails in several respects for
regexps that can match newlines.  This has been the situation for more
than three years now in CVS.  The fact that no bug reports were ever
filed shows that nobody using Emacs CVS has attempted to use occur for
a regexp that can match newlines in more than three years.  The only
reason I tried was out of curiosity, to check how it would handle
overlapping matches.

Making occur handle multiline matches (which it could do in 21.3, but
it apparently lost that ability when occur got completely rewritten
more than three years ago), as well as overlapping matches (which is
tricky and which occur never could) and change the way context lines
are handled seems to require a complete rewrite of the current occur
machinery into something much more complex.  That seems to be a major
task and I currently to not have the time to take it on.  Experience
of the last three plus years seems to show that nobody appears to be
interested in such functionality anyway.

Maybe somebody more familiar with, and more heavily interested in,
occur than I am might be willing to take on the task.  (I merely
stumbled on the problem by rereading man/search.texi, which was
extensively changed since I last read it.)

I will take care of flush-lines and keep-lines, however.  I am nearly
ready with it and only need to double check some things.



reply via email to

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