1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
emacs/lisp/textmodes
Damien Cassou 6338f69102 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 25adbc4a5e)
2020-01-17 11:29:06 +02:00
..
artist.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
bib-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
bibtex-style.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
bibtex.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
conf-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
css-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
dns-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
enriched.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
fill.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
flyspell.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ispell.el Add unattended spell-checking to checkdoc 2020-01-17 11:29:06 +02:00
less-css-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
makeinfo.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
mhtml-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
nroff-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
page-ext.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
page.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
paragraphs.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
picture.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
po.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
refbib.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
refer.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
refill.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-auc.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-cite.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-dcr.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-global.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-index.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-parse.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-ref.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-sel.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-toc.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex-vars.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
reftex.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
remember.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
rst.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
sgml-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
table.el Move “Fix some broken conditional forms” to master 2020-01-05 11:50:31 -08:00
tex-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
texinfmt.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
texinfo.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
texnfo-upd.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
text-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
tildify.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
two-column.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
underline.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00