Subject: bug#5732: css-mode doesn't correctly highlight "grouped" selectors

From: Chong Yidong <[email-masked]>
Date: Sat, 10 Apr 2010 13:16:30 -0400

> css-mode doesn't seem to correctly highlight anything but the last
> selector if grouping them as such:
>
> #topic span,
> #topic b,
> #topic i {
>     ...
> }

How bout something like this?

*** lisp/textmodes/css-mode.el	2010-01-13 08:35:10 +0000
--- lisp/textmodes/css-mode.el	2010-04-10 17:13:44 +0000
***************
*** 236,242 ****
      ;; thus prevent this highlighting from being applied (actually now that
      ;; I use `append' this should work better).  But really the part of hte
      ;; selector between [...] should simply not be highlighted.
!     (,(concat "^\\([ \t]*[^@:{\n][^:{\n]+\\(?::" (regexp-opt css-pseudo-ids t)
                "\\(?:([^)]+)\\)?[^:{\n]*\\)*\\)\\(?:\n[ \t]*\\)*{")
       (1 'css-selector append))
      ;; In the above rule, we allow the open-brace to be on some subsequent
--- 236,242 ----
      ;; thus prevent this highlighting from being applied (actually now that
      ;; I use `append' this should work better).  But really the part of hte
      ;; selector between [...] should simply not be highlighted.
!     (,(concat "^\\([ \t]*[^@:{}\n][^:{}]+\\(?::" (regexp-opt css-pseudo-ids t)
                "\\(?:([^)]+)\\)?[^:{\n]*\\)*\\)\\(?:\n[ \t]*\\)*{")
       (1 'css-selector append))
      ;; In the above rule, we allow the open-brace to be on some subsequent