Subject: bug#20282: css-mode: multiple selectors *sometimes* breaks indentation

From: Stefan Monnier <[email-masked]>
Date: Thu, 09 Apr 2015 10:52:25 -0400

> The following rather simple example of a chunk of CSS:
>     a, b:hover {
>            color: black;
>        }
> gets indented incorrectly.

Indeed, thanks.  I installed the patch below which seems to fix
this problem.

        Stefan

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 7280080..851618c 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -327,6 +327,10 @@
     (`(:elem . basic) css-indent-offset)
     (`(:elem . arg) 0)
     (`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467).
+    (`(:before . "{")
+     (when (smie-rule-hanging-p)
+       (smie-backward-sexp ";")
+       (smie-indent-virtual)))
     (`(:before . ,(or "{" "("))
      (if (smie-rule-hanging-p) (smie-rule-parent 0)))))