(defun cssm-right-brace-macro() (interactive) (cssm-insert-right-brace-and-indent) (forward-char) ) (defun cssm-hook() (cssm-leave-mirror-mode) (setq cssm-indent-function 'cssm-c-style-indenter) (define-key cssm-mode-map (read-kbd-macro "}") 'cssm-right-brace-macro) ;; Add "focus" to the list of pseudo-selectors (add-to-list 'cssm-pseudos "focus") ;; Redefine the CSS regular expressions to allow underscores (setq cssm-font-lock-keywords (list (cons (cssm-list-2-regexp cssm-keywords) font-lock-keyword-face) (cons "\\.[a-zA-Z][-a-zA-Z_0-9.]+" font-lock-variable-name-face) (cons (concat ":" (cssm-list-2-regexp cssm-pseudos)) font-lock-variable-name-face) (cons "#[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)?" font-lock-reference-face) (cons "\\[.*\\]" font-lock-variable-name-face) (cons "#[-a-zA-Z_0-9]*" font-lock-function-name-face) (cons "rgb(\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*)" font-lock-reference-face) ) ) ) (add-hook 'css-mode-hook (function cssm-hook))