[Top][All Lists]

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

Re: [PATCH] Emacs-mode

From: Heikki Johannes Junes
Subject: Re: [PATCH] Emacs-mode
Date: Wed, 17 Apr 2002 01:21:57 +0300 (EET DST)

> Heikki, I don't think there's any need for those complicated regexps for
> matching strings and comments. If you remove "font-lock-keywords-only",
> the fontification works perfectly well using just the syntax table, and
> it recognises strings within strings, comments within comments...

Hmm. Blocks comments and strings would work that way but '%' -end-line
comments did not.
> (I've just noticed in the elisp manual about updating syntax table
> properties using font-lock mode regexp matching... I wonder if that might
> help with some of the uglier aspects of our mode. Must look into this
> sometime...)
> -- 
> chris

The fontifying is practically done by using brute force: 

  1. Fontify something first.
  2. Fontify then the following thing "on top".
  3. Repeat step 2. as many times it is necessary.

As this procedure is continued, at the end, comments and strings had to be
refontified. Obviously, there should be a more clever way. 

It is much faster to proofread the source by looking at the colors. The
"brute force"-algorithm described above serves for proofreading: For
example, if one writes "\p" and then hits 'f' and have "\pf" Emacs
notifies that "\pf" is no more a keyword and fontifies it with a different
color. In practice it is implemented the following way: fontify everything
as non-keywords ("\pf") and then refontify those which are keywords

After the last patch sent by me (-hjj5) fontifying works with Emacs
version 21.1.1 and helps _a lot_ to find out typos. As already mentioned,
font-locking could be implement a more clever way.

      Heikki Junes

reply via email to

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