emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] externals/sly 070b1db 2/7: Close #303: Protect sly-eval against


From: Stefan Monnier
Subject: [nongnu] externals/sly 070b1db 2/7: Close #303: Protect sly-eval against callers that set inhibit-quit to t
Date: Sat, 21 Nov 2020 01:34:52 -0500 (EST)

branch: externals/sly
commit 070b1dbc60d399abb9100f73f00a077ce63b07cf
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Close #303: Protect sly-eval against callers that set inhibit-quit to t
    
    * sly.el (sly-eval): Set inhibit-quit to t.
---
 sly.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sly.el b/sly.el
index 741c6d9..f6be037 100644
--- a/sly.el
+++ b/sly.el
@@ -2400,8 +2400,17 @@ wants to input, and return CANCEL-ON-INPUT-RETVAL."
                      (throw catch-tag
                             (list #'error "Synchronous Lisp Evaluation 
aborted")))))
                 (cond (cancel-on-input
-                       (while (sit-for 30))
-                       (setq cancelled t)
+                       ;; Setting `inhibit-quit' to t helps with
+                       ;; callers that wrap us in `while-no-input',
+                       ;; like `fido-mode' and Helm.  It doesn't seem
+                       ;; to create any specific problems, since
+                       ;; `sit-for' exits immediately given input
+                       ;; anyway.  This include the C-g input, and
+                       ;; thus even with `inhibit-quit' set to t, quit
+                       ;; happens immediately.
+                       (unwind-protect
+                           (let ((inhibit-quit t)) (while (sit-for 30)))
+                         (setq cancelled t))
                        (funcall check-conn))
                       (t
                        (while t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]