1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Emacs] Use - as a word char in all Sass code.

This commit is contained in:
Nathan Weizenbaum 2009-03-28 10:33:31 -07:00
parent 0e0a36c233
commit b9fff7f799

View file

@ -47,11 +47,6 @@ text nested beneath them.")
;; Font lock ;; Font lock
(defconst sass-selector-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?- "w" st)
st))
(defconst sass-selector-font-lock-keywords (defconst sass-selector-font-lock-keywords
'(("&" 0 font-lock-constant-face) '(("&" 0 font-lock-constant-face)
("\\.\\w+" 0 font-lock-type-face) ("\\.\\w+" 0 font-lock-type-face)
@ -63,6 +58,11 @@ text nested beneath them.")
("\\[\\([^]=]+\\)" (1 font-lock-variable-name-face) ("\\[\\([^]=]+\\)" (1 font-lock-variable-name-face)
("[~|$^*]?=\\([^]=]+\\)" nil nil (1 font-lock-string-face))))) ("[~|$^*]?=\\([^]=]+\\)" nil nil (1 font-lock-string-face)))))
(defconst sass-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?- "w" st)
st))
(defconst sass-font-lock-keywords (defconst sass-font-lock-keywords
'((sass-highlight-line 1 nil nil t))) '((sass-highlight-line 1 nil nil t)))
@ -99,8 +99,7 @@ taken from `sass-line-keywords'."
"Highlight a CSS selector starting at `point' "Highlight a CSS selector starting at `point'
and ending at `end-of-line'." and ending at `end-of-line'."
(end-of-line) (end-of-line)
(let ((font-lock-keywords sass-selector-font-lock-keywords) (let ((font-lock-keywords sass-selector-font-lock-keywords))
(font-lock-syntax-table sass-selector-syntax-table))
(font-lock-fontify-region (font-lock-fontify-region
(point) (progn (end-of-line) (point)))) (point) (progn (end-of-line) (point))))
t) t)
@ -112,7 +111,7 @@ and ending at `end-of-line'."
;;;###autoload ;;;###autoload
(define-derived-mode sass-mode haml-mode "Sass" (define-derived-mode sass-mode haml-mode "Sass"
"Major mode for editing Sass files." "Major mode for editing Sass files."
(set-syntax-table (make-syntax-table)) (set-syntax-table sass-syntax-table)
(setq font-lock-extend-region-functions (setq font-lock-extend-region-functions
'(font-lock-extend-region-wholelines font-lock-extend-region-multiline)) '(font-lock-extend-region-wholelines font-lock-extend-region-multiline))
(setq font-lock-multiline nil) (setq font-lock-multiline nil)