unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Using syntax info for font-locking?
Date: Sat, 28 Oct 2006 10:26:47 +0200	[thread overview]
Message-ID: <87vem4rgl4.fsf@hans.local.net> (raw)
In-Reply-To: <1161981827.499222.259570@k70g2000cwa.googlegroups.com> (spamfilteraccount@gmail.com's message of "27 Oct 2006 14\:42\:49 -0700")

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

  reply	other threads:[~2006-10-28  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-27 21:42 Using syntax info for font-locking? spamfilteraccount
2006-10-28  8:26 ` Dieter Wilhelm [this message]
     [not found] ` <mailman.329.1162024023.27805.help-gnu-emacs@gnu.org>
2006-10-28 14:14   ` spamfilteraccount
2006-10-28 15:55     ` Dieter Wilhelm
  -- strict thread matches above, loose matches on Subject: below --
2006-10-27 20:44 spamfilteraccount

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=87vem4rgl4.fsf@hans.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@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.
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).