branch: elpa/jade-mode
commit b33e7017f7a8fff2b19ca14b2b6e15d1ab04bdae
Author: Jaakko Pallari <[email protected]>
Commit: Jaakko Pallari <[email protected]>
Defvar instead of setq
Since jade-font-lock-keywords variable doesn't already exist, the better
practice is to define it first.
---
jade-mode.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/jade-mode.el b/jade-mode.el
index 189dff21df..db9265c52e 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -43,24 +43,22 @@ For detail, see `comment-dwim'."
"include" "yield" "mixin") 'words))
"Jade keywords.")
-(setq jade-font-lock-keywords
- `((,"!!!\\|doctype\\( ?[A-Za-z0-9\-\_]*\\)?" 0 font-lock-comment-face)
;; doctype
- (,jade-keywords . font-lock-keyword-face) ;; keywords
- (,"#\\(\\w\\|_\\|-\\)*" . font-lock-variable-name-face) ;; id
- (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(#[A-Za-z0-9\-\_]*[^
]\\)" 1 font-lock-variable-name-face) ;; id
- (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)"
1 font-lock-type-face) ;; class name
- (,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-function-name-face))) ;; tag
name
+(defvar jade-font-lock-keywords
+ `((,"!!!\\|doctype\\( ?[A-Za-z0-9\-\_]*\\)?" 0 font-lock-comment-face) ;;
doctype
+ (,jade-keywords . font-lock-keyword-face) ;; keywords
+ (,"#\\(\\w\\|_\\|-\\)*" . font-lock-variable-name-face) ;; id
+ (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(#[A-Za-z0-9\-\_]*[^ ]\\)" 1
font-lock-variable-name-face) ;; id
+ (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)" 1
font-lock-type-face) ;; class name
+ (,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-function-name-face))) ;; tag name
;; syntax table
-(defvar jade-syntax-table nil "Syntax table for `jade-mode'.")
-(setq jade-syntax-table
- (let ((syn-table (make-syntax-table)))
-
- (modify-syntax-entry ?\/ ". 12b" syn-table)
- (modify-syntax-entry ?\n "> b" syn-table)
- (modify-syntax-entry ?' "\"" syn-table)
-
- syn-table))
+(defvar jade-syntax-table
+ (let ((syn-table (make-syntax-table)))
+ (modify-syntax-entry ?\/ ". 12b" syn-table)
+ (modify-syntax-entry ?\n "> b" syn-table)
+ (modify-syntax-entry ?' "\"" syn-table)
+ syn-table)
+ "Syntax table for `jade-mode'.")
(defun jade-region-for-sexp ()
"Selects the current sexp as the region"