branch: externals/corfu commit 60655764dc41dc42666abd69ff5c386661d98e59 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
corfu-echo-delay, corfu-popupinfo-delay: Remove support for instant value t. --- CHANGELOG.org | 3 +++ corfu.el | 4 ++-- extensions/corfu-echo.el | 7 +++---- extensions/corfu-popupinfo.el | 19 +++++++++++-------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index c7539fe5a6..29049d234e 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -5,6 +5,9 @@ * Development - Drop obsolete =corfu-preselect-first=. +- =corfu-popupinfo-delay= and =corfu-echo-delay=: Remove support for value =t=. + Instant updates are not recommended. It is still possible to use a small value + for the delay. * Version 0.35 (2023-02-17) diff --git a/corfu.el b/corfu.el index 2e1d3ed382..bd46aa1879 100644 --- a/corfu.el +++ b/corfu.el @@ -160,13 +160,13 @@ return a string, possibly an icon." "Minimum length of prefix for auto completion. The completion backend can override this with :company-prefix-length. It is *not recommended* to use a small -value here (below 2), since this will create high load for +prefix length (below 2), since this will create high load for Emacs. See also `corfu-auto-delay'." :type 'natnum) (defcustom corfu-auto-delay 0.2 "Delay for auto completion. -It is *not recommended* to use a very small value or even 0, +It is *not recommended* to use a very small delay or even 0, since this will create high load for Emacs in particular if the completion backend in use is expensive." :type 'float) diff --git a/extensions/corfu-echo.el b/extensions/corfu-echo.el index 5b845c7f14..66dcb9e63e 100644 --- a/extensions/corfu-echo.el +++ b/extensions/corfu-echo.el @@ -41,10 +41,9 @@ (defcustom corfu-echo-delay '(2.0 . 1.0) "Show documentation string in the echo area after that number of seconds. -Set to t for an instant message. The value can be a pair of two -floats to specify initial and subsequent delay." +The value can be a pair of two floats to specify initial and +subsequent delay." :type '(choice (const :tag "Never" nil) - (const :tag "Instant" t) (number :tag "Delay in seconds") (cons :tag "Two Delays" (choice :tag "Initial " number) @@ -89,7 +88,7 @@ floats to specify initial and subsequent delay." (fun (plist-get corfu--extra :company-docsig)) (cand (and (>= corfu--index 0) (nth corfu--index corfu--candidates)))) - (if (or (eq delay t) (<= delay 0)) + (if (<= delay 0) (corfu-echo--show (funcall fun cand)) (corfu-echo--cancel) (setq corfu-echo--timer diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el index 8bf7405a6a..2c9e650aad 100644 --- a/extensions/corfu-popupinfo.el +++ b/extensions/corfu-popupinfo.el @@ -53,14 +53,17 @@ (defcustom corfu-popupinfo-delay '(2.0 . 1.0) "Automatically update info popup after that number of seconds. -Set to t for an instant update. The value can be a pair of two -floats to specify initial and subsequent delay. If the value is -non-nil or the car of the pair is non-nil, the popup will -automatically appear for the preselected candidate. Otherwise the -popup can be requested manually via `corfu-popupinfo-toggle', -`corfu-popupinfo-documentation' and `corfu-popupinfo-location'." +The value can be a pair of two floats to specify initial and +subsequent delay. If the value is non-nil or the car of the pair +is non-nil, the popup will automatically appear for the +preselected candidate. Otherwise the popup can be requested +manually via `corfu-popupinfo-toggle', +`corfu-popupinfo-documentation' and `corfu-popupinfo-location'. + +It is *not recommended* to use a very small delay, since this +will create high load for Emacs since retrieving the +documentation is usually expensive." :type '(choice (const :tag "Never" nil) - (const :tag "Instant" t) (number :tag "Delay in seconds") (cons :tag "Two Delays" (choice :tag "Initial " @@ -484,7 +487,7 @@ not be displayed until this command is called again, even if corfu-popupinfo-delay) corfu-popupinfo-delay)) (corfu-popupinfo--toggle)) - (if (or (eq delay t) (<= delay 0) + (if (or (<= delay 0) (and (equal candidate corfu-popupinfo--candidate) (corfu-popupinfo--visible-p))) (corfu-popupinfo--show candidate)