Emacs HTML Mode Sucks
Cezar Halmagean wrote:
I wonder what's the problem, why has an editor like TextMate gone so far in just a few years and Emacs is still not there yet.
You might try “html-helper-mode”. I don't think it'll beat any major editor that do HTML, but it somewhat helps because by default it does syntax coloring various languages that are used together with HTML.
(of course emacs fans will tell you about several elisp code on the wild that do multi modes, but the sheer fact to shop around, install, get them to work is a pain and rather not trivial. for those interested, see http://www.emacswiki.org/cgi-bin/wiki/MultipleModes )
I think to have emacs work with today's web dev needs out of the box is one of the most important need for emacs. [see Modernization of Emacs]
Even for working with pure static HTML pages, emacs's default HTML mode is quite lacking. The default HTML mode in emacs 22 (released in 2007), is at a level of ~1998's commercial HTML editors. (of course emacs has redeeming qualities, i.e. its elisp system and all, that keeps us still sticking with emacs)
One trick i do when i need proper syntax coloring, is just to switch to that lang's mode. For example, if i'm working in a PHP segment, i just switch to PHP mode. You can assign single-press keys to switch to different modes.
One could guess why emacs doesn't have a robust mode for working with today's HTML. My guess is that it's a bit hard to write such a “mixed” mode possibly due to emacs infrastructure for modes, and of course because there are relatively very few emacs developers, and there's not a good tutorial on how to write a emacs mode (it involves quite a lot elisp knowledge in several areas. I'm currently picking it up and hope to write a tutorial soon).
Michael Schuerig wrote:
That's one of the emacs major problem today.
Basically currently there's no solution. “js2-mode” have some problems working with several of the multi mode thing.
Your current work around is:
non of the above is robust.
The “nxhtml-mode” attempts to fix the HTML multi-language problem from the ground up, based on the “nxml-mode” and some multi-mode mechanism called something like mumbo-ma-muu.
The “html-helper-mode” is a basic attempt to have a mode that just works with the multi-lang nature of HTML.
none of the above i have much experience. They are too much headache to install, or dig into.
also, there are Ruby modes that are designed specifically for mixed Ruby and HTML. Search for Ruby On Rail something.
- Emacs Modernization: Simple Changes Emacs Should Adopt
- Why Emacs Keys are Painful
- Emacs: Problems of the Scratch Buffer
- Emacs M-key Notation vs Alt+key Notation
- Emacs Menu Usability Problem
- Emacs Mode Line Problem
- Emacs cua-mode Problems
- Emacs: Inconsistency of Search Features
- Problems of grep in Emacs
- Emacs: Usability Problems of Mode Documentation
- Problems of Emacs Manual
- Emacs Manual Sucks by Examples
- Emacs: kill-buffer Induces Buffer Accumulation
- Emacs Spell Checker Problems
- Emacs Form Feed ^L
- Emacs: Single Key to Delete Whole Line
- Emacs HTML Mode Sucks
- Emacs Does Not Support Viewing Images Files In Windows
- Emacs Should Adopt HTML as Texinfo Replacement
- Emacs Should Support HTML Mail
- Problems of Emacs's “man” Command
- Emacs Lisp Mode Syntax Coloring Problem
- Emacs AutoHotkey Mode Problems
- Emacs Lisp: Ban Syntax Table
- Emacs: Make elisp-index-search use Current Symbol
- Emacs GNU Texinfo Problems; Invalid HTML
- A Record of Frustration in IT Industry; Disappearing FSF URLs, 2006
- Emacs Manual Node Persistency Issues
- Emacs: dired-do-query-replace-regex Replace ALL (fixed)
- Problems of Emacs Supporting Obsolete Systems
- Emacs Lisp: Function to Copy/Delete a Dir Recursively (fixed)
- Thoughts on Common Lisp Scheme Lisp Based Emacs
- Text Editors Popularity and Market Research
- Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++)
- Emacs: Toggle Letter Case 🚀
- Emacs: Select Line, between Quotes, Extend Selection 🚀
- Emacs: isearch Current Word 🚀
- Emacs: Reformat Lines (Hard-Wrap lines, fill) 🚀