aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-05-07 13:47:56 -0400
committerStefan Monnier2010-05-07 13:47:56 -0400
commit5b3a105e67ea7b0e03d09b236702b1f9c7a84ade (patch)
tree4a00933fd53f15538c8bb986f318f9eae6367776
parentd7d0393dfc20e433df085d16717c81ea09888806 (diff)
downloademacs-5b3a105e67ea7b0e03d09b236702b1f9c7a84ade.tar.gz
emacs-5b3a105e67ea7b0e03d09b236702b1f9c7a84ade.zip
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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/textmodes/css-mode.el11
2 files changed, 17 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5723d7af009..9c822db5679 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12010-05-07 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
2 Stefan Monnier <monnier@iro.umontreal.ca>
3
4 Highlight vendor specific properties.
5 * textmodes/css-mode.el (css-proprietary-nmstart-re): New var.
6 (css-proprietary-property): New face.
7 (css-font-lock-keywords): Use them.
8
12010-05-07 Eli Zaretskii <eliz@gnu.org> 92010-05-07 Eli Zaretskii <eliz@gnu.org>
2 10
3 * cus-start.el (all): Add native condition for tool-bar-* symbols. 11 * cus-start.el (all): Add native condition for tool-bar-* symbols.
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 6e80b737284..bfa98e9c36f 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -212,6 +212,8 @@
212(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)")) 212(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
213(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)")) 213(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
214(defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*")) 214(defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*"))
215(defconst css-proprietary-nmstart-re ;; Vendor-specific properties.
216 "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-")
215(defconst css-name-re (concat css-nmchar-re "+")) 217(defconst css-name-re (concat css-nmchar-re "+"))
216 218
217(defface css-selector '((t :inherit font-lock-function-name-face)) 219(defface css-selector '((t :inherit font-lock-function-name-face))
@@ -220,6 +222,8 @@
220(defface css-property '((t :inherit font-lock-variable-name-face)) 222(defface css-property '((t :inherit font-lock-variable-name-face))
221 "Face to use for properties." 223 "Face to use for properties."
222 :group 'css) 224 :group 'css)
225(defface css-proprietary-property '((t :inherit (css-property italic)))
226 "Face to use for vendor-specific properties.")
223 227
224(defvar css-font-lock-keywords 228(defvar css-font-lock-keywords
225 `(("!\\s-*important" . font-lock-builtin-face) 229 `(("!\\s-*important" . font-lock-builtin-face)
@@ -251,8 +255,11 @@
251 ;; No face. 255 ;; No face.
252 nil))) 256 nil)))
253 ;; Properties. Again, we don't limit ourselves to css-property-ids. 257 ;; Properties. Again, we don't limit ourselves to css-property-ids.
254 (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:") 258 (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\("
255 (1 'css-property)))) 259 "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"
260 css-nmstart-re "\\)" css-nmchar-re "*"
261 "\\)\\s-*:")
262 (1 (if (match-end 2) 'css-proprietary-property 'css-property)))))
256 263
257(defvar css-font-lock-defaults 264(defvar css-font-lock-defaults
258 '(css-font-lock-keywords nil t)) 265 '(css-font-lock-keywords nil t))