From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.help Subject: Re: How to edit "mixed" (e.g. HTML/JavaScript) files? Date: Thu, 08 Mar 2007 12:02:34 +0100 Message-ID: <87mz2odmlx.fsf@gmail.com> References: <87hcsw2hhw.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173357627 357 80.91.229.12 (8 Mar 2007 12:40:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 12:40:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 08 13:40:20 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HPHuu-0000rA-5y for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 13:40:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPHv6-0008Nw-FQ for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 07:40:32 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-X-Trace: individual.net si/ln3L2mLG1FTWnqo78mg8RPBJpCwjAkFHQTcARQppki/vQ5e X-Orig-Path: news.individual.net!news X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:gB1fULsWEJq+8EhvrDA3h+fmuVw= Original-Xref: shelby.stanford.edu gnu.emacs.help:146186 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41793 Archived-At: Hadron writes: > "Lennart Borgman (gmail)" writes: > >> kj wrote: >>> It often happens that a single file must contain code corresponding >>> to two different syntaxes. For example, an HTML file with embedded >>> JavaScript or CSS. >>> >>> Is there a way to *locally* override the mode of a file and replace >>> it with a different mode? >>> >>> If not, is there a good way to deal with such situations (other >>> than avoiding them altogether)? >>> >>> Thanks! >>> >>> kj >> >> It depends on whom you ask ;-) >> >> You may try nxhtml-part-mode in nXhtml (you need Emacs 22 beta): >> >> http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html >> >> Or you may try this >> >> http://www.emacswiki.org/cgi-bin/wiki/MultipleModes >> >> > > Has anyone recently got this multiplemodes working? The wiki reads like > a slaughter house! ok, I bit the bullet. I followed the instructions here: http://www.emacswiki.org/cgi-bin/wiki/HtmlModeDeluxe having installed php-mode, downloaded stefans css-mode, mmm-mode and pqsml from synaptic in Ubuntu. I created a "my-mmm.el" pasting in the code listed there to configure the html editing. It all worked well "enough". The default hiliting is attrocious IMO and I had to change mmm-default-submode-face to grey12. The mode changes when I am in embedded php. Interestingly though css-mode is the major mode for css files, not mmm mode. Any ideas why? --