From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74437: 30.0.92; completion-preview-idle-delay is delayed by flyspell Date: Tue, 19 Nov 2024 17:13:16 +0100 Message-ID: References: <87cyirbfpd.fsf@alternateved.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17838"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: mail@alternateved.com To: 74437@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 19 17:14:22 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 1tDQru-0004Va-Ii for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Nov 2024 17:14:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDQrc-00032F-Lx; Tue, 19 Nov 2024 11:14:04 -0500 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 1tDQra-0002yO-Sm for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 11:14:02 -0500 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 1tDQra-0006oA-KI for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 11:14:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Kgalv7bv1L+KatEC6HLRf9NKP+cBp/x3SLZ98CcZdcU=; b=oqpcA1iaH08nodAlZH29HApj9mebWU7mkiHAPIMD52qayRRywa2TYU/LjFJNcj3wyrRr8G+gmt5dXreustl6VvAAFm0dIARrlR5gcQWFssdURaLZh113ktMJ9gJS7GecBJWhN5NCeceTkHheuQwvJBpx6lD97W+MWxcYw0fDFgCwPWBUELY7ibkMf7DjG5P3CqYfp7mX0OEI8R3+nC6eKIW3q+Jgpi/Wupy14blXLeBmG7MD5q/ayQH55HNAqcMMsJwhn55IyOA5lJ+F0gbA8Hg3tUu0E5r5CeM1GWYajVWnyPbZtaEID99XOyLXpgf4I2s4/Qc3AnOUCTLusUXh2A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tDQra-0005gE-Ek for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 11:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Nov 2024 16:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74437 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Tomasz =?UTF-8?Q?Ho=C5=82ubowicz?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: 74437@debbugs.gnu.org, Tomasz =?UTF-8?Q?Ho=C5=82ubowicz?= Original-Received: via spool by submit@debbugs.gnu.org id=B.173203281021783 (code B ref -1); Tue, 19 Nov 2024 16:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Nov 2024 16:13:30 +0000 Original-Received: from localhost ([127.0.0.1]:43766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDQr3-0005fG-Gy for submit@debbugs.gnu.org; Tue, 19 Nov 2024 11:13:30 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDQqz-0005f5-Ke for submit@debbugs.gnu.org; Tue, 19 Nov 2024 11:13:26 -0500 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 1tDQqz-0002vM-9w for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 11:13:25 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDQqu-0006kI-8a for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 11:13:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1732032799; bh=xizYcHj1Ll/4P9LtdIdiq1Jddq2NyYkEyQfEgWIE8jM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fPu1o/2imONrPJUdj1iM4ONiIQIE75iysACgBNPlbiEeZueAbB1GfdccH0ONkuxG0 A5kHDnMKMaTVd8UhOhkYjxyw2/Aym/h5udQlsmVgdRn0xM+DKeOLH9/s3Baw9CgrK7 rEIRcebKLluo0D3ASMoFnyiKTaA9TJf13idPQYokS7vLsW2jWkl83q2GAq+DGWPv/k /CoijIoQrIAzQLAhwsFKUIGg0iMjGIxJGb+DjXy9ZEVCjKxoou4ZmG+1VOaPuACv19 UQOgq4F4BEQzsva3bmP21LnoClttCXpiTUMioFsZ/m0J3fbZ3365ymd9klMHHIi6cY g3nQLQs2AU2tw== In-Reply-To: <87cyirbfpd.fsf@alternateved.com> ("Tomasz =?UTF-8?Q?Ho=C5=82ubowicz?= via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\""'s message of "Tue, 19 Nov 2024 12:55:42 +0100") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:295643 Archived-At: Hi there, Tomasz Ho=C5=82ubowicz writes: > Hello, > > This is my configuration for completion-preview: > > (use-package completion-preview > :hook (after-init . global-completion-preview-mode) > :bind (:map completion-preview-active-mode-map > ("M-n" . completion-preview-next-candidate) > ("M-p" . completion-preview-prev-candidate)) > :custom (completion-preview-idle-delay 0.2) > :config > ;; Org mode has a custom `self-insert-command' > (push 'org-self-insert-command completion-preview-commands) > > ;; Hide `completion-preview' overlay when invoking `completion-in-regio= n' > (with-eval-after-load 'consult > (advice-add 'consult-completion-in-region :before (lambda (&rest _) (= completion-preview-hide))))) Side note: it is better to use (completion-preview-active-mode -1) instead of (completion-preview-hide) to dismiss the preview, since disabling the minor mode performs additional cleanup. Perhaps I should mention that in the documentation somewhere... :) > When I enter org-mode file and flyspell-mode is toggled on then the > completion-preview-idle-delay is much longer in reality that 0.2s. After > I disable flyspell-mode, then the delay is truly 0.2s. It > seems that completion-preview is being delayed by flyspell checking > currently written word. It makes sense if we consider 'idle' literally, > but I'm not sure if this is desired. Thank you for this report. I can reproduce the extended delay here. (In the future, please provide a minimal recipe to reproduce the issue starting from emacs -Q, if possible.) The root cause is a peculiarity of flyspell-mode: it calls sit-for and blocks Emacs for 3 whole seconds (by default, see flyspell-delay) after certain commands, including after (org-)self-insert-command. This also blocks the idle timer that Completion Preview mode uses, unfortunately. A quick search shows that this behavior of flyspell affects other features as well. For example, IIUC, auto completion in Corfu switched to using run-at-time instead of run-with-idle-timer due to this issue. I think flyspell should be modified to use a timer instead of sit-for, so as to avoid blocking idle timers. I can come up with such a patch, but it's not quite trivial, so I wonder what others think about this issue and how it should be addressed. As a stopgap, you can try setting flyspell-delay to 0. Best, Eshel