Function: elisp-flymake-checkdoc

elisp-flymake-checkdoc is a byte-compiled function defined in elisp-mode.el.gz.

Signature

(elisp-flymake-checkdoc REPORT-FN &rest ARGS)

Documentation

A Flymake backend for checkdoc.

Calls REPORT-FN directly.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
;;;###autoload
(defun elisp-flymake-checkdoc (report-fn &rest _args)
  "A Flymake backend for `checkdoc'.
Calls REPORT-FN directly."
  (let (collected)
    (let* ((checkdoc-create-error-function
            (lambda (text start end &optional unfixable)
              (push (list text start end unfixable) collected)
              nil))
           (checkdoc-autofix-flag nil)
           (checkdoc-generate-compile-warnings-flag nil)
           (checkdoc-diagnostic-buffer
            (generate-new-buffer " *checkdoc-temp*")))
      (unwind-protect
          (save-excursion
            ;; checkdoc-current-buffer can error if there are
            ;; unbalanced parens, for example, but this shouldn't
            ;; disable the backend (bug#29176).
            (ignore-errors
              (checkdoc-current-buffer t)))
        (kill-buffer checkdoc-diagnostic-buffer)))
    (funcall report-fn
             (cl-loop for (text start end _unfixable) in
                      collected
                      collect
                      (flymake-make-diagnostic
                       (current-buffer)
                       (or start 1) (or end (1+ (or start 1)))
                       :note text)))
    collected))