Permalink
Browse files

Create temp files in system temp dir

  • Loading branch information...
purcell committed Nov 7, 2011
1 parent 705308f commit cc406a545e00348c4ca9e91ff4902f055c939560
Showing with 9 additions and 1 deletion.
  1. +9 −1 flymake-coffee.el
View
@@ -18,13 +18,21 @@
(defconst flymake-coffee-err-line-patterns
'(("\\(Error: In \\([^,]+\\), .+ on line \\([0-9]+\\).*\\)" 2 3 nil 1)))
+(defun flymake-coffee--create-temp-in-system-tempdir (file-name prefix)
+ "Return a temporary file name into which flymake can save buffer contents.
+
+This is tidier than `flymake-create-temp-inplace', and therefore
+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-init ()
"Construct a command that flymake can use to check coffeescript source."
(list (if (boundp 'coffee-command)
coffee-command
"coffee")
(list (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))))
+ 'flymake-coffee--create-temp-in-system-tempdir))))
;;;###autoload
(defun flymake-coffee-load ()

0 comments on commit cc406a5

Please sign in to comment.