summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-05-16 15:49:38 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2025-05-16 15:49:38 +0200
commit3ce82b95e6ba6e466693ba6e157d771129bbd222 (patch)
treea773e8897bae0d5f7d7fecd38c7acb80360f22f8 /corfu.el
parent7d69a9c5cedef9d2784b2172505da8256b707b0c (diff)
corfu--protect: Simplify
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/corfu.el b/corfu.el
index 560cc9b..1400465 100644
--- a/corfu.el
+++ b/corfu.el
@@ -868,14 +868,14 @@ the last command must be listed in `corfu-continue-commands'."
"Protect FUN such that errors are caught.
If an error occurs, the FUN is retried with `debug-on-error' enabled and
the stack trace is shown in the *Messages* buffer."
- (let ((fun (lambda ()
- (condition-case nil
- (progn (funcall fun) nil)
- ((debug error) t)))))
- (when (or debug-on-error (funcall fun))
- (let ((debug-on-error t)
- (debugger #'corfu--debug))
- (funcall fun)))))
+ (when (or debug-on-error (condition-case nil
+ (progn (funcall fun) nil)
+ ((debug error) t)))
+ (let ((debug-on-error t)
+ (debugger #'corfu--debug))
+ (condition-case nil
+ (funcall fun)
+ ((debug error) nil)))))
(defun corfu--post-command ()
"Refresh Corfu after last command."