Flymake quits right after loading in js2 mode
When opening .js files js2-mode and subsequently flymake-js is automatically loaded. But flymake dumps right out with the message
Flymake mode switching; it is better to pass an explicit argument.
However, when turned on manually using M-x flymake-mode
, it keeps being activated. Has anyone encountered similar behavior and fixed it?
My setup: I followed the emacswiki instructions to set up Flymake to work with the latest js2-mode with a little modification:
(add-hook 'js2-mode-hook '(lambda () (flymake-js-load)))
instead
(add-hook 'javascript-mode-hook '(lambda () (flymake-js-load)))
a source to share
Perhaps somewhere in your hook there is an instruction like:
(flymake-mode t)
you need to change it to:
(flymake-mode 1)
I have read the documentation in flymake mode. It says:
flymake-mode is an interactive compiled Lisp function in `flymake.el'.
(flymake-mode &optional ARG)
Minor mode to do on-the-fly syntax checking.
When called interactively, toggles the minor mode.
With arg, turn Flymake mode on if and only if arg is positive.
If and only if arg is positive. Not really not. But the page at
http://www.emacswiki.org/emacs/FlymakeJavaScript , which offers a definition for flymake-js-load, shows (flymake-mode t)
.
It doesn't seem right.
a source to share