 ;; copied from http://xahlee.org/emacs/elisp_syntax_coloring.html
 (require 'font-lock)
-
-(defvar jade-tab-width 2)
 
 (defun jade-debug (string &rest args)
   "Prints a debug message"

  `(buffer-substring (point-at-bol) (point-at-eol)))


(defun jade-indent-line ()
  "Indents current line")

(defun jade-previous-indentation ()
  "Gets indentation for previous line"
  (save-excursion
    (previous-line)
    (current-indentation)))

(defun jade-should-indent-p ()
  "Whether or not line should be indented."
  ;; should only indent if previous line is indented at most one less
  (> (jade-previous-indentation) (- (current-indentation) 1)))

(defun jade-empty-line-p ()
  "If line is empty or not."
  (= (point-at-eol) (point-at-bol)))

  "If line contains only spaces."
  (string-match-p "^[ ]*$" (jade-line-as-string)))

(setq jade-font-lock-keywords
      `((,"!!!\\( \\(default\\|5\\|transitional\\)\\)?" 0 font-lock-constant-face) ;; doctype
        (,"#\\(\\w\\|_\\|-\\)*" . font-lock-type-face) ;; id
        (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(#[A-Za-z0-9\-\_]*[^ ]\\)" 1 font-lock-type-face) ;; class name
        (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)" 1 font-lock-function-name-face) ;; class name
        (,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-comment-face)))

(defun jade-region-for-sexp ()
  "Selects the current sexp as the region"
