[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using syntax info for font-locking?
From: |
Dieter Wilhelm |
Subject: |
Re: Using syntax info for font-locking? |
Date: |
Sat, 28 Oct 2006 10:26:47 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
spamfilteraccount@gmail.com writes:
> Some people here
>
> http://erlide.sourceforge.net/
>
> badmouths Emacs (the heretics! :), because it cannot provide as good
> syntax highlighting for Erlang as their Eclipse-based Erlang IDE.
>
> As far as I know they use the actual syntax information provided by an
> Erlang node to do syntax highlighting.
>
> I'm not very familiar with the implementation of font locking in Emacs.
> If real-time syntax info for the current source file is available then
> could Emacs use it for font locking?
It can be done, some guy on this list pointed me to the possibility of
specifying functions instead of regexps in the font-lock mechanism.
I'm using this for font-locking of user defined variables in a certain
programming mode. My impressions, so far, are that that this is
rapidly becoming computationally very expensive for larger files. I'm
not so deep into font-locking, there might be some tricks out there
which take advantage of syntactical checks Emacs is doing anyway. But
at my state of knowledge the consequence of this "dynamic"
font-locking means to check after *any* self inserting key the whole
file and re-fontify it.
>
> Or font locking in Emacs is always static, done with predefined regexps
> and stuff?
So far I found only static examples. I too hope in this thread
there'll pipe up examples to the contrary.
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany