有没有办法让flymake只在保存时才编译
当我输入 Flymake 时,光标会稍微悬起。这有点烦人。
我想知道是否有一种方法可以告诉 Flymake 在每次更改某些内容时不要解析和编译,只需在保存时执行即可。
还有其他建议吗?
谢谢,
When I type flymake makes the cursor hang a little. It's kind of annoying.
I was wondering if there is a way to tell flymake to do not parse and compile each time I change something, just do it when I save.
Any other suggestion?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过将其放入
.emacs
或init.el
文件中来覆盖 Flymake.el 中的flymake-after-change-function
:当您保存和最初加载文件时,仍然会进行语法检查,如果您不喜欢加载文件时的初始语法检查,您应该能够(我没有测试过这部分)将其关闭:
编辑:与您的问题没有直接关系,但如果只是滞后问题可能会有所帮助,您可以调整保存开始之前应该空闲的时间in with:
默认值为 0.5 秒,因此也许像我一样将其更改为 5 可能比简单地完全关闭它更有帮助。
You can override the
flymake-after-change-function
from flymake.el by putting this in your.emacs
orinit.el
file:You will still get a syntax check when you save and when you initially load a file, if you don't like the initial syntax check on loading the file, you should be be able (I haven't tested this part) to turn it off with:
Edit: not directly related to your question, but might be helpful if just the lag is an issue, you can tailor how long you should be idle before the save kicks in with:
The default is 0.5 seconds, so perhaps changing it to 5 like me might help you more than simply turning it off entirely.
您可以将
flymake-no-changes-timeout
设置为nil
(而不是默认的0.5
)以禁用更改检查。这是flymake
组中的自定义设置。您需要使用值菜单来选择1
(不检查超时)。默认情况下,启用其他启动设置:
flymake-start-on-save-buffer
、flymake-start-on-flymake-mode
。这些对我来说就足够了,并且是首选,因为不断节省零钱可能会变得非常烦人。You can set
flymake-no-changes-timeout
tonil
(instead of default0.5
) to disable the on-change check. This is a customize setting in theflymake
group. You'll need to use the value menu to choose1
(no check on timeout).By default, the other start-on settings are enabled:
flymake-start-on-save-buffer
,flymake-start-on-flymake-mode
. Those suffice for me, and are preferred since constant saving-on-change can get pretty annoying.