unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Le Wang <l26wang@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: example of multi-line font-locking
Date: Sun, 26 Feb 2012 16:53:58 -0500	[thread overview]
Message-ID: <jwvwr798dvk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAM=K+iqEN_ZjDu3a_+9ztmsvqT5Orj15FazAMQ0Ujr_ij6CzdA@mail.gmail.com> (Le Wang's message of "Sun, 26 Feb 2012 22:39:29 +0800")

> I asked this question on stackoverflow:
> http://stackoverflow.com/questions/9452615/emacs-is-there-a-clear-example-of-multi-line-fontlocking

> Can anyone point me to an example of how to use the features described in
> the manual?

Which feature?  There are various.

Most of the "multiline font locking" features are aimed at solving the
situation were a single font-lock rule can match a chunk of text that
spans several lines (e.g. putting a bold font on text within
"\textbf{...}").

For your case (of highlighting the CSS or Javascript part of an HTML
buffer), I think that a "multi-major-mode" approach is more promising,
tho this is an even harder problem to solve than mere multiline
font locking.


        Stefan



  reply	other threads:[~2012-02-26 21:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26 14:39 example of multi-line font-locking Le Wang
2012-02-26 21:53 ` Stefan Monnier [this message]
2012-02-27  3:31   ` Le Wang

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=jwvwr798dvk.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=l26wang@gmail.com \
    /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 public inbox

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

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