[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/jit-spell 709ea3b952 2/4: Drop pending requests when un
From: |
ELPA Syncer |
Subject: |
[elpa] externals/jit-spell 709ea3b952 2/4: Drop pending requests when unfontifying |
Date: |
Sun, 12 Mar 2023 06:58:36 -0400 (EDT) |
branch: externals/jit-spell
commit 709ea3b952315878e1a21613173fefd5c80d88f3
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Drop pending requests when unfontifying
---
jit-spell.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/jit-spell.el b/jit-spell.el
index a52508cf17..a799ab1a6e 100644
--- a/jit-spell.el
+++ b/jit-spell.el
@@ -262,6 +262,14 @@ It can also be bound to a mouse click to pop up the menu."
(defun jit-spell--unfontify (&optional start end lax)
"Remove overlays and forget checking status from START to END (or whole
buffer).
Force refontification of the region, unless LAX is non-nil."
+ ;; Drop pending requests for this buffer
+ (dolist (proc (seq-filter #'processp jit-spell--process-pool))
+ (setf (process-get proc 'jit-spell--requests)
+ (seq-filter (lambda (r) (not (eq (car r) (current-buffer))))
+ (process-get proc 'jit-spell--requests)))
+ (while (eq (car (process-get proc 'jit-spell--current-request))
+ (current-buffer))
+ (accept-process-output proc)))
(without-restriction
(setq start (or start (point-min)))
(setq end (or end (point-max)))