unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: bmaron2@hotmail.com
To: help-gnu-emacs@gnu.org
Subject: font-lock and multiline comments
Date: 9 Feb 2007 12:14:53 -0800	[thread overview]
Message-ID: <1171052093.030862.26790@v33g2000cwv.googlegroups.com> (raw)

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

             reply	other threads:[~2007-02-09 20:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 20:14 bmaron2 [this message]
2007-02-09 20:28 ` font-lock and multiline comments Stefan Monnier
2007-02-09 20:45   ` bmaron2

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=1171052093.030862.26790@v33g2000cwv.googlegroups.com \
    --to=bmaron2@hotmail.com \
    --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).