unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* font-lock and multiline comments
@ 2007-02-09 20:14 bmaron2
  2007-02-09 20:28 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: bmaron2 @ 2007-02-09 20:14 UTC (permalink / raw)
  To: help-gnu-emacs

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!!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-09 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-09 20:14 font-lock and multiline comments bmaron2
2007-02-09 20:28 ` Stefan Monnier
2007-02-09 20:45   ` bmaron2

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).