问题描述
这是我的.macs文件中的flymake设置:
Here is my flymake setup in .emacs file:
(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 "pyflakes" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pyflakes-init)))
(add-hook 'find-file-hook 'flymake-find-file-hook)
(load-library "flymake-cursor")
我只想为.py文件使用flymake。并将其禁用。但始终启用。
例如,当我打开一个html文件我总是得到以下错误
错误(flymake):Flymake:无法使用args启动语法检查过程'xml'(val / home / huseyin / vipsatis / templates /取消/ base_flymake.html):搜索程序:没有这样的文件或目录,xml。 Flymake将被关闭
I want to use flymake only for .py files. and disable it for the rest. but It is always enabled.For example when I open an html file I always get following errorError (flymake): Flymake: Failed to launch syntax check process 'xml' with args (val /home/huseyin/vipsatis/templates/cancellation/base_flymake.html): Searching for program: no such file or directory, xml. Flymake will be switched OFF
所以我想把它关闭,除了py文件。有可能吗?
So I want to turn it off for anything but py files. is it possible?
(
对于有同样问题的人,我想解释错误消息:Flymake使用xmlstarlet进行xml和html验证它尝试将其称为xml val ......,但它必须将其称为xmlstarlet val ....来修复此问题,您必须找到flymake.el文件,并使用xmlstarlet更改xml调用。
)
(For the people having the same problem, I want to explain the error message: Flymake uses xmlstarlet for xml and html validation. And it tries to call it as "xml val ......" but it has to call it as "xmlstarlet val...." to fix this you have to find flymake.el file and change the xml call with xmlstarlet.)
推荐答案
从列表中删除HTML条目:
Remove the HTML entry from the list:
(delete '("\\.html?\\'" flymake-xml-init) flymake-allowed-file-name-masks)
这篇关于如何禁用Emacs-Flymake为html模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!