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,
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,
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)
The default is 0.5 seconds, so perhaps changing it to 5 like me might help you more than simply turning it off entirely.
You can set flymake-no-changes-timeout
to nil
(instead of default 0.5
) to disable the on-change check. This is a customize setting in the flymake
group. You'll need to use the value menu to choose 1
(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.
© 2022 - 2024 — McMap. All rights reserved.