From: Stefan Monnier Date: Wed, 11 Apr 2012 00:21:00 +0000 (-0400) Subject: * lisp/progmodes/flymake.el (flymake-mode): Beware read-only dirs. X-Git-Tag: emacs-24.2.90~471^2~364^2~45 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0221e32392b1bd6c376006b2324fefc0482e0d20;p=emacs.git * lisp/progmodes/flymake.el (flymake-mode): Beware read-only dirs. Fixes: debbugs:8954 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ebd76dea18e..3210bf08604 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-04-11 Stefan Monnier + + * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954). + 2012-04-10 Sébastien Gross (tiny change) * progmodes/hideshow.el (hs-hide-all): Don't infloop on comments diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 07393c6954d..ed8eb81932e 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -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