From e08065da5db9dc1c30b1b83adcc88d38b1ed671f Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sun, 27 Jun 2021 22:07:06 +0100 Subject: [PATCH 2/3] * lisp/textmodes/ispell.el: Check process is live before interacting. Check that `ispell-process' is live before trying to read from or write to it. This avoids a hang if the process has died. --- lisp/textmodes/ispell.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index e3c1e61772..8b799b08c0 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1765,10 +1765,12 @@ ispell-accept-output If asynchronous subprocesses are not supported, call function `ispell-filter' and pass it the output of the last Ispell invocation." (if ispell-async-processp - (let ((timeout (if timeout-msecs - (+ (or timeout-secs 0) (/ timeout-msecs 1000.0)) - timeout-secs))) - (accept-process-output ispell-process timeout)) + (if (process-live-p ispell-process) + (let ((timeout (if timeout-msecs + (+ (or timeout-secs 0) (/ timeout-msecs 1000.0)) + timeout-secs))) + (accept-process-output ispell-process timeout)) + (error "No Ispell process to read output from!")) (if (null ispell-process) (error "No Ispell process to read output from!") (let ((buf ispell-output-buffer) @@ -1793,7 +1795,8 @@ ispell-send-replacement (defun ispell-send-string (string) "Send the string STRING to the Ispell process." (if ispell-async-processp - (process-send-string ispell-process string) + (if (process-live-p ispell-process) + (process-send-string ispell-process string)) ;; Asynchronous subprocesses aren't supported on this losing system. ;; We keep all the directives passed to Ispell during the entire ;; session in a buffer, and pass them anew each time we invoke -- 2.25.1