From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Timur Aydin Newsgroups: gmane.emacs.devel Subject: Fwd: Useful syntax highlighting (font lock) in a mixed xml lua file Date: Sun, 01 Jan 2012 22:18:32 +0200 Message-ID: <4F00BF98.2010306@taydin.org> References: <4EFE234E.8040807@taydin.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325449123 10807 80.91.229.12 (1 Jan 2012 20:18:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2012 20:18:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 01 21:18:39 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RhRrb-0003qc-6s for ged-emacs-devel@m.gmane.org; Sun, 01 Jan 2012 21:18:39 +0100 Original-Received: from localhost ([::1]:40435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhRra-0003Rx-9G for ged-emacs-devel@m.gmane.org; Sun, 01 Jan 2012 15:18:38 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RhRrW-0003Rl-Sq for emacs-devel@gnu.org; Sun, 01 Jan 2012 15:18:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RhRrV-0005KV-P3 for emacs-devel@gnu.org; Sun, 01 Jan 2012 15:18:34 -0500 Original-Received: from oproxy4-pub.bluehost.com ([69.89.21.11]:37442) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RhRrV-0005Ik-Gi for emacs-devel@gnu.org; Sun, 01 Jan 2012 15:18:33 -0500 Original-Received: (qmail 24818 invoked by uid 0); 1 Jan 2012 20:18:31 -0000 Original-Received: from unknown (HELO box401.bluehost.com) (69.89.31.201) by cpoproxy1.bluehost.com with SMTP; 1 Jan 2012 20:18:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=taydin.org; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:To:MIME-Version:From:Date:Message-ID; bh=KorMl21JKUiFD2mps1ZHlByY5c/qT/lrc4IHLzZrwqg=; b=X8Mc78vvFXAsXACGqT3zfgavA9k89gwZoZJOjF92kSlvU3Jsq7LIIYkBoaGJtW9pOdSuYQBBcRDuRfUfq/LhPS7ugvzcWgEuiiBi8Vj9WOjeuLNI0VcoQ6fvfII/rSYW; Original-Received: from [78.189.105.178] by box401.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RhRrR-00023V-Ne for emacs-devel@gnu.org; Sun, 01 Jan 2012 13:18:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111127 Thunderbird/8.0 In-Reply-To: <4EFE234E.8040807@taydin.org> X-Forwarded-Message-Id: <4EFE234E.8040807@taydin.org> X-Identified-User: {1590:box401.bluehost.com:taydinor:taydin.org} {sentby:smtp auth 78.189.105.178 authed with ta@taydin.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 69.89.21.11 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:147134 Archived-At: 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... -- Timur -------- 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 To: help-gnu-emacs@gnu.org 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