From 5b3a105e67ea7b0e03d09b236702b1f9c7a84ade Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 7 May 2010 13:47:56 -0400 Subject: [PATCH] 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. --- lisp/ChangeLog | 8 ++++++++ lisp/textmodes/css-mode.el | 11 +++++++++-- 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 @@ +2010-05-07 Deniz Dogan (tiny change) + 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. + 2010-05-07 Eli Zaretskii * 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 @@ (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" 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-proprietary-nmstart-re ;; Vendor-specific properties. + "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-") (defconst css-name-re (concat css-nmchar-re "+")) (defface css-selector '((t :inherit font-lock-function-name-face)) @@ -220,6 +222,8 @@ (defface css-property '((t :inherit font-lock-variable-name-face)) "Face to use for properties." :group 'css) +(defface css-proprietary-property '((t :inherit (css-property italic))) + "Face to use for vendor-specific properties.") (defvar css-font-lock-keywords `(("!\\s-*important" . font-lock-builtin-face) @@ -251,8 +255,11 @@ ;; No face. nil))) ;; Properties. Again, we don't limit ourselves to css-property-ids. - (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:") - (1 'css-property)))) + (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" + "\\(?:\\(" 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 '(css-font-lock-keywords nil t)) -- 2.39.2