Browse files

Create temp files in system temp dir

  • Loading branch information...
1 parent a98a155 commit ae9ae2cb0e0b0bf7de6d9c9926df16c44e390202 @purcell committed Nov 7, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 flymake-ruby.el
View
10 flymake-ruby.el
@@ -17,12 +17,20 @@
(defvar flymake-ruby-executable "ruby"
"The ruby executable to use for syntax checking.")
+(defun flymake-ruby--create-temp-in-system-tempdir (file-name prefix)
+ "Return a temporary file name into which flymake can save.
+
+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-ruby") nil ".rb"))
+
;; Invoke ruby with '-c' to get syntax checking
(defun flymake-ruby-init ()
"Construct a command that flymake can use to check ruby source."
(list flymake-ruby-executable
(list "-c" (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))))
+ 'flymake-ruby--create-temp-in-system-tempdir))))
;;;###autoload
(defun flymake-ruby-load ()

0 comments on commit ae9ae2c

Please sign in to comment.