From: "Tomasz Hołubowicz via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: me@eshelyaron.com, Tomasz@debbugs.gnu.org,
=?UTF-8?Q?Ho=C5=82ubowicz@debbugs.gnu.org
Subject: bug#74437: 30.0.92; completion-preview-idle-delay is delayed by flyspell
Date: Tue, 19 Nov 2024 17:56:46 +0100 [thread overview]
Message-ID: <87frnnkvqp.fsf@alternateved.com> (raw)
In-Reply-To: <m1cyirfbhf.fsf@macbookpro.home>
[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]
Hello,
On Tue, Nov 19 2024, Eshel Yaron wrote:
> 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... :)
>
Thank you for that tip!
> 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.)
Apologies for a bit noisy report, I wrote it in a bit of a rush.
If anyone would like to reproduce this issue, I believe below recipe
should be helpful:
(require 'flyspell)
(add-hook 'org-mode-hook #'flyspell-mode)
(require 'completion-preview)
(setopt completion-preview-idle-delay 0.2)
(push 'org-self-insert-command completion-preview-commands)
(global-completion-preview-mode 1)
After that open an Org file and try to trigger completion-preview by
writing a part of a word. Completion results most likely depend on the
contents of file pointed by ispell-alternate-dictionary value. If that
file is empty there might be no completions available.
> 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.
Thank you for help and explanation. I will try flyspell-delay 0 for a
time (or stick with completion-preview-mode only for prog-mode buffers
at it seems more appropriate).
Kind wishes,
Tomasz Hołubowicz
[-- Attachment #2.1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next prev parent reply other threads:[~2024-11-19 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-19 11:55 bug#74437: 30.0.92; completion-preview-idle-delay is delayed by flyspell Tomasz Hołubowicz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19 16:13 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19 16:56 ` Tomasz Hołubowicz via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-11-19 17:19 ` Eli Zaretskii
2024-11-19 18:40 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19 19:10 ` Eli Zaretskii
2024-11-19 20:16 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-20 13:04 ` Eli Zaretskii
2024-11-20 15:52 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-20 16:29 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87frnnkvqp.fsf@alternateved.com \
--to=bug-gnu-emacs@gnu.org \
--cc==?UTF-8?Q?Ho=C5=82ubowicz@debbugs.gnu.org \
--cc=Tomasz@debbugs.gnu.org \
--cc=mail@alternateved.com \
--cc=me@eshelyaron.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).