Subject: Re: [PATCH] 27.0.50; Add unattended spell-checking to checkdoc

From: Damien Cassou <[email-masked]>
Date: Fri, 27 Dec 2019 12:51:42 +0100

Hi Eli,

Eli Zaretskii <[email-masked]> writes:
>> Eli Zaretskii <[email-masked]> writes:
>> > What happens if none of the spellers supported by ispell.el is
>> > installed on the user's system?
>> 
>> Starting new Ispell process ispell with default dictionary... \ 
>> Buffer xxx has no process
>> 
>> Emacs exit status is 255 in this case.
>
> Can we check this up front, and display some user-friendly message to
> the effect that spell-checking cannot be done?

Here is an additional patch for the series to answer your request.

If you believe the patch series is too large to be reviewed, I can split
it in several smaller ones.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
>From 754a6ed8e9bbe7dd46e0d4595d8e46b76dc5b606 Mon Sep 17 00:00:00 2001
From: Damien Cassou <[email-masked]>
Date: Fri, 27 Dec 2019 12:48:55 +0100
Subject: [PATCH] Improve error message when no spellchecker can be found

* lisp/emacs-lisp/checkdoc.el: Throw error when (checkdoc-ispell-init)
fails configuring ispell.
---
 lisp/emacs-lisp/checkdoc.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 3e6542bc80..0269b89790 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -2127,6 +2127,9 @@ checkdoc-ispell-docstring-engine
                  (and checkdoc-autofix-flag
                       (not (eq checkdoc-autofix-flag 'never)))))
     (checkdoc-ispell-init)
+    (unless checkdoc-spellcheck-documentation-flag
+      ;; this happens when (checkdoc-ispell-init) can't start `ispell-program-name'
+      (user-error "No spellchecker installed: check the variable `ispell-program-name'."))
     (save-excursion
       (skip-chars-forward "^a-zA-Z")
       (let (word sym case-fold-search err word-beginning word-end)
-- 
2.24.1