emacs/lisp/emacs-lisp
Damien Cassou 25adbc4a5e 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.
2020-01-16 20:41:48 +02:00
..
advice.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
autoload.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
avl-tree.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
backquote.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
backtrace.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
benchmark.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
bindat.el * lisp/emacs-lisp/bindat.el: Remove obsolete comment. 2020-01-04 19:14:50 -08:00
byte-opt.el Remove generation of old bytecodes for catch/unwind 2020-01-05 11:19:52 +01:00
byte-run.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
bytecomp.el Mark 'catch' and 'condition-case' bytecodes as obsolete 2020-01-05 23:30:05 +01:00
cconv.el Remove generation of old bytecodes for catch/unwind 2020-01-05 11:19:52 +01:00
chart.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
check-declare.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
checkdoc.el Add unattended spell-checking to checkdoc 2020-01-16 20:41:48 +02:00
cl-extra.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cl-generic.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cl-indent.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cl-lib.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cl-macs.el Generate fewer useless conditionals in cl-loop 2020-01-04 13:14:32 +01:00
cl-preloaded.el Fix copyright years by hand 2020-01-01 01:01:53 +00:00
cl-print.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cl-seq.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
copyright.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
crm.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cursor-sensor.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
debug.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
derived.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
disass.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
easy-mmode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
easymenu.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
edebug.el Merge from origin/emacs-27 2020-01-01 01:08:16 +00:00
eieio-base.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-compat.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-core.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-custom.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-datadebug.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-opt.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio-speedbar.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eieio.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
eldoc.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
elint.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
elp.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ert-x.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ert.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ewoc.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
faceup.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
find-func.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
float-sup.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
generator.el Merge from origin/emacs-27 2020-01-01 01:08:16 +00:00
generic.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
gv.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
helper.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
inline.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
let-alist.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lisp-mnt.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lisp-mode.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lisp.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
macroexp.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
map-ynp.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
map.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
nadvice.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
package-x.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
package.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
pcase.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
pp.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
radix-tree.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
re-builder.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
regexp-opt.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
regi.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
ring.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
rmc.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
rx.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
seq.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
shadow.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
smie.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
subr-x.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
syntax.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
tabulated-list.el Fix some broken conditional forms 2020-01-04 11:18:13 -08:00
tcover-ses.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
tcover-unsafep.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
testcover.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
text-property-search.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
thunk.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
timer-list.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
timer.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
tq.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
trace.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
unsafep.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
warnings.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00