; completion-preview.el: Refine recent addition.

* lisp/completion-preview.el
(completion-preview-inhibit-functions): Reposition, add
:version tag.
This commit is contained in:
Eshel Yaron 2026-02-14 12:41:49 +01:00
parent e1bf2a6ff4
commit 27070b0c47
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -176,6 +176,14 @@ after non-symbol characters, such as punctuation or whitespace."
(const :tag "Disable minimum symbol length requirement" nil)) (const :tag "Disable minimum symbol length requirement" nil))
:version "30.1") :version "30.1")
(defcustom completion-preview-inhibit-functions nil
"Abnormal hook for inhibiting Completion Preview mode operation.
Completion Preview mode calls the functions on this hook without
arguments during `post-command-hook'. If any of these functions returns
non-nil, it inhibits the preview display."
:type 'hook
:version "31.1")
(defcustom completion-preview-message-format (defcustom completion-preview-message-format
"Completion suggestion %i out of %n" "Completion suggestion %i out of %n"
"Message to show after cycling the completion preview suggestion. "Message to show after cycling the completion preview suggestion.
@ -619,13 +627,6 @@ point, otherwise hide it."
(selected-window) (current-buffer))) (selected-window) (current-buffer)))
(completion-preview--try-update))) (completion-preview--try-update)))
(defcustom completion-preview-inhibit-functions nil
"Abnormal hook for inhibiting Completion Preview mode operation.
Completion Preview mode calls the functions on this hook without
arguments during `post-command-hook'. If any of these functions returns
non-nil, it inhibits the preview display."
:type 'hook)
(defun completion-preview--post-command () (defun completion-preview--post-command ()
"Create, update or delete completion preview post last command." "Create, update or delete completion preview post last command."
(let ((internal-p (or completion-preview--inhibit-update-p (let ((internal-p (or completion-preview--inhibit-update-p