Function: checkdoc-dired

checkdoc-dired is an interactive and byte-compiled function defined in checkdoc.el.gz.

Signature

(checkdoc-dired FILES)

Documentation

In Dired, run checkdoc on marked files.

Skip anything that doesn't have the Emacs Lisp library file extension (".el"). When called from Lisp, FILES is a list of filenames.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/checkdoc.el.gz
(defun checkdoc-dired (files)
  "In Dired, run `checkdoc' on marked files.
Skip anything that doesn't have the Emacs Lisp library file
extension (\".el\").
When called from Lisp, FILES is a list of filenames."
  (interactive
   (list
    (delq nil
          (mapcar
           ;; skip anything that doesn't look like an Emacs Lisp library
           (lambda (f) (if (equal (file-name-extension f) "el") f nil))
           (nreverse (dired-map-over-marks (dired-get-filename) nil)))))
   dired-mode)
  (if (null files)
      (error "No files to run checkdoc on")
    (save-window-excursion
      (dolist (fil files)
        (find-file fil)
        (unless (and
                 (goto-char (point-min))
                 (re-search-forward checkdoc--dired-skip-lines-re nil t))
          (checkdoc)))))
  (message "checkdoc-dired: Successfully checked %d files" (length files)))