Skip to content

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

@dabrahams

Description

@dabrahams

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions