[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regexp font-lock highlighting
From: |
Richard Stallman |
Subject: |
Re: regexp font-lock highlighting |
Date: |
Wed, 01 Jun 2005 05:39:46 -0400 |
Moreover I don't think that anything is "broken" in the following:
;; Underline innermost grouping, so that you can more easily see
what
;; belongs together. 2005-05-12: Font-lock can go into an
;; unbreakable endless loop on this -- something's broken.
;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]"
;;1 'underline prepend)
I believe that `font-lock-fontify-keywords-region' starts backtracking
and this can take hours in more complicated cases.
That sounds like "broken" to me. Whether it takes hours, or forever,
either way Font Lock mode will be very unpleasant to use.
Anyway, regexps are
not suited to handle this. If you are willing to pay for two additional
buffer-local variables such as
I believe you, and it is ok to add local variables for this purpose.
(Their names should start with `font-lock-' so that people understand
what they are for. Or perhaps with `lisp-fl-' since they are
specifically for Lisp mode.)
Your code is large enough that we need papers to install it.
I will send you some instructions in another message.
Meanwhile, I will revert the change that introduced this code.
The idea was good, but the current code is not good.
Finally, I would use three distinct font-lock faces for regexps:
Those suggestions look good to me.
- Re: regexp font-lock highlighting,
Richard Stallman <=