有没有办法让flymake仅在我保存时才编译 [英] Is there a way to make flymake to compile only when I save

查看:104
本文介绍了有没有办法让flymake仅在我保存时才编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我键入flymake时,会使光标挂起一点.有点烦人.

When I type flymake makes the cursor hang a little. It's kind of annoying.

我想知道是否有一种方法可以让flymake在每次更改内容时都不进行解析和编译,而是在保存时执行.

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.

还有其他建议吗?

谢谢

推荐答案

您可以通过将它放在您的.emacsinit.el文件中来覆盖flymake.el中的flymake-after-change-function:

You can override the flymake-after-change-function from flymake.el by putting this in your .emacs or init.el file:

(eval-after-load "flymake"
  '(progn
    (defun flymake-after-change-function (start stop len)
      "Start syntax check for current buffer if it isn't already running."
      ;; Do nothing, don't want to run checks until I save.
      )))

保存时以及初次加载文件时,您仍然会进行语法检查,如果您不喜欢在加载文件时进行初始语法检查,则应该尚未测试此部分),可以通过以下方式将其关闭:

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:

(setq flymake-start-syntax-check-on-find-file nil)

编辑:与您的问题没有直接关系,但是如果仅是滞后问题,则可能会有所帮助,您可以通过以下操作来调整空闲时间:

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:

;; Only run flymake if I've not been typing for 5 seconds
(setq flymake-no-changes-timeout 5)

默认值为0.5秒,因此像我这样将其更改为5可能比完全关闭它更有用.

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仅在我保存时才编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆