added hook to prevent flymake from crashing if it has not write permission
This commit is contained in:
parent
1bb4512ac9
commit
297793404c
|
@ -39,3 +39,15 @@ The CMDLINE should be something like:
|
|||
(flymake-mode))))
|
||||
)
|
||||
)
|
||||
|
||||
;; from http://www.emacswiki.org/emacs/FlyMake
|
||||
(defun safer-flymake-find-file-hook ()
|
||||
"Don't barf if we can't open this flymake file"
|
||||
(let ((flymake-filename
|
||||
(flymake-create-temp-inplace (buffer-file-name) "flymake")))
|
||||
(if (file-writable-p flymake-filename)
|
||||
(flymake-find-file-hook)
|
||||
(message
|
||||
(format
|
||||
"Couldn't enable flymake; permission denied on %s" flymake-filename)))))
|
||||
(add-hook 'find-file-hook 'safer-flymake-find-file-hook)
|
||||
|
|
Loading…
Reference in a new issue