summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/regexp-opt-tests.el
diff options
context:
space:
mode:
authorDamien Cassou <damien@cassou.me>2019-12-27 15:35:52 +0100
committerEli Zaretskii <eliz@gnu.org>2020-01-17 11:29:06 +0200
commit6338f69102551cb8bfba36000fb73935aefa5b7b (patch)
tree7bf8a4733ed2b2a2efe687dbc6385107acba9360 /test/lisp/emacs-lisp/regexp-opt-tests.el
parent4453acbdc987130e9967ef7afe90359ad7a48987 (diff)
downloademacs-6338f69102551cb8bfba36000fb73935aefa5b7b.tar.gz
emacs-6338f69102551cb8bfba36000fb73935aefa5b7b.tar.bz2
emacs-6338f69102551cb8bfba36000fb73935aefa5b7b.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. (cherry picked from commit 25adbc4a5ecc3e16625c0171607e3153bbdf7ab1)
Diffstat (limited to 'test/lisp/emacs-lisp/regexp-opt-tests.el')
0 files changed, 0 insertions, 0 deletions