emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Useful syntax highlighting (font lock) in a mixed xml lua file


From: Lennart Borgman
Subject: Re: Useful syntax highlighting (font lock) in a mixed xml lua file
Date: Sun, 1 Jan 2012 21:32:30 +0100

On Sun, Jan 1, 2012 at 21:18, Timur Aydin <address@hidden> wrote:
> Hello and a happy new year to everyone!
>
> I had sent the following post to the help-gnu-emacs group, but thinking
> that it might require some special lisp programming, wanted to post the
> same question here as well...

In principle this can be done by defining a multi major mode with
mumamo (which is part of nXhtml).

There are several examples in nXhtml for how to define multi major
modes. (See all the .el files that have "mumamo" in their names.)

> -------- Original Message --------
> Subject: Useful syntax highlighting (font lock) in a mixed xml lua file
> Date: Fri, 30 Dec 2011 22:47:10 +0200
> From: Timur Aydin <address@hidden>
> To: address@hidden
>
> Hi,
>
> I am working on an xml file that has an embedded CDATA section which
> contains lua source code. I am mostly working on the lua code and would
> like that code to be syntax highlighted by emacs. When I activate
> lua-mode, it understandably gets confused because of all the surrounding
> xml. When I activate xml-mode, the xml stuff is properly syntax
> highlighted, but the lua code in the CDATA section is uniformly colored
> plain text.
>
> Is there a way to utilize font-lock mode in a sensible manner? I
> attempted to put the lua code in a separate file (script.lua) and then
> included it into the xml using DOCTYPE and ENTITY tags, but this didn't
> help, because I don't have any control over the software that parses
> this xml file. It isn't able to deal with extra xml tags.
>
> So my only hope is to be able to tell emacs to font-lock a region
> bounded by a CDATA tag using lua-mode and to font-lock the rest using
> xml-mode. Is there a way to do this?
>
> --
> Timur Aydin
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]