all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Pettersson <daniel@dpettersson.net>
To: 69733@debbugs.gnu.org
Subject: bug#69733: [PATCH] Flyspell (flyspell-word): do not force 'save-excursion' on timers
Date: Mon, 11 Mar 2024 15:37:55 +0100	[thread overview]
Message-ID: <m2sf0wzvek.fsf@dpettersson.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Tags: patch


As I understand the manual there is nothing that states that one should
assume that you cant move the point in buffer with timers.  This is of
course impossible to guarantee as any code can be calling
accept-process-output.  But it seams like an good idea to have code that
is triggered by post-command-hook to not impose such conditions. 

This might seam like an mole whacking activity, and it most definitely
is.

In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.1.0, NS
 appkit-2487.20 Version 14.1.1 (Build 23B81)) of 2023-12-20 built on
 Daniels-Air
Repository revision: 281be72422f42fcc84d43f50723a3e91b7d03cbc
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.1.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Flyspell-flyspell-word-do-not-force-save-excursion-o.patch --]
[-- Type: text/patch, Size: 1330 bytes --]

From 56bdf4df8048b4053719e33d08753a2eb088dc57 Mon Sep 17 00:00:00 2001
From: Daniel Pettersson <daniel@dpettersson.net>
Date: Mon, 11 Mar 2024 15:01:32 +0100
Subject: [PATCH] Flyspell (flyspell-word): do not force 'save-excursion' on
 timers

* lisp/textmode/flyspell.el (flyspell-word): Do not force
save-excursion on timers.  This especially needed here as
flyspell-word is fired from an post command hook.
---
 lisp/textmodes/flyspell.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index de59294e9f0..5dfe0f17aef 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1150,7 +1150,9 @@ flyspell-word
 		  (set-process-query-on-exit-flag ispell-process nil)
                   ;; Wait until ispell has processed word.
                   (while (progn
-                           (accept-process-output ispell-process)
+                           ;; don't force save-excursion to timers.
+                           ;; only accept output from ispell-process.
+                           (accept-process-output ispell-process nil nil t)
                            (not (string= "" (car ispell-filter)))))
                   ;; (ispell-send-string "!\n")
                   ;; back to terse mode.
-- 
2.39.3 (Apple Git-145)


             reply	other threads:[~2024-03-11 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 14:37 Daniel Pettersson [this message]
2024-03-12 13:20 ` bug#69733: [PATCH] Flyspell (flyspell-word): do not force 'save-excursion' on timers Eli Zaretskii
2024-03-12 14:28   ` Daniel Pettersson
2024-03-14 10:36     ` Eli Zaretskii
2024-03-15 11:29       ` Daniel Pettersson
2024-03-15 12:36         ` Eli Zaretskii
2024-03-15 15:59 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2sf0wzvek.fsf@dpettersson.net \
    --to=daniel@dpettersson.net \
    --cc=69733@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.