From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Pettersson Newsgroups: gmane.emacs.bugs Subject: bug#69733: [PATCH] Flyspell (flyspell-word): do not force 'save-excursion' on timers Date: Mon, 11 Mar 2024 15:37:55 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18110"; mail-complaints-to="usenet@ciao.gmane.io" To: 69733@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 11 15:38:51 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rjgnh-0004Px-AQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Mar 2024 15:38:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjgnR-0001kS-9j; Mon, 11 Mar 2024 10:38:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjgnN-0001k3-VN for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 10:38:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjgnM-0002Wj-8o for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 10:38:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjgnt-0003KL-Qq for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 10:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 14:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69733 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171016791712755 (code B ref -1); Mon, 11 Mar 2024 14:39:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Mar 2024 14:38:37 +0000 Original-Received: from localhost ([127.0.0.1]:40962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjgnV-0003Jf-3T for submit@debbugs.gnu.org; Mon, 11 Mar 2024 10:38:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjgnT-0003JX-MD for submit@debbugs.gnu.org; Mon, 11 Mar 2024 10:38:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjgmv-0001fE-DH for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 10:38:01 -0400 Original-Received: from mail-lf1-f54.google.com ([209.85.167.54]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjgmt-0002UM-MR for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 10:38:01 -0400 Original-Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-51344bebe2fso2963502e87.2 for ; Mon, 11 Mar 2024 07:37:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710167877; x=1710772677; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TfAu5gTQjUhEkpodiX0TY3i+zY1u8HdvFH3miQYl43Q=; b=iiwqZUuEf8I0UDPjjjfb5ZXUZIrbPuDqMYklrnrnfcASofYwLobeWhmjp4K6aIceaB WyPnIWgbcd7+AofZA/2oN9K49sPqBpStwsQMi4qYppS+QTCzZSV3XNWj4YCHywjUHGwl XK5GijgWfffOibHDijvtfhfV57cB7UiZcl5f0AmoR6Q7mK9p+eYV1pmq5XYfAsopbNh4 /CWBlndx9PNgrsR37lAad7sQcfl5lrNNo6KTcGWGCivFyfoj27XrkQG3oNRxAwjMrjHW 0ieUqJqaiCdiG+XiTXVmLZ5NR0vLJfhhbih0s/a2xMq9tnAI0XVlE1OtxMrVjIkgFMiW TOHg== X-Gm-Message-State: AOJu0Yy7kVeyfPJy75WNJdtbjF1uG/0x19mY53vJ49frz4Q6yioqQjNe xH3my4WSfEsgHhRY6HESo0fAV4K3IvWPFUThSfH6ps+JwvwYjrCVYW9C6RwQ X-Google-Smtp-Source: AGHT+IGoq36xCMD0muOluDs83jCemwp49INwzrjVLjzmPaSV9UvGjK6gGsrWlpXmkn4lgTiy+3DTzA== X-Received: by 2002:a05:6512:32c7:b0:513:b001:61e4 with SMTP id f7-20020a05651232c700b00513b00161e4mr1352648lfg.66.1710167876460; Mon, 11 Mar 2024 07:37:56 -0700 (PDT) Original-Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id i13-20020a056512340d00b005129e5d7f11sm1113157lfr.125.2024.03.11.07.37.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 07:37:55 -0700 (PDT) Received-SPF: pass client-ip=209.85.167.54; envelope-from=daniel.dpettersson.net@gmail.com; helo=mail-lf1-f54.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281475 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Flyspell-flyspell-word-do-not-force-save-excursion-o.patch >From 56bdf4df8048b4053719e33d08753a2eb088dc57 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson 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) --=-=-=--