[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
font-lock and multiline comments
From: |
bmaron2 |
Subject: |
font-lock and multiline comments |
Date: |
9 Feb 2007 12:14:53 -0800 |
User-agent: |
G2/1.0 |
I am writing a new major mode for an in-house programming language.
We'd like to have emacs do syntactic highlighting on the comments. The
language supports two kinds of comments:
// In-line C++ style comments
Comments
Multi-line comments flagged by Comments/EndComments
Here is another line
EndComments
The in-line style I was able to easily add with a syntax table
modification. The multi-line comments, however, I can't do because the
syntax tables only support comment syntax with 1 or 2 characters.
I then turned to font-lock mode. Adding the following font-lock
keyword didn't work if there were more than maybe 7 or 8 lines between
Comments and EndComments:
'("^[ \t]*Comments\\(.\\|\n\\)*EndComments" . font-lock-comment-face)
Apparently font-lock regions aren't designed to span multiple lines?
Can someone tell me how to get font-lock to recognize and properly
mark these multi-line comments?
Many thanks!!
- font-lock and multiline comments,
bmaron2 <=