emacs-devel
[Top][All Lists]
Advanced

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

line continuation and font-lock


From: Werner LEMBERG
Subject: line continuation and font-lock
Date: Mon, 06 Feb 2006 09:20:24 +0100 (CET)

I wonder how I can handle the line continuation character of groff in
font-lock.  Contrary to other languages, a trailing `\' is handled on
the input level, before anything else.  For example

  This is a \
  .test

is equal to

  This is a .test

Similarly,

  .foo "This is a \
  test"

Is equal to

  .foo "This is a test"

Consequently, for proper fontification, I have to handle trailing
backslashes earlier than anything else, too.  Looking into the
documentation I wasn't able to find a method to do that.  The nearest
thing I can find is font-lock-syntactic keywords, but I have the
feeling that this a)comes too late and b)is not appropriate, since
backslashes are not limited to any synctical element.

A possible solution might be to call a function which assigns a
special text property to the newline character if preceded by `\'
(basically an `ignore me' or `neutral' category) while doing
fontification.  Unfortunately, regular expressions don't have access
to text properties...

Any ideas?


    Werner




reply via email to

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