all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Titus von der Malsburg <malsburg@gmail.com>
To: Timur Aydin <ta@taydin.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Useful syntax highlighting (font lock) in a mixed xml lua file
Date: Tue, 3 Jan 2012 18:11:49 +0100	[thread overview]
Message-ID: <CAM+LvrBZnXRtR7pXGg2RH-+6V+D+QFaSauOZA6UXQ4aqNY2efw@mail.gmail.com> (raw)
In-Reply-To: <4EFE234E.8040807@taydin.org>

Perhaps you can use MuMaMo?

   http://www.emacswiki.org/emacs/MuMaMo

   "Mumamo is a library for cooperation of multiple
   major modes in a buffer. mumamo divides the buffer
   into chunks, each with its own major mode."

Titus

On Fri, Dec 30, 2011 at 9:47 PM, Timur Aydin <ta@taydin.org> wrote:
> 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
>



-- 
Titus von der Malsburg
DFG Research Group 868: Mind and Brain Dynamics
Dept. of Linguistics, University of Potsdam
http://www.ling.uni-potsdam.de/~malsburg/



      parent reply	other threads:[~2012-01-03 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 20:47 Useful syntax highlighting (font lock) in a mixed xml lua file Timur Aydin
2012-01-01 20:18 ` Fwd: " Timur Aydin
2012-01-01 20:32   ` Lennart Borgman
2012-01-03 11:03 ` David Edmondson
2012-01-03 17:11 ` Titus von der Malsburg [this message]

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=CAM+LvrBZnXRtR7pXGg2RH-+6V+D+QFaSauOZA6UXQ4aqNY2efw@mail.gmail.com \
    --to=malsburg@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ta@taydin.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.