From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Le Wang Newsgroups: gmane.emacs.devel Subject: Re: example of multi-line font-locking Date: Mon, 27 Feb 2012 11:31:15 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0443066226372f04b9e9be0c X-Trace: dough.gmane.org 1330313484 31348 80.91.229.3 (27 Feb 2012 03:31:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2012 03:31:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 27 04:31:23 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S1rJ4-00024z-Rt for ged-emacs-devel@m.gmane.org; Mon, 27 Feb 2012 04:31:23 +0100 Original-Received: from localhost ([::1]:40303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1rJ4-0001Zg-7P for ged-emacs-devel@m.gmane.org; Sun, 26 Feb 2012 22:31:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1rJ0-0001ZQ-Lj for emacs-devel@gnu.org; Sun, 26 Feb 2012 22:31:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1rIz-0001DR-2x for emacs-devel@gnu.org; Sun, 26 Feb 2012 22:31:18 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:64345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1rIy-0001DF-SC for emacs-devel@gnu.org; Sun, 26 Feb 2012 22:31:17 -0500 Original-Received: by wgbdt12 with SMTP id dt12so288228wgb.30 for ; Sun, 26 Feb 2012 19:31:15 -0800 (PST) Received-SPF: pass (google.com: domain of l26wang@gmail.com designates 10.180.101.72 as permitted sender) client-ip=10.180.101.72; Authentication-Results: mr.google.com; spf=pass (google.com: domain of l26wang@gmail.com designates 10.180.101.72 as permitted sender) smtp.mail=l26wang@gmail.com; dkim=pass header.i=l26wang@gmail.com Original-Received: from mr.google.com ([10.180.101.72]) by 10.180.101.72 with SMTP id fe8mr23962709wib.4.1330313475653 (num_hops = 1); Sun, 26 Feb 2012 19:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=okfctCXSaZ4SqQKf2Tr2ogHgIw9vDCTgLIRXcXxsHoQ=; b=xZU26xnER+/1SFxWnqj/grI2Ncm+AxA4OS/pT/W8bSHkhYPoH4z+pDPMe0o2j+DRYA w+IYxGhz3I1pcl2jFi/y62lHLlynxOBXRdRk9JRFEsTX8S8LtyWGKla0tLWsbDipqqqo NQdk5bci5ezIGkMy2FRvf0hNOdQyRp14kCnpM= Original-Received: by 10.180.101.72 with SMTP id fe8mr19116102wib.4.1330313475536; Sun, 26 Feb 2012 19:31:15 -0800 (PST) Original-Received: by 10.216.29.130 with HTTP; Sun, 26 Feb 2012 19:31:15 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148804 Archived-At: --f46d0443066226372f04b9e9be0c Content-Type: text/plain; charset=ISO-8859-1 On Mon, Feb 27, 2012 at 5:53 AM, Stefan Monnier wrote: > > 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. > This section of the manual: http://www.gnu.org/software/emacs/manual/html_node/elisp/Multiline-Font-Lock.htmllacks an example that ties it all together, IMO. 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. > I'm sorry. I realize now that my question was unclear. I don't want mode specific highlighting within javascript/css chunks. I only want to see that the chunks are there by applying a face with a slightly different background. So this is simply a problem of multiline font-locking. -- Le --f46d0443066226372f04b9e9be0c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Feb 27, 2012 at 5:53 AM, Stefan Monnier = <monnier@i= ro.umontreal.ca> wrote:
> I asked this question on stackoverflow:
> http://stackove= rflow.com/questions/9452615/emacs-is-there-a-clear-example-of-multi-line-fo= ntlocking

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

Which feature? =A0There are various.
=A0
This = section of the manual: http://www.gnu.org/software/emacs= /manual/html_node/elisp/Multiline-Font-Lock.html lacks an example that = ties it all together, IMO.

Most of the "multiline font locking" features are aimed at solvin= g 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 promi= sing,
tho this is an even harder problem to solve than mere multiline
font locking.

I'm sorry.=A0 I realize now that my question w= as unclear.=A0 I don't want=20 mode specific highlighting within javascript/css chunks.=A0 I only want to see that the chunks are there by applying a face with a slightly different= background.=A0 So this is simply a problem of multiline font-locking.
=A0


--
Le
--f46d0443066226372f04b9e9be0c--