Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create temp files in system temp dir

  • Loading branch information...
commit ae9ae2cb0e0b0bf7de6d9c9926df16c44e390202 1 parent a98a155
Steve Purcell authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 flymake-ruby.el
10 flymake-ruby.el
View
@@ -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 ()
Please sign in to comment.
Something went wrong with that request. Please try again.