From 048e9553a8cc966616c01337af07a1f31a3972f1 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 14 Feb 2026 12:26:53 +0100 Subject: [PATCH] ; Add t as a possible value for 'completion-preview-commands' * lisp/completion-preview.el (completion-preview-commands): Allow the value t, which says that completion preview should be attempted after any command. * lisp/completion-preview.el (completion-preview-require-certain-commands): Adapt. --- lisp/completion-preview.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index bf0ba949d61..5a1a6b5ed43 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -159,8 +159,12 @@ first candidate, and you can cycle between the candidates with completion-preview-complete completion-preview-insert-word completion-preview-insert-sexp) - "List of commands that should trigger completion preview." - :type '(repeat (function :tag "Command" :value self-insert-command)) + "List of commands that should trigger completion preview. +This can also be t instead of a list of commands, which says that any +command can trigger completion preview." + :type '(choice (repeat :tag "Specific commands" + (function :tag "Command" :value self-insert-command)) + (const :tag "Any command" t)) :version "30.1") (defcustom completion-preview-minimum-symbol-length 3 @@ -334,7 +338,8 @@ Completion Preview mode avoids updating the preview after these commands.") (defsubst completion-preview-require-certain-commands () "Check if `this-command' is one of `completion-preview-commands'." - (memq this-command completion-preview-commands)) + (or (eq completion-preview-commands t) + (memq this-command completion-preview-commands))) (defun completion-preview-require-minimum-symbol-length () "Check if the length of symbol at point is at least above a certain threshold.