branch: externals/corfu
commit 3ce82b95e6ba6e466693ba6e157d771129bbd222
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    corfu--protect: Simplify
---
 corfu.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/corfu.el b/corfu.el
index 560cc9b1e4..1400465e1e 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."

Reply via email to