我試圖讓JSHint與Flymake一起工作。Emacs - 無法讓Flymake與JSHint一起工作
jshint
確實安裝在/opt/bin
並正常工作。 /opt/bin
位於Emacs'exec-path
。
我已經按照the directions on the EmacsWiki在這個我:
(defun flymake-jshint-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 "jshint" (list local-file))))
(setq flymake-err-line-patterns
(cons '("^ [[:digit:]]+ \\([[:digit:]]+\\),\\([[:digit:]]+\\): \\(.+\\)$"
nil 1 2 3)
flymake-err-line-patterns))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.js\\'" flymake-jshint-init))
當我打開JavaScript文件,我的模式行顯示爲:
[(Javascript Flymake* AC)]
這很奇怪,因爲通常*
沒有按」當我用C++或Python使用Flymake時,不會出現。根據Flymake文檔,Flymake*
表示「Flymake目前正在運行」。但是,Flymake沒有顯示任何錯誤。
我檢查了*Messages*
緩衝區,但它只列出了幾行Fontifying foo.js... (regexps...................)
。沒有錯誤。
其他建議?