Commits

Alexander Dinu committed 0441e49

flymake temp directory fix

  • Participants
  • Parent commits 3e9be10

Comments (0)

Files changed (1)

.emacs.d/.conf.d/flymake-conf.el

 (require 'flymake)
+
+(defun flymake-create-temp-intemp (file-name prefix)
+  (unless (stringp file-name)
+    (error "Invalid file-name"))
+  (or prefix
+      (setq prefix "flymake"))
+  (let* ((name (concat
+                (file-name-nondirectory
+                 (file-name-sans-extension file-name))
+                "_" prefix))
+         (ext  (concat "." (file-name-extension file-name)))
+         (temp-name (make-temp-file name nil ext))
+         )
+    (flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name)
+    temp-name))
+
 (when (load "flymake" t)
 
   ;; (defun flymake-jslint-init ()
   ;;              '("\\.js\\'" flymake-jslint-init))
 
   (defun flymake-html-init ()
-	  (let* ((temp-file (flymake-init-create-temp-buffer-copy
-	                     'flymake-create-temp-inplace))
-	         (local-file (file-relative-name
-	                      temp-file
-	                      (file-name-directory buffer-file-name))))
-	    (list "tidy" (list local-file))))
+    (let* ((temp-file   (flymake-init-create-temp-buffer-copy
+			 'flymake-create-temp-intemp))
+	   (local-file  (file-relative-name
+			 temp-file
+			 (file-name-directory buffer-file-name))))
+      (list "tidy" (list local-file))))
 
-	(add-to-list 'flymake-allowed-file-name-masks
-	             '("\\.html$\\|\\.ctp" flymake-html-init))
+  (add-to-list 'flymake-allowed-file-name-masks
+	       '("\\.html$\\|\\.ctp" flymake-html-init))
 
-	(add-to-list 'flymake-err-line-patterns
-	             '("line \\([0-9]+\\) column \\([0-9]+\\) - \\(Warning\\|Error\\): \\(.*\\)"
-	               nil 1 2 4))
+  (add-to-list 'flymake-err-line-patterns
+	       '("line \\([0-9]+\\) column \\([0-9]+\\) - \\(Warning\\|Error\\): \\(.*\\)"
+		 nil 1 2 4))
 
   (defun flymake-pyflakes-init ()
-    (let* ((temp-file (flymake-init-create-temp-buffer-copy
-		       'flymake-create-temp-inplace))
-	   (local-file (file-relative-name
-			temp-file
-			(file-name-directory buffer-file-name))))
+    (let* ((temp-file   (flymake-init-create-temp-buffer-copy
+			 'flymake-create-temp-intemp))
+	   (local-file  (file-relative-name
+			 temp-file
+			 (file-name-directory buffer-file-name))))
       (list "pyflakes" (list local-file))))
   (add-to-list 'flymake-allowed-file-name-masks
 	       '("\\.py\\'" flymake-pyflakes-init)))