Function: checkdoc-next-error

checkdoc-next-error is a byte-compiled function defined in checkdoc.el.gz.

Signature

(checkdoc-next-error ENABLE-FIX)

Documentation

Find and return the next checkdoc error list, or nil.

Only documentation strings are checked. An error list is of the form (WARNING . POSITION) where WARNING is the warning text, and POSITION is the point in the buffer where the error was found. We can use points and not markers because we promise not to edit the buffer before point without re-executing this check. Argument ENABLE-FIX will enable auto-fixing while looking for the next error. This argument assumes that the cursor is already positioned to perform the fix.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/checkdoc.el.gz
(defun checkdoc-next-error (enable-fix)
  "Find and return the next checkdoc error list, or nil.
Only documentation strings are checked.
An error list is of the form (WARNING . POSITION) where WARNING is the
warning text, and POSITION is the point in the buffer where the error
was found.  We can use points and not markers because we promise not
to edit the buffer before point without re-executing this check.
Argument ENABLE-FIX will enable auto-fixing while looking for the next
error.  This argument assumes that the cursor is already positioned to
perform the fix."
  (if enable-fix
      (checkdoc-this-string-valid)
    (let ((msg nil) (p (point))
	  (checkdoc-autofix-flag nil))
      (condition-case nil
	  (while (and (not msg) (checkdoc-next-docstring))
	    (message "Searching for doc string error...%d%%"
		     (floor (* 100.0 (point)) (point-max)))
	    (if (setq msg (checkdoc-this-string-valid))
		(setq msg (cons msg (point)))))
	;; Quit.. restore position,  Other errors, leave alone
	(quit (goto-char p)))
      msg)))