]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/flymake.el (flymake-mode): Beware read-only dirs.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 11 Apr 2012 00:21:00 +0000 (20:21 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 11 Apr 2012 00:21:00 +0000 (20:21 -0400)
Fixes: debbugs:8954
lisp/ChangeLog
lisp/progmodes/flymake.el

index ebd76dea18e58756ee91b865eade4e711eab4fa4..3210bf086046ad094b7db913a9b65baac257b78e 100644 (file)
@@ -1,3 +1,7 @@
+2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954).
+
 2012-04-10  Sébastien Gross  <seb@chezwam.org>  (tiny change)
 
        * progmodes/hideshow.el (hs-hide-all): Don't infloop on comments
index 07393c6954d70869ac6e89f67929f257b2519720..ed8eb81932ecdc61bbadbd65c0b9f9c9f4aca252 100644 (file)
@@ -1356,8 +1356,12 @@ if ARG is omitted or nil."
       (setq flymake-timer
             (run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
 
-      (when flymake-start-syntax-check-on-find-file
-        (flymake-start-syntax-check)))))
+      (when (and flymake-start-syntax-check-on-find-file
+                 ;; Since we write temp files in current dir, there's no point
+                 ;; trying if the directory is read-only (bug#8954).
+                 (file-writable-p (file-name-directory buffer-file-name)))
+        (with-demoted-errors
+          (flymake-start-syntax-check))))))
 
    ;; Turning the mode OFF.
    (t