Permalink
Browse files

Upon initialization, check for presence of the same "coffee" command …

…we'll use later
  • Loading branch information...
1 parent 504c56d commit 1c67ffca83ad544e31a146e91cb37640fee11d6a @purcell committed Feb 21, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 flymake-coffee.el
View
@@ -26,11 +26,15 @@ preferable when the checking doesn't depend on the file's exact
location."
(make-temp-file (or prefix "flymake-coffee") nil ".coffee"))
+(defun flymake-coffee-command ()
+ "Return the location of the user's 'coffee' executable, using 'coffee-command if available."
+ (if (boundp 'coffee-command)
+ coffee-command
+ "coffee"))
+
(defun flymake-coffee-init ()
"Construct a command that flymake can use to check coffeescript source."
- (list (if (boundp 'coffee-command)
- coffee-command
- "coffee")
+ (list (flymake-coffee-command)
(list (flymake-init-create-temp-buffer-copy
'flymake-coffee--create-temp-in-system-tempdir))))
@@ -44,7 +48,7 @@ does not alter flymake's global configuration, so function
(interactive)
(set (make-local-variable 'flymake-allowed-file-name-masks) '(("." flymake-coffee-init)))
(set (make-local-variable 'flymake-err-line-patterns) flymake-coffee-err-line-patterns)
- (if (executable-find "coffee")
+ (if (executable-find (flymake-coffee-command))
(flymake-mode t)
(message "Not enabling flymake: coffee command not found")))

0 comments on commit 1c67ffc

Please sign in to comment.