From f12b01582db7ca834e60b21760d18db3f2c8bf54 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 11 May 2026 20:30:15 +0300 Subject: [PATCH] Fix Completions buffer disappearing with tmm-menubar (bug#80995) * lisp/minibuffer.el (completions--start-background-update): Cancel a possible leftover timer (e.g. from the previous after-change hook) that would suppress the display of *Completions* when 'completion-eager-update' is nil. (completions--after-change): Don't start background update when not required to automatically update *Completions*. --- lisp/minibuffer.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 636d0951645..e8fb479bc85 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2791,6 +2791,9 @@ Whether we update the buffer is based on `completion-eager-display' and `eager-display' and `eager-update'. If FORCE-EAGER-UPDATE is non-nil, we only check eager-display." + (when (and force-eager-update completions--background-update-timer) + (cancel-timer completions--background-update-timer) + (setq completions--background-update-timer nil)) (unless completions--background-update-timer (setq completions--background-update-timer (run-with-idle-timer @@ -2811,7 +2814,10 @@ has been requested by the completion table." (when completion-auto-deselect (with-selected-window window (completions--deselect)))) - (completions--start-background-update))) + (when (or completion-in-region-mode + (completions--should-show-p + (completion--field-metadata (minibuffer-prompt-end)))) + (completions--start-background-update)))) (defun minibuffer-completion-help (&optional start end) "Display a list of possible completions of the current minibuffer contents."