Function: checkdoc-current-buffer

checkdoc-current-buffer is an autoloaded, interactive and byte-compiled function defined in checkdoc.el.gz.

Signature

(checkdoc-current-buffer &optional TAKE-NOTES)

Documentation

Check current buffer for document, comment, error style, and rogue spaces.

With a prefix argument (in Lisp, the argument TAKE-NOTES), store all errors found in a warnings buffer, otherwise stop after the first error.

View in manual

Probably introduced at or before Emacs version 25.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/checkdoc.el.gz
;;;###autoload
(defun checkdoc-current-buffer (&optional take-notes)
  "Check current buffer for document, comment, error style, and rogue spaces.
With a prefix argument (in Lisp, the argument TAKE-NOTES),
store all errors found in a warnings buffer,
otherwise stop after the first error."
  (interactive "P" emacs-lisp-mode)
  (if (called-interactively-p 'interactive)
      (message "Checking buffer for style..."))
  ;; Assign a flag to spellcheck flag
  (let ((checkdoc-spellcheck-documentation-flag
	 (car (memq checkdoc-spellcheck-documentation-flag
                    '(buffer t))))
	(checkdoc-autofix-flag (if take-notes 'never
				 checkdoc-autofix-flag))
	(checkdoc-generate-compile-warnings-flag
	 (or take-notes checkdoc-generate-compile-warnings-flag)))
    (if take-notes
	(checkdoc-start-section "checkdoc-current-buffer"))
    ;; every test is responsible for returning the cursor.
    (or (and buffer-file-name ;; only check comments in a file
	     (checkdoc-comments))
	(checkdoc-start take-notes)
	(checkdoc-message-text)
	(checkdoc-rogue-spaces)
        (when checkdoc-package-keywords-flag
          (checkdoc-package-keywords))
	(not (called-interactively-p 'interactive))
	(if take-notes (checkdoc-show-diagnostics))
	(message "Checking buffer for style...Done."))))