Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove dangling function reference, and general tidy-ups

  • Loading branch information...
commit d424adccbc4167baa0b84c972e443ae994ba8fbd 1 parent 9092200
@purcell authored
Showing with 14 additions and 11 deletions.
  1. +14 −11 flymake-haml.el
View
25 flymake-haml.el
@@ -1,8 +1,8 @@
;;; flymake-haml.el --- Flymake handler for haml-mode and sass-mode files
;;
;;; Author: Steve Purcell <steve@sanityinc.com>
-;;; Homepage: https://github.com/purcell/flymake-haml
-;;; Version: 0.1
+;;; URL: https://github.com/purcell/flymake-haml
+;;; Version: DEV
;;
;;; Commentary:
;;
@@ -10,30 +10,33 @@
;; (require 'flymake-haml)
;; (add-hook 'haml-mode-hook 'flymake-haml-load)
;; (add-hook 'sass-mode-hook 'flymake-sass-load)
-
+(require 'flymake)
(defvar flymake-haml-err-line-patterns '(("^Syntax error on line \\([0-9]+\\): \\(.*\\)$" nil 1 nil 2)))
(defvar flymake-haml-allowed-file-name-masks '((".+\\.\\(haml\\)$" flymake-haml-init)
(".+\\.\\(sass\\)$" flymake-sass-init)))
-;; Not provided by flymake itself, curiously
-(defun flymake-haml-create-temp-in-system-tempdir (filename prefix)
- (make-temp-file (or prefix "flymake-haml")))
-
;; Invoke utilities with '-c' to get syntax checking
(defun flymake-haml-init ()
(list "haml" (list "-c" (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-in-system-tempdir))))
+ 'flymake-create-temp-inplace))))
(defun flymake-sass-init ()
(list "sass" (list "-c" (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-in-system-tempdir))))
+ 'flymake-create-temp-inplace))))
+;;;###autoload
(defun flymake-haml-load ()
+ "Configure flymake mode to check the current buffer's haml/sass syntax.
+
+This function is designed to be called in `sass-mode-hook' or
+`haml-mode-hook'; it does not alter flymake's global
+configuration, so `flymake-mode' alone will not suffice."
(interactive)
(set (make-local-variable 'flymake-allowed-file-name-masks) flymake-haml-allowed-file-name-masks)
(set (make-local-variable 'flymake-err-line-patterns) flymake-haml-err-line-patterns)
- (when (executable-find "haml")
- (flymake-mode t)))
+ (if (executable-find "haml")
+ (flymake-mode t)
+ (message "Not enabling flymake: haml command not found")))
(defalias 'flymake-sass-load 'flymake-haml-load)
Please sign in to comment.
Something went wrong with that request. Please try again.