2

打开 .js 文件时,会自动加载 js2-mode 以及随后的 flymake-js。但是flymake会立即卸载消息

关闭flymake模式;最好传递一个明确的论点。

但是,当手动启用它时,使用M-x flymake-mode,它会保持激活状态。有没有人遇到过类似的行为并已解决?

我的设置: 我按照 emacswiki 上的说明设置Flymake 以使用最新的js2 模式并稍作修改:

(add-hook 'js2-mode-hook '(lambda () (flymake-js-load)))

代替

(add-hook 'javascript-mode-hook '(lambda () (flymake-js-load)))
4

1 回答 1

2

Probably, somewhere in your hook, there is a statement like :

     (flymake-mode t)

you need to change it to :

     (flymake-mode 1)

I read the documentation on 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 the arg is positive. Not non-nil. But the page on http://www.emacswiki.org/emacs/FlymakeJavaScript which suggests a definition for flymake-js-load, shows (flymake-mode t) .

That seems wrong.

于 2010-05-20T12:00:39.810 回答