0
votes

I'm using Emacs 24, and although I'm not a very experienced Emacs Lisper, I've gotten things to work reasonably well. That said, I have no idea how to go about getting the standard css-mode to use cc-mode's indentation. I like the way cc-mode knows how to indent after an opening brace and unindent when it encounters a closing brace on a new line.

edit: I'm one of those horrible people who uses Allman-style braces, so I'll show you what I have so far. When I press , my cursor ends up at the box character:

@media print                                                                    
{
    #table-of-contents                                                          
    {
        display: none
    }
□

but I want it to be like this:

@media print                                                                    
{
    #table-of-contents                                                          
    {
        display: none
    }
    □
1

1 Answers

0
votes

CC mode is probably overkill for CSS, but see this example for deriving from it for a new language:

http://cc-mode.sourceforge.net/derived-mode-ex.el

One thing that might come up is the unindenting of labels or class visibility specifiers (things followed by ':', since that is common in CSS) in CC mode. Worth a shot, though!