[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly 0207e2d: Fix #385: Ensure that autodoc doesn't ma
From: |
Stefan Monnier |
Subject: |
[nongnu] externals/sly 0207e2d: Fix #385: Ensure that autodoc doesn't make stale continuations |
Date: |
Fri, 11 Dec 2020 16:05:22 -0500 (EST) |
branch: externals/sly
commit 0207e2d2fa138537dc973a986218af69ee7cd586
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix #385: Ensure that autodoc doesn't make stale continuations
After having learned that the eldoc-documentation-function runs within
while-no-input, it becomes clear that this is a hazard for anything
that calls sly-async. So we must be careful to re-enable inhibit-quit
in sly-autodoc.
Maybe we should even enable inhibit-quit in sly-dispatch-event, for
atomicity, but for now do the safest thing that fixes the bug.
* contrib/sly-autodoc.el (sly-autodoc): Set inhibit-quit to t.
* sly.el (sly-dispatch-event): Add comment.
---
contrib/sly-autodoc.el | 11 +++++++----
sly.el | 3 +++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/contrib/sly-autodoc.el b/contrib/sly-autodoc.el
index dadc533..02f3c45 100644
--- a/contrib/sly-autodoc.el
+++ b/contrib/sly-autodoc.el
@@ -116,10 +116,13 @@ If it's not in the cache, the cache will be updated
asynchronously."
(interactive "P")
(save-excursion
(save-match-data
- (let ((context
- (cons
- (sly-current-connection)
- (sly-autodoc--parse-context))))
+ ;; See github#385 and
+ ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45117
+ (let* ((inhibit-quit t)
+ (context
+ (cons
+ (sly-current-connection)
+ (sly-autodoc--parse-context))))
(when (car context)
(let* ((cached (and (equal context sly-autodoc--cache-last-context)
sly-autodoc--cache-last-autodoc))
diff --git a/sly.el b/sly.el
index ae88a8e..a765519 100644
--- a/sly.el
+++ b/sly.el
@@ -2541,6 +2541,9 @@ Debugged requests are ignored."
(when (and (sly-use-sigint-for-interrupt) (sly-busy-p))
(sly-display-oneliner "; pipelined request... %S" form))
(let ((id (cl-incf (sly-continuation-counter))))
+ ;; JT@2020-12-10: FIXME: Force inhibit-quit here to
+ ;; ensure atomicity between `sly-send' and the `push'?
+ ;; See Github#385..
(sly-send `(:emacs-rex ,form ,package ,thread ,id
,@extra-options))
(push (cons id continuation) (sly-rex-continuations))
(sly--refresh-mode-line)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] externals/sly 0207e2d: Fix #385: Ensure that autodoc doesn't make stale continuations,
Stefan Monnier <=