librelist archives

« back to archive

CSS in Emacs

CSS in Emacs

Ron DuPlain
2011-05-30 @ 02:36
I just shaved a yak.

Editing CSS in emacs has been erratic for me, indentation and font
locks were busted.  Within { }, css-mode would always indent to 3
spaces regardless of config, and code highlighting would get tripped
up on edit pretty easily.  Searching around showed other people with
this problem, but they would only blindly repost the same 4 line of
config which work with an older version of css-mode (which didn't work
in my .emacs).  It looks like Ubuntu ships with a really old
css-mode.el.  I'm on Ubuntu 11.04 (natty) with emacs23-nox package
providing GNU Emacs 23.2.1.

The solution is really simple: get a vanilla distribution of GNU Emacs
and copy lisp/textmodes/css-mode.el into ~/.emacs.d or equivalent.  It
just works, and I even removed any css-mode hooks in my .emacs.  Too
many css-mode.el files posted out there.  This is my solution for all
mode files from now on.

Thought I'd share,