From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Hansen Newsgroups: gmane.emacs.help Subject: Re: How to edit "mixed" (e.g. HTML/JavaScript) files? Date: Thu, 08 Mar 2007 15:11:15 +0100 Organization: disorganized Message-ID: <87slcfhlks.fsf@localhorst.mine.nu> References: <87hcsw2hhw.fsf@gmail.com> <87wt1sgdjs.fsf@localhorst.mine.nu> <45F00F30.60707@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173363840 23091 80.91.229.12 (8 Mar 2007 14:24:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 14:24:00 +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 15:23:49 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 1HPJWz-0004EL-Ud for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 15:23:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPJXC-0000Oa-QI for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 09:23:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPJWy-0000Kd-R8 for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 09:23:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPJWx-0000IT-6X for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 09:23:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPJWw-0000IQ-Ua for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 09:23:42 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPJWj-0004vs-6N for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 09:23:29 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPJWZ-0002na-0w for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 15:23:19 +0100 Original-Received: from e178028146.adsl.alicedsl.de ([85.178.28.146]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 15:23:18 +0100 Original-Received: from david.hansen by e178028146.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 15:23:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 33 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: e178028146.adsl.alicedsl.de Mail-Copies-To: nobody User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:0jxQ51IxwEKa2fy6wBfVNOL9Gzk= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:41796 Archived-At: On Thu, 08 Mar 2007 14:27:12 +0100 Lennart Borgman wrote: > Did you try nXhtml above? It should work OTB. Drawbacks is that it > requires the Emacs 22 beta. Maybe also in the beginning that it uses > nxhtml-mode for XHTML. > > nXhtml takes another approach to multiple modes. Since Emacs > actually have no way to restrict a mode to only handle part of a > buffer (not even in Emacs 22) it instead switches mode. See the home > page for more info. My experiences all come from editing .jsp files. I doubt this approach will work here. Java mode will be totally confused by the html parts. Also note that switching the mode may be OK for small files but complete fortification of a >1k lines file takes some time that is not acceptable during editing (but i have to admit that i haven't tried nxhtml yet). The multi-mode.el approach is to have multiple indirect buffers with different major modes and it narrows to the region with `point'. You don't have to run the major-mode command all the time and the current major mode won't get confused by the rest of the buffer but indentation can only work within one region. There are a some more minor glitches (especially font-locking) but i think it's at least a promising approach. I hope this topic will get some more attention after the upcoming (?) release of Emacs 22. David