Following are the snippets in my init.el
relevant to Flymake:
(add-hook 'python-mode-hook
(lambda ()
(unless (eq buffer-file-name nil) (flymake-mode 1)) ;dont invoke flymake on temporary buffers for the interpreter
(local-set-key [f2] 'flymake-goto-prev-error)
(local-set-key [f3] 'flymake-goto-next-error)
(local-set-key [f4] 'flymake-display-err-menu-for-current-line)
(hs-minor-mode)
(orgtbl-mode)
(outline-minor-mode -1)))
...
;;===== PyFlakes
;; code checking via pyflakes+flymake
(when (load "flymake" t)
(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))))
(list "pychecker" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakes-init)))
(mapcar (lambda (hook) (add-hook 'find-file-hook hook))
(list 'flymake-find-file-hook))
(unload-feature 'flymake) ; unloaded in an attempt to get rid of the error
But everytime I find-file
or revert-buffer
(extensions .xml
, .php
, .html
) I get the following error (not with .py
):
Flymake: Failed to launch syntax check process 'php' with args (-f _posteddata_flymake.php -l): Searching for program: permission denied, php. Flymake will be switch OFF
or
Flymake: Failed to launch syntax check process 'xml' with args (val //path/to/file/config/prod-conf_flymake.xml): Searching for program: permission denied, xml. Flymake will be switch OFF
I've also tried doing (load "flymake" nil)
but it didn't work either.
A big time sink when opening or reloading a big hunk of files.
How can I fix it?
(load "flymake" nil)
doesn't do, what you thought it would, namely unloading a library. That'd beunload-feature
, but a library needs to explicitly support unloading, and Flymake doesn't. – Gasoline.emacs
of any and all references toflymake
might not suffice, if you are using some kind of session management package e.g.desktop.el
. Be sure to kill that state as well, e.g. reload your buffers – Sloth