From 9351fad650e4952f9ff1d8fc951957a283802f5e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 13 Aug 2025 21:48:18 +0200 Subject: [PATCH] ; * lisp/completion-preview.el: Fix race condition. * lisp/completion-preview.el (completion-preview--update): Bind 'inhibit-quit' to non-nil around completion preview overlay initialization. This binding prevents the surrounding 'while-no-input' from interrupting the overlay initialization, which yields an inconsistent state wherein the overlay is visible but completion-preview-active-mode wasn't enabled. --- lisp/completion-preview.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 84380ee5c54..e5953f4a513 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -521,7 +521,9 @@ candidates or if there are multiple matching completions and (run-hook-wrapped 'completion-at-point-functions #'completion-preview--capf-wrapper) - (when-let* ((suffix (car suffixes))) + (when-let* ((suffix (car suffixes)) + (inhibit-quit t)) + ;; Critical section, do not quit upon receiving input here. (set-text-properties 0 (length suffix) (list 'face (if (cdr suffixes) 'completion-preview