Function: flymake-after-change-function

flymake-after-change-function is a byte-compiled function defined in flymake.el.gz.

Signature

(flymake-after-change-function START STOP PRE-CHANGE-LEN)

Documentation

Start syntax check for current buffer if it isn't already running.

START and STOP and LEN are as in after-change-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake.el.gz
(defun flymake-after-change-function (start stop pre-change-len)
  "Start syntax check for current buffer if it isn't already running.
START and STOP and LEN are as in `after-change-functions'."
  (let((new-text (buffer-substring start stop)))
    (push (list start stop new-text) flymake--recent-changes)
    (flymake--schedule-timer-maybe))
  ;; Some special handling to prevent eol overlays from temporarily
  ;; moving to wrong line
  (when (and flymake-show-diagnostics-at-end-of-line
             (zerop pre-change-len))
    (save-excursion
      (goto-char start)
      (when-let* ((probe (search-forward "\n" stop t))
                  (eolovs (cl-remove-if-not
                           (lambda (o)
                             (let ((lbound
                                    (cl-loop for s in (overlay-get o 'flymake-eol-source-overlays)
                                             minimizing (overlay-start s))))
                               (and lbound (< lbound (1- probe)))))
                           (overlays-at (line-end-position)))))
        (goto-char start)
        (let ((newend (line-end-position)))
          (dolist (ov eolovs) (move-overlay ov newend (1+ newend))))))))