Browse files

Checkdoc compliance

  • Loading branch information...
1 parent 8eb6ef3 commit 2024244afa1cc7677649ed285b54d329aea864fb @purcell committed Oct 23, 2011
Showing with 12 additions and 4 deletions.
  1. +12 −4 flymake-sass.el
16 flymake-sass.el
@@ -11,6 +11,7 @@
;; (add-hook 'sass-mode-hook 'flymake-sass-load)
(require 'flymake)
+;;; Code:
(defconst flymake-sass-err-line-patterns
'(("^Syntax error on line \\([0-9]+\\): \\(.*\\)$" nil 1 nil 2)
@@ -20,6 +21,7 @@
;; Invoke utilities with '-c' to get syntax checking
(defun flymake-sass-init ()
+ "Construct a command that flymake can use to check sass source."
(list "sass" (list "-c" (flymake-init-create-temp-buffer-copy
@@ -28,6 +30,12 @@
;; buffer-local
(defun flymake-sass-just-find-all-matches (str &optional ignored)
+ "A judicious override for `flymake-split-output'.
+Enabled by the advice below, this override just returns all
+output lines matching any of the error line patterns.
+Argument STR a multi-line string containing output from 'sass -c'."
(let ((result nil))
(dolist (pattern flymake-sass-err-line-patterns)
(let ((regex (car pattern))
@@ -44,18 +52,18 @@
(defadvice flymake-split-output
(around flymake-sass-split-output-multiline (output) activate protect)
+ "Override `flymake-split-output' to support mult-line error messages."
(if flymake-sass--split-multiline
- (flet ((flymake-split-string 'flymake-sass-just-find-all-matches))
- (setq ad-return-value (list (flymake-sass-just-find-all-matches output) nil)))
+ (setq ad-return-value (list (flymake-sass-just-find-all-matches output) nil))
(defun flymake-sass-load ()
"Configure flymake mode to check the current buffer's sass syntax.
This function is designed to be called in `sass-mode-hook'; it
-does not alter flymake's global configuration, so `flymake-mode'
-alone will not suffice."
+does not alter flymake's global configuration, so function
+`flymake-mode' alone will not suffice."
(set (make-local-variable 'flymake-allowed-file-name-masks) '(("." flymake-sass-init)))
(set (make-local-variable 'flymake-err-line-patterns) flymake-sass-err-line-patterns)

0 comments on commit 2024244

Please sign in to comment.