flymake / emacs-flymake

Continuous syntax checking for Emacs. Fork to add max parallel invocations and other bug fixes.
http://www.illusori.co.uk/projects/emacs-flymake/
GNU General Public License v3.0
184 stars 36 forks source link

Standard flymake doesn't restart checking when changes are made #29

Open dabrahams opened 7 years ago

dabrahams commented 7 years ago

I'm not sure this fork has the problem, but with stock flymake, if you make a legal change (say, insert a space) and then introduce a syntax error while the first check is going, the error is never caught.

I do this to get around it:

(defun interrupting-flymake-start-syntax-check (base-function)
  (when (and (boundp 'flymake-syntax-check-process) (process-live-p flymake-syntax-check-process))
    (setq flymake-check-was-interrupted t)
    (flymake-kill-process flymake-syntax-check-process))
  (funcall base-function)
  (let ((proc (car flymake-processes)))
    (set-process-query-on-exit-flag proc nil)
    (set (make-local-variable 'flymake-syntax-check-process) proc)
    (setq flymake-check-was-interrupted t)
    (setq flymake-is-running nil)))

(advice-add 'flymake-start-syntax-check :around #'interrupting-flymake-start-syntax-check)