help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to edit "mixed" (e.g. HTML/JavaScript) files?


From: David Hansen
Subject: Re: How to edit "mixed" (e.g. HTML/JavaScript) files?
Date: Thu, 08 Mar 2007 15:11:15 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]