From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69733: [PATCH] Flyspell (flyspell-word): do not force 'save-excursion' on timers Date: Fri, 15 Mar 2024 14:36:23 +0200 Message-ID: <86edcb8yew.fsf@gnu.org> References: <86ttlbtwmt.fsf@gnu.org> <86ttl99k31.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24410"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69733@debbugs.gnu.org To: Daniel Pettersson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 15 13:37:49 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 1rl6om-00069k-95 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Mar 2024 13:37:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rl6oR-0008S7-9h; Fri, 15 Mar 2024 08:37:27 -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 1rl6oP-0008Ra-Us for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 08:37:26 -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 1rl6oP-0008MG-Ld for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 08:37:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rl6oz-00084X-KS for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 08:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Mar 2024 12:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69733 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69733-submit@debbugs.gnu.org id=B69733.171050623630973 (code B ref 69733); Fri, 15 Mar 2024 12:38:01 +0000 Original-Received: (at 69733) by debbugs.gnu.org; 15 Mar 2024 12:37:16 +0000 Original-Received: from localhost ([127.0.0.1]:52245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rl6oF-00083U-ER for submit@debbugs.gnu.org; Fri, 15 Mar 2024 08:37:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rl6oA-00083C-BS for 69733@debbugs.gnu.org; Fri, 15 Mar 2024 08:37:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rl6nU-0008HE-B4; Fri, 15 Mar 2024 08:36:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cpdAPude7oXe3slJx5nxTwnlHT7Gsl0j3OLZO4XlsSQ=; b=l9YUf+4aV+Wq X7XHgc1p9Nh6g+25qq4D/kN9uvJk4BiBkXyEtxcfGETRgwI1zTJ+dkldlXzuCl940GGugpaLdgj8O urzotKewZHwGeQtpNZynAUzcnjvsqoK9glnrMXQTwjKOAhBMIASefBk1w8olbe7NZ9kt+QZ25856E yKrRpCtTttt6TtwW5A+T4ovHgKaeLn1sAM7ElnkImQZqE4JutliNaOjvVh4z3dJQeEVHjWZRsIpge /l8cz2A6bgVEnQEyQfHH/Omg2dEc+Kl3nkhp7HgcDxZ50GhskpEaMp9miIlFvrbbOywAy2nFha4kS rQStT7X4oKGzeht2mlRqOA==; In-Reply-To: (message from Daniel Pettersson on Fri, 15 Mar 2024 12:29:46 +0100) 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:281672 Archived-At: > From: Daniel Pettersson > Cc: 69733@debbugs.gnu.org > Date: Fri, 15 Mar 2024 12:29:46 +0100 > > Eli Zaretskii writes: > > > Thanks, but I'm still confused regarding what you are trying to fix > > and why you are trying to fix it with the patch you proposed. > > Lets just preface with that for accept-process-output non idle timers > and process filters are the same thing, right? So any filter or timer > might run inside of accept-process-output if JUST-THIS-ONE is nil. > > The issue was noticed with the elpa package dape, with > flyspell-prog-mode. But I was able to reproduce it in gdb-mi.el > (gud-next) as well. The common denominator here is moving the point > from filter/timer functions, in both cases source buffers. I think (and you agree below) that these are bugs in these packages. Non-idle timer cannot safely move point, and neither can a process filter. It basically means we move point while the user might be typing something, which would be a terrible misfeature! > > First, AFAIU, save-excursion is there because flyspell-get-word might > > move point. So this is justified. > > No doubt that the save-excursion is justified but it surly does not need > to wrap everything, one could be a bit more exact (wrap those parts) > that actually move the point. That's correct, so if you want to move save-excursion closer to flyspell-get-word, it would be fine. > After some thinking I it might be impossible to impose anything on the > caller of accept-process-output. And the bug is in dape and gdb-mi.el > that gud should call gud-display-line inside of an idle timer to ensure > that the point is moved, if I understand how idle timers are called > which might be false. Exactly. Idle timers can move point, provided that they wait a reasonable amount of idleness time, to avoid interpreting a 0.01 sec gap in user typing as "idle". > Maybe it would be a good idea if "(elisp) Timers" would mention these > things. Would that be an good idea? Yes, I think so. We already advise not to do certain things in a timer function, so this could be an addition to those parts. > I could be up for writing something up, even if don't consider > myself to be that good at writing documentation. Thanks, please do.