unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: regexp font-lock highlighting
Date: Wed, 01 Jun 2005 05:39:46 -0400	[thread overview]
Message-ID: <E1DdPhS-0003mp-MA@fencepost.gnu.org> (raw)
In-Reply-To: <429AD1B5.1020408@gmx.at> (message from martin rudalics on Mon, 30 May 2005 10:41:25 +0200)

    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.

  parent reply	other threads:[~2005-06-01  9:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-30  8:41 regexp font-lock highlighting martin rudalics
2005-05-31  2:45 ` Daniel Brockman
2005-06-01  9:39 ` Richard Stallman [this message]
2005-06-04  8:11   ` martin rudalics
2005-06-04 17:59     ` Richard Stallman
2005-06-06  9:33       ` martin rudalics
2005-06-11 23:17         ` Richard Stallman
2005-06-15 16:00           ` martin rudalics
2005-07-03  0:09             ` Juri Linkov
2005-07-03  4:10               ` Luc Teirlinck
2005-07-03  6:03               ` Eli Zaretskii
2005-07-03  9:10                 ` martin rudalics
2005-07-04  0:09                   ` Miles Bader
2005-06-06 13:05 ` Juri Linkov
2005-06-08 15:13   ` martin rudalics
2005-06-08 20:34     ` Juri Linkov
2005-06-08 22:42       ` Stefan Monnier
2005-06-08 23:32         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1DdPhS-0003mp-MA@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).