diff options
author | Damien Cassou <damien@cassou.me> | 2019-12-27 15:35:52 +0100 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-01-16 20:41:48 +0200 |
commit | 25adbc4a5ecc3e16625c0171607e3153bbdf7ab1 (patch) | |
tree | afcf3388aaa4a4e33fa3da39ff7dead458bfd7ee /lisp/emacs-lisp/regexp-opt.el | |
parent | 1b1aaf37dc745570ec5202c8cc596591f4afa38d (diff) | |
download | emacs-25adbc4a5ecc3e16625c0171607e3153bbdf7ab1.tar.gz emacs-25adbc4a5ecc3e16625c0171607e3153bbdf7ab1.tar.bz2 emacs-25adbc4a5ecc3e16625c0171607e3153bbdf7ab1.zip |
Add unattended spell-checking to checkdoc
This commit makes checkdoc capable of spell-checking even when the
user isn't using it interactively. When TAKE-NOTES is non-nil,
checkdoc will run spell-checking (with ispell) and report spelling
mistakes.
Fixes: (bug#38583).
* lisp/textmodes/ispell.el (ispell-word): Extract part of it to
`ispell--run-on-word`.
(ispell--run-on-word): New function, extracted from `ispell-word`.
(ispell-error-checking-word): New function.
(ispell-correct-p): New function. Use `ispell--run-on-word` and
`ispell-error-checking-word`.
* lisp/emacs-lisp/checkdoc.el (checkdoc-current-buffer): Pass
TAKE-NOTES to `checkdoc-start`.
(checkdoc-continue): Pass TAKE-NOTES to `checkdoc-this-string-valid`.
(checkdoc-this-string-valid): Add optional argument TAKE-NOTES and
pass it to `checkdoc-this-string-valid-engine`.
(checkdoc-this-string-valid-engine): Add optional argument TAKE-NOTES
and pass it to `checkdoc-ispell-docstring-engine`.
(checkdoc-ispell-init): Call `ispell-set-spellchecker-params` and
`ispell-accept-buffer-local-defs`. These calls are required to
properly use ispell. The problem went unnoticed until now because
checkdoc was only using ispell through the high-level command
`ispell-word` which takes care of all the initialization for the user.
(checkdoc-ispell-docstring-engine): Add optional argument TAKE-NOTES
to force reporting of spell-checking errors. Throw error
when (checkdoc-ispell-init) fails configuring ispell. Replace a
few (if cond nil body) with (unless cond body). Replace (let ((var
nil))) with (let (var)). Replace (if (not (eq checkdoc-autofix-flag
'never)) body) with just body because `checkdoc-autofix-flag` is
checked at the beginning of the function.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
0 files changed, 0 insertions, 0 deletions