Function: flymake-make-report-fn

flymake-make-report-fn is a byte-compiled function defined in flymake.el.gz.

Signature

(flymake-make-report-fn BACKEND &optional TOKEN)

Documentation

Make a suitable anonymous report function for BACKEND.

BACKEND is used to help Flymake distinguish different diagnostic sources. If provided, TOKEN helps Flymake distinguish between different runs of the same backend.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake.el.gz
(defun flymake-make-report-fn (backend &optional token)
  "Make a suitable anonymous report function for BACKEND.
BACKEND is used to help Flymake distinguish different diagnostic
sources.  If provided, TOKEN helps Flymake distinguish between
different runs of the same backend."
  (let ((buffer (current-buffer))
        (point (point)))
    (lambda (&rest args)
      (when (buffer-live-p buffer)
        (with-current-buffer buffer
          (save-excursion
            ;; A report touches the eol overlays whose style could be
            ;; influenced by current-ish position.
            (goto-char point)
            (apply #'flymake--handle-report backend token args)))))))