branch: externals/mct commit c36c7e88581e04ebd9526f9221f07ba79216d9d2 Author: Philip Kaludercic <phil...@posteo.net> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Add new option mct-live-completion For users who prefer to reduce the "visual noise" generated by mct-mode. When setting mct-live-completion to nil, the *Completions* buffer is only displayed when requested (eg. C-l, C-n, C-p). --- README.org | 6 ++++++ mct.el | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/README.org b/README.org index a89ebd1..014462d 100644 --- a/README.org +++ b/README.org @@ -64,6 +64,7 @@ modify this GNU manual.” :END: #+cindex: Overview of features #+findex: mct-choose-completion-number +#+vindex: mct-live-completion #+vindex: mct-minimum-input #+vindex: mct-live-update-delay #+vindex: mct-completion-blocklist @@ -102,6 +103,11 @@ a blocklist and a passlist for commands are on offer: buffer for the designated command without accounting for the minimum input threshold. +To inhibit live completion in the first place, ~mct-live-completion~ +can be set to nil. Given this customization, the Completions' buffern +is only displayed when requested manually. ~mct-completion-passlist~ +takes precedence over this option. + Other customisations: + ~mct-hide-completion-mode-line~ to hide the mode line of the diff --git a/mct.el b/mct.el index e457057..7c294ac 100644 --- a/mct.el +++ b/mct.el @@ -71,6 +71,16 @@ Only works when variable `file-name-shadow-mode' is non-nil." :type 'boolean :group 'mct) +(defcustom mct-live-completion t + "Automatically display the Completions buffer. + +When disabled, the user has to manually request completions, +using the regular activating commands. Note that +`mct-completion-passlist' overrides this option, while taking +precedence over `mct-completion-blocklist'." + :type 'boolean + :group 'mct) + (defcustom mct-minimum-input 3 "Live update completions when input is >= N. @@ -257,6 +267,7 @@ Meant to be added to `after-change-functions'." (setq-local mct-live-update-delay 0) (mct--show-completions) (add-hook 'after-change-functions #'mct--live-completions nil t)) + ((null mct-live-completion)) ((unless (member this-command mct-completion-blocklist) (add-hook 'after-change-functions #'mct--live-completions-timer nil t)))))