unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Embedded modifiers in the regex engine
@ 2016-02-25  1:32 Dima Kogan
  2016-02-25  6:11 ` John Wiegley
  2016-02-25 16:15 ` Eli Zaretskii
  0 siblings, 2 replies; 22+ messages in thread
From: Dima Kogan @ 2016-02-25  1:32 UTC (permalink / raw)
  To: emacs-devel

Hi.

I've been thinking of ways to make some fancier aspects of isearch and
hi-lock work better, specifically, the way we handle the different
modes: case-fold, char-fold, lax-whitespace, etc.

The relevant bugs I filed recently:

  http://debbugs.gnu.org/22541
  http://debbugs.gnu.org/22520
  http://debbugs.gnu.org/22479

In short, different parts of emacs (isearch, isearch history, hi-lock,
etc) treat these modes inconsistently, which results in unexpected
behavior.

The best solution I can think of to clean this up is also the most
intrusive: adding support for pcre-style embedded modifiers to
activate/deactivate the modes.

So for instance "\\(?i\\)asdf" would be interpreted as a case-folding
regex regardless of the value of case-fold-search. I think this would be
a great thing to have in general, but for the specific issues in the
bugs above, it'd make things simpler and more correct.

As an example, currently hi-lock generates a complicated-looking regex
to emulate char-folding and case-folding. If we supported the modifiers,
this change would simply be a prepend of "\\(?i\\)" or whatever other
modes we want. This is simple and expected to be bug-free on the hi-lock
level. Bugs such as hi-lock not supporting char-fold and case-fold at
the same time would not happen.

Clearly this is a big change to a core component, so I want to talk
about it first. I looked at our regex implementation, and it looks
possible to add this. But I've seen talk of merging our regex
implementation with the glibc one, so the merge should clearly happen
first.

Also I don't want to touch this without a test suite for our regex
engine. So that would need to happen beforehand as well.

Again, I think this feature would be useful even beyond the context of
these bugs. Thanks for the input.

dima



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-04-24  7:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25  1:32 Embedded modifiers in the regex engine Dima Kogan
2016-02-25  6:11 ` John Wiegley
2016-02-25 21:05   ` Stefan Monnier
2016-02-25 16:15 ` Eli Zaretskii
2016-02-26  7:19   ` Dima Kogan
2016-02-26  9:08     ` Eli Zaretskii
2016-02-28  1:50       ` Dima Kogan
2016-02-28 16:00         ` Eli Zaretskii
2016-02-29 13:30           ` Richard Stallman
2016-03-01  0:49             ` Aurélien Aptel
2016-03-01 16:55               ` Richard Stallman
2016-03-09  0:34                 ` Dima Kogan
2016-03-28  0:23                   ` Dima Kogan
2016-03-28 15:28                     ` Eli Zaretskii
2016-03-28 18:05                       ` Dima Kogan
2016-03-28 18:24                         ` Eli Zaretskii
2016-03-29 21:23                           ` Dima Kogan
2016-03-31 16:28                             ` Eli Zaretskii
2016-04-23  4:17                             ` Dima Kogan
2016-04-23  7:48                               ` Eli Zaretskii
2016-04-24  7:34                                 ` Dima Kogan
2016-03-28 16:09                     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).