Commit 5b3a105e authored by Stefan Monnier's avatar Stefan Monnier

Highlight vendor specific properties.

* textmodes/css-mode.el (css-proprietary-nmstart-re): New var.
(css-proprietary-property): New face.
(css-font-lock-keywords): Use them.
parent d7d0393d
2010-05-07 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
Stefan Monnier <monnier@iro.umontreal.ca>
Highlight vendor specific properties.
* textmodes/css-mode.el (css-proprietary-nmstart-re): New var.
(css-proprietary-property): New face.
(css-font-lock-keywords): Use them.
2010-05-07 Eli Zaretskii <eliz@gnu.org> 2010-05-07 Eli Zaretskii <eliz@gnu.org>
* cus-start.el (all): Add native condition for tool-bar-* symbols. * cus-start.el (all): Add native condition for tool-bar-* symbols.
......
...@@ -212,6 +212,8 @@ ...@@ -212,6 +212,8 @@
(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)")) (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)")) (defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
(defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*")) (defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*"))
(defconst css-proprietary-nmstart-re ;; Vendor-specific properties.
"[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-")
(defconst css-name-re (concat css-nmchar-re "+")) (defconst css-name-re (concat css-nmchar-re "+"))
(defface css-selector '((t :inherit font-lock-function-name-face)) (defface css-selector '((t :inherit font-lock-function-name-face))
...@@ -220,6 +222,8 @@ ...@@ -220,6 +222,8 @@
(defface css-property '((t :inherit font-lock-variable-name-face)) (defface css-property '((t :inherit font-lock-variable-name-face))
"Face to use for properties." "Face to use for properties."
:group 'css) :group 'css)
(defface css-proprietary-property '((t :inherit (css-property italic)))
"Face to use for vendor-specific properties.")
(defvar css-font-lock-keywords (defvar css-font-lock-keywords
`(("!\\s-*important" . font-lock-builtin-face) `(("!\\s-*important" . font-lock-builtin-face)
...@@ -251,8 +255,11 @@ ...@@ -251,8 +255,11 @@
;; No face. ;; No face.
nil))) nil)))
;; Properties. Again, we don't limit ourselves to css-property-ids. ;; Properties. Again, we don't limit ourselves to css-property-ids.
(,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:") (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\("
(1 'css-property)))) "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"
css-nmstart-re "\\)" css-nmchar-re "*"
"\\)\\s-*:")
(1 (if (match-end 2) 'css-proprietary-property 'css-property)))))
(defvar css-font-lock-defaults (defvar css-font-lock-defaults
'(css-font-lock-keywords nil t)) '(css-font-lock-keywords nil t))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment