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.
- Simple Changes Emacs Should Adopt
- Why Emacs Keys are Painful
- Ban Scratch Buffer
- M-x vs Alt+x Notation
- Menu Idiocy
- Mode Line Problem
- cua-mode Problem
- Inconsistency of Search
- grep in emacs Pain
- Problems of describe-mode
- Problems of Emacs Manual
- Emacs Manual Sucks by Examples
- kill-buffer Problem
- Emacs Spell Checker Pain
- Form Feed ^L
- Single Key Delete Whole Line
- Emacs HTML Mode Sucks
- Emacs No View Image on Windows
- HTML should replace Texinfo
- Support HTML Mail
- Problems of “man”
- Emacs Lisp Mode Syntax Coloring Problem
- Emacs AHK Mode Problems
- Ban Syntax Table
- Make elisp-index-search use Current Symbol
- Texinfo Invalid HTML
- Disappearing FSF URLs, 2006
- Emacs Manual Node Persistency Issues
- Emacs: dired-do-query-replace-regex Replace ALL (fixed)
- Problems of Emacs Supporting Obsolete Systems
- Elisp: Function to Copy/Delete a Dir Recursively (fixed)
- CommonLisp/SchemeLisp Emacs
- Text Editors Popularity
- Cursor Movement Behavior Survey
- Letter-Case Commands Problem
- Select Line/Block/Quote, Extend
- isearch Current Word
- Reformat Line Wrap
Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial