From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Timur Aydin Newsgroups: gmane.emacs.help Subject: Useful syntax highlighting (font lock) in a mixed xml lua file Date: Fri, 30 Dec 2011 22:47:10 +0200 Message-ID: <4EFE234E.8040807@taydin.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325366251 29111 80.91.229.12 (31 Dec 2011 21:17:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2011 21:17:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 31 22:17:27 2011 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Rh6Iw-0005xr-4f for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Dec 2011 22:17:26 +0100 Original-Received: from localhost ([::1]:46989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rh6Iv-0004QK-Aa for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Dec 2011 16:17:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:42604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgjMS-0004TM-WE for help-gnu-emacs@gnu.org; Fri, 30 Dec 2011 15:47:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgjMR-00039w-Rw for help-gnu-emacs@gnu.org; Fri, 30 Dec 2011 15:47:32 -0500 Original-Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:52083) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RgjMR-00039f-AW for help-gnu-emacs@gnu.org; Fri, 30 Dec 2011 15:47:31 -0500 Original-Received: (qmail 619 invoked by uid 0); 30 Dec 2011 20:47:29 -0000 Original-Received: from unknown (HELO box401.bluehost.com) (69.89.31.201) by cpoproxy3.bluehost.com with SMTP; 30 Dec 2011 20:47:29 -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:Subject:To:MIME-Version:From:Date:Message-ID; bh=pCMgkQ5Hk+NuELCVNeGUbSbza5LwzEOHupjcMVq1gKA=; b=DjDJ3fWEZv3qyivT+oscnxpgGo6GTGVDT56eTUq9XQd5eIrEwPDEqKoHgyOMxywqYAeDW3w1FljCGVPgio7anMZdi45mCi7gEGLkguROfFauTNJFjotQehcbldMm6lXl; Original-Received: from [78.189.105.178] (helo=[10.2.1.100]) by box401.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RgjMO-0002f7-RX for help-gnu-emacs@gnu.org; Fri, 30 Dec 2011 13:47:29 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 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: 67.222.54.6 X-Mailman-Approved-At: Sat, 31 Dec 2011 16:17:21 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83274 Archived-At: 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