diff options
author | Ian W <ian@wahbe.com> | 2021-09-03 20:53:24 -0700 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-09-05 10:25:22 +0300 |
commit | ba84ec8bd93b931be975ab8a8a7f0d7a2df7054a (patch) | |
tree | 56be0ad7edd57b85d51c9b42cd43b0af23e6bf10 /lisp/textmodes/ispell.el | |
parent | e6f936eb4d28bf23eb367d4245a137284d5491ee (diff) | |
download | emacs-ba84ec8bd93b931be975ab8a8a7f0d7a2df7054a.tar.gz emacs-ba84ec8bd93b931be975ab8a8a7f0d7a2df7054a.tar.bz2 emacs-ba84ec8bd93b931be975ab8a8a7f0d7a2df7054a.zip |
Fix error handling in 'ispell-init-process'
* lisp/textmodes/ispell.el (ispell-init-process): When Ispell
initialization reports an error, call 'ispell-accept-output' only
if the Ispell process is still alive. (Bug#50370)
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/textmodes/ispell.el')
-rw-r--r-- | lisp/textmodes/ispell.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c2f6b35df89..3b9f1d35129 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2923,7 +2923,14 @@ Keeps argument list for future Ispell invocations for no async support." ;; But first wait to see if some more output is going to arrive. ;; Otherwise we get cool errors like "Can't open ". (sleep-for 1) - (ispell-accept-output 3) + ;; Only call `ispell-accept-output' if the Ispell process + ;; is alive, to avoid showing an unhelpful error message + ;; about a missing process, instead of the error which + ;; reports why the Ispell process died. + (when (if ispell-async-processp + (process-live-p ispell-process) + ispell-process) + (ispell-accept-output 3)) (error "%s" (mapconcat #'identity ispell-filter "\n")))) (setq ispell-filter nil) ; Discard version ID line (let ((extended-char-mode (ispell-get-extended-character-mode))) |