Subject: Re: bug#75804: 31.0.50; Enlarge or disable `ispell-help-timeout'

From: Stefan Kangas <[email-masked]>
Date: Sun, 26 Jan 2025 07:15:45 -0600

Rudolf Adamkovič <[email-masked]> writes:

> From d8ded5bcba933cb057572807473f9699d7db4919 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <[email-masked]>
> Date: Sat, 25 Jan 2025 11:24:34 +0100
> Subject: [PATCH] Ispell: Increase help timeout
>
> * lisp/textmodes/ispell.el (ispell-help-timeout): Increase the timeout
> from 5 to 30 seconds to allow users, especially new users, read the
> Ispell help menu comfortably and act confidently (bug#75804).

Thanks.

1. I don't see that we support a nil value, so I think we should add it,
   and `nil` should mean "never time out".  This would be easier to set
   than (setq ispell-help-timeout most-positive-fixnum).

2. I gave this a try, but actually I'm not at all sure why we should
   hide the buffer at all, by default.  The user asked to show it, after
   all, and Emacs is waiting for them to hit a key.  IMO, it is hard to
   even understand the purpose of this hiding "feature".

   I think we should just leave it on the screen, which is what the help
   system does everywhere else.  Users who _really_ want to hide it, for
   some reason that I don't understand, will just have to customize it
   back.  So I'm in favor of a `nil` default.

The above 1-2 should be documented in NEWS.

3. We should probably consider this, because a value <1 is rather
   useless and more likely than not a user mistake:

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 761a413baab..7b1f5c8ed7f 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2513,7 +2513,7 @@ ispell-help
 	      (with-current-buffer buffer
 		(insert (concat help-1 "\n" help-2 "\n" help-3)))
 	      (ispell-display-buffer buffer)
-	      (sit-for ispell-help-timeout)
+	      (sit-for (max ispell-help-timeout 1))
 	      (kill-buffer "*Ispell Help*"))
 	  (unwind-protect
 	      (let ((resize-mini-windows 'grow-only))
@@ -2523,7 +2523,7 @@ ispell-help
 		;;(set-minibuffer-window (selected-window))
 		(enlarge-window 2)
 		(insert (concat help-1 "\n" help-2 "\n" help-3))
-		(sit-for ispell-help-timeout))
+		(sit-for (max ispell-help-timeout 1)))
 	    (erase-buffer)))))))

 (define-obsolete-function-alias 'lookup-words 'ispell-lookup-words "24.4")

> ---
>  lisp/textmodes/ispell.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
> index b0f4e416a6e..eca42b63023 100644
> --- a/lisp/textmodes/ispell.el
> +++ b/lisp/textmodes/ispell.el
> @@ -402,7 +402,7 @@ ispell-local-dictionary-alist
>   			       (const :tag "default" nil))
>                         (coding-system :tag "Coding System"))))
>
> -(defcustom ispell-help-timeout 5
> +(defcustom ispell-help-timeout 30
>    "The number of seconds to display the help text."
>    :type 'number
>    :version "28.1")

The :type should be 'natnum instead, and the :version tag needs updating
like Robert pointed out.

> --
> 2.39.5 (Apple Git-154)