all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: regular expression help (again)
Date: Mon, 28 Jan 2013 09:33:57 -0500	[thread overview]
Message-ID: <jwv38xltmjz.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: CAKoxK+629M4CN6L0gbayrH5OQ6Xi4QgYuC9Y-_KR-VfjWL27mA@mail.gmail.com

> there is something I'm missing: I'm still writing my mode for a
> programming language and I'd like to set a font-lock for a block of
> lines that begins with /SOMETHING and ends with /* like the following:

I recommend you take a look at (info "(elisp)Multiline Font Lock").

Also in some cases, you can use syntax-propertize-function instead, to
mark the whole construct as a kind of comment or string.  Then use
font-lock-syntactic-face-function to highlight the block with
a particular face (if the default string-face or comment-face is not
good enough).  And then in font-lock-keywords, you can match "word that
is not made by underscores" and use (syntax-ppss) to decide whether it's
within a /MASK block or not to decide how to highlight it.


        Stefan




  parent reply	other threads:[~2013-01-28 14:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24  7:22 regular expression help (again) Luca Ferrari
2013-01-24  9:23 ` Luca Ferrari
2013-01-28 14:33 ` Stefan Monnier [this message]
     [not found] <mailman.18180.1359012159.855.help-gnu-emacs@gnu.org>
2013-01-24  9:01 ` Barry Margolin

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=jwv38xltmjz.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.