summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/textmodes/css-mode.el22
2 files changed, 25 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 57d988b6887..898d9cbf361 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-17 Simen Heggestøyl <simenheg@gmail.com>
+
+ * textmodes/css-mode.el (css--font-lock-keywords): Discriminate
+ between pseudo-classes and pseudo-elements.
+ (css-pseudo-ids): Remove.
+ (css-pseudo-class-ids): New variable.
+ (css-pseudo-element-ids): New variable.
+
2015-03-17 Bozhidar Batsov <bozhidar@batsov.com>
* progmodes/ruby-mode.el (ruby-font-lock-keywords): Font-lock
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 44dc4dff3de..c88960373cb 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -3,6 +3,7 @@
;; Copyright (C) 2006-2015 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Maintainer: Simen Heggestøyl <simenheg@gmail.com>
;; Keywords: hypermedia
;; This file is part of GNU Emacs.
@@ -120,10 +121,17 @@
;; (media . "^ +\\* '\\([^ '\n]+\\)' media group")
;; (property . "^ +\\* '\\([^ '\n]+\\)',")))
-(defconst css-pseudo-ids
- '("active" "after" "before" "first" "first-child" "first-letter" "first-line"
- "focus" "hover" "lang" "left" "link" "right" "visited")
- "Identifiers for pseudo-elements and pseudo-classes.")
+(defconst css-pseudo-class-ids
+ '("active" "checked" "disabled" "empty" "enabled" "first"
+ "first-child" "first-of-type" "focus" "hover" "indeterminate" "lang"
+ "last-child" "last-of-type" "left" "link" "nth-child"
+ "nth-last-child" "nth-last-of-type" "nth-of-type" "only-child"
+ "only-of-type" "right" "root" "target" "visited")
+ "Identifiers for pseudo-classes.")
+
+(defconst css-pseudo-element-ids
+ '("after" "before" "first-letter" "first-line")
+ "Identifiers for pseudo-elements.")
(defconst css-at-ids
'("charset" "font-face" "import" "media" "page")
@@ -258,7 +266,11 @@
(concat "\\(?:" scss--hash-re
"\\|[^@/:{} \t\n#]\\)"
"[^:{}#]*\\(?:" scss--hash-re "[^:{}#]*\\)*"))
- "\\(?::" (regexp-opt css-pseudo-ids t)
+ ;; Even though pseudo-elements should be prefixed by ::, a
+ ;; single colon is accepted for backward compatibility.
+ "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
+ css-pseudo-element-ids) t)
+ "\\|\\::" (regexp-opt css-pseudo-element-ids t) "\\)"
"\\(?:([^\)]+)\\)?"
(if (not sassy)
"[^:{}\n]*"