[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 94d573f314 2/3: Use when instead of if
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 94d573f314 2/3: Use when instead of if |
Date: |
Tue, 26 Nov 2024 06:57:40 -0500 (EST) |
branch: externals/corfu
commit 94d573f314bac164b3cfc08a2cbc7d248009cf41
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Use when instead of if
---
corfu.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/corfu.el b/corfu.el
index 67dc2e2124..3081cd1e5f 100644
--- a/corfu.el
+++ b/corfu.el
@@ -992,20 +992,20 @@ See `completion-in-region' for the arguments BEG, END,
TABLE, PRED."
(defun corfu--auto-post-command ()
"Post command hook which initiates auto completion."
(cancel-timer corfu--auto-timer)
- (if (and (not completion-in-region-mode)
- (not defining-kbd-macro)
- (not buffer-read-only)
- (corfu--match-symbol-p corfu-auto-commands this-command)
- (corfu--popup-support-p))
- (if (<= corfu-auto-delay 0)
- (corfu--auto-complete-deferred)
- ;; Do not use `timer-set-idle-time' since this leads to
- ;; unpredictable pauses, in particular with `flyspell-mode'.
- (timer-set-time corfu--auto-timer
- (timer-relative-time nil corfu-auto-delay))
- (timer-set-function corfu--auto-timer #'corfu--auto-complete-deferred
- (list (corfu--auto-tick)))
- (timer-activate corfu--auto-timer))))
+ (when (and (not completion-in-region-mode)
+ (not defining-kbd-macro)
+ (not buffer-read-only)
+ (corfu--match-symbol-p corfu-auto-commands this-command)
+ (corfu--popup-support-p))
+ (if (<= corfu-auto-delay 0)
+ (corfu--auto-complete-deferred)
+ ;; Do not use `timer-set-idle-time' since this leads to
+ ;; unpredictable pauses, in particular with `flyspell-mode'.
+ (timer-set-time corfu--auto-timer
+ (timer-relative-time nil corfu-auto-delay))
+ (timer-set-function corfu--auto-timer #'corfu--auto-complete-deferred
+ (list (corfu--auto-tick)))
+ (timer-activate corfu--auto-timer))))
(defun corfu--auto-tick ()
"Return the current tick/status of the buffer.