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

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

[elpa] externals/jinx 06d801f595 3/8: Simplify jinx--recheck-overlays


From: ELPA Syncer
Subject: [elpa] externals/jinx 06d801f595 3/8: Simplify jinx--recheck-overlays
Date: Wed, 29 Mar 2023 22:58:45 -0400 (EDT)

branch: externals/jinx
commit 06d801f5954f33c7e746f7a6dd1109dc4c6e3c2c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Simplify jinx--recheck-overlays
---
 jinx.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/jinx.el b/jinx.el
index 9fec165919..a9ed2fe773 100644
--- a/jinx.el
+++ b/jinx.el
@@ -571,12 +571,14 @@ If VISIBLE is non-nil, only include visible overlays."
 
 (defun jinx--recheck-overlays ()
   "Recheck all overlays in buffer after a dictionary update."
-  (save-restriction
-    (widen)
-    (dolist (ov (jinx--get-overlays (point-min) (point-max)))
-      (goto-char (overlay-end ov))
-      (when (jinx--word-valid-p (overlay-start ov))
-        (delete-overlay ov)))))
+  (save-excursion
+    (save-restriction
+      (widen)
+      (dolist (ov (overlays-in (point-min) (point-max)))
+        (when (eq (overlay-get ov 'category) 'jinx)
+          (goto-char (overlay-end ov))
+          (when (jinx--word-valid-p (overlay-start ov))
+            (delete-overlay ov)))))))
 
 (defun jinx--correct (overlay &optional recenter info)
   "Correct word at OVERLAY with optional RECENTER and prompt INFO."



reply via email to

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