GNU bug report logs - #80036
ispell-region cannot be suspended

Previous Next

Package: emacs;

Reported by: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>

Date: Fri, 19 Dec 2025 16:15:03 UTC

Severity: normal

To reply to this bug, email your comments to 80036 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#80036; Package emacs. (Fri, 19 Dec 2025 16:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 19 Dec 2025 16:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
To: bug-gnu-emacs <at> gnu.org
Subject: ispell-region cannot be suspended
Date: Fri, 19 Dec 2025 10:36:21 +0100
Dear Emacs Maintainers,

I am using GNU Emacs version 30.2.

To reproduce, run LANG=C emacs -Q and then type:
Hel<SPC>lo
(That is, Hello with a space between the two letters l.)
Then type M-x ispell-message
The spell-checker should complain about the misspelled word Hel.
Now type C-g

Observed behaviour: "Message send aborted" is displayed in the
minibuffer.

Expected behaviour: the minibuffer should display:

Spell-checking suspended; use C-u M-$ to resume"

Notes:

1. Although the minibuffer does not display the text I would expect,
typing C-u M-$ _does_ seem to resume the spell checking.

2. If one runs:

LANG=C emacs -Q

And then types:

Hel<SPC>lo <M-SPC> C-a M-x ispell-region

the spell checker will stumblein thesame way as previously but, if
interrupted with C-g, it will display in the minibuffer the message
explaining how to resume spell checking.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80036; Package emacs. (Sat, 20 Dec 2025 07:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 80036 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
Cc: 80036 <at> debbugs.gnu.org
Subject: Re: bug#80036: ispell-region cannot be suspended
Date: Sat, 20 Dec 2025 09:33:32 +0200
> Date: Fri, 19 Dec 2025 10:36:21 +0100
> From: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
> 
> Dear Emacs Maintainers,
> 
> I am using GNU Emacs version 30.2.
> 
> To reproduce, run LANG=C emacs -Q and then type:
> Hel<SPC>lo
> (That is, Hello with a space between the two letters l.)
> Then type M-x ispell-message
> The spell-checker should complain about the misspelled word Hel.
> Now type C-g
> 
> Observed behaviour: "Message send aborted" is displayed in the
> minibuffer.
> 
> Expected behaviour: the minibuffer should display:
> 
> Spell-checking suspended; use C-u M-$ to resume"

If you look at the *Messages* buffer, you will see that the message
you expected was in fact shown, but it was immediately overwritten by
"Message send aborted".

ispell-message is mainly meant to be used in a hook of sending a
message, which is why it is important to tell the user that the
message will not be sent.  I can suggest the patch below to avoid
losing the information about the possible resumption of
spell-checking:

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6476a16..4fcc6c6 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3250,7 +3250,11 @@ ispell-region
 	    (if (and ispell-checking-message (numberp ispell-quit))
 		(progn
 		  (setq ispell-quit nil)
-		  (error "Message send aborted")))
+                  (error "%s"
+                         (concat "Message sending aborted (use "
+                                 (substitute-command-keys
+		                  "\\[universal-argument] \\[ispell-word]")
+                                 " to resume spell-checking)"))))
 	    (if (not recheckp) (setq ispell-quit nil)))
 	(if (not recheckp) (set-marker ispell-region-end nil))
 	;; Only save if successful exit.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80036; Package emacs. (Sat, 20 Dec 2025 09:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 80036 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
Cc: 80036 <at> debbugs.gnu.org
Subject: Re: bug#80036: ispell-region cannot be suspended
Date: Sat, 20 Dec 2025 11:46:07 +0200
> Date: Sat, 20 Dec 2025 10:15:08 +0100
> From: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
> Cc: 80036 <at> debbugs.gnu.org
> 
> Ah I see, sorry I didn't think about thecking the messages window.
> 
> However, as far as I understand, ispell-mesage *is* an interactive
> function. It is thus not wrong to call it directly, independently of
> whether one is in the process of sending a message or not. And
> this is actually my use-case for it since I use Emacs as an
> external editor, my MUA being mutt.
> 
> Would it perhaps make sense that the exposed ispell-message does not
> care about sending at all, ormaybe has an argument to let it know
> whether one is in the context of sending a message or not?

To distinguish between the case of this function running in a
message-send-hook and the case it was invoked would need deeper
changes.  Patches for doing that will be most welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80036; Package emacs. (Sun, 21 Dec 2025 03:37:03 GMT) Full text and rfc822 format available.

Message #14 received at 80036 <at> debbugs.gnu.org (full text, mbox):

From: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80036 <at> debbugs.gnu.org
Subject: Re: bug#80036: ispell-region cannot be suspended
Date: Sat, 20 Dec 2025 10:15:08 +0100
Ah I see, sorry I didn't think about thecking the messages window.

However, as far as I understand, ispell-mesage *is* an interactive
function. It is thus not wrong to call it directly, independently of
whether one is in the process of sending a message or not. And
this is actually my use-case for it since I use Emacs as an
external editor, my MUA being mutt.

Would it perhaps make sense that the exposed ispell-message does not
care about sending at all, ormaybe has an argument to let it know
whether one is in the context of sending a message or not?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80036; Package emacs. (Sun, 21 Dec 2025 03:37:03 GMT) Full text and rfc822 format available.

Message #17 received at 80036 <at> debbugs.gnu.org (full text, mbox):

From: Sébastien Hinderer <sebastien.hinderer <at> ens-lyon.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80036 <at> debbugs.gnu.org
Subject: Re: bug#80036: ispell-region cannot be suspended
Date: Sat, 20 Dec 2025 10:51:28 +0100
Eli Zaretskii (2025/12/20 11:46 +0200):
> To distinguish between the case of this function running in a
> message-send-hook and the case it was invoked would need deeper
> changes.

Yes, I agree that to be done cleanly this will require a bit of
rewriting / refactoring.

My Emacs-Lisp-fu is not big enough for me to address such a challenge
right now but I will definitely keep that in mind as one thing to work
on when I become expert enough, if it has not been addressed before.




This bug report was last modified 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.