all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

* 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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.