branch: elpa/adoc-mode
commit 0a678e9c75f1e51e556bf50df9a6892d99954ae6
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Replace cl-loop being the overlays with overlays-in
The cl-loop "being the overlays" clause can generate spurious
byte-compiler warnings (same class of issue as "being the
intervals" which broke CI on Emacs 28). Use overlays-in with
dolist/seq-find instead.
---
adoc-mode.el | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/adoc-mode.el b/adoc-mode.el
index d263def232..57c343f293 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -2179,9 +2179,9 @@ Use this function as matching function MATCHER in
`font-lock-keywords'."
(defun adoc-unfontify-region-function (beg end)
(font-lock-default-unfontify-region beg end)
- (cl-loop for ol being the overlays from beg to end
- when (overlay-get ol 'adoc-kw-replacement)
- do (delete-overlay ol))
+ (dolist (ol (overlays-in beg end))
+ (when (overlay-get ol 'adoc-kw-replacement)
+ (delete-overlay ol)))
;; text properties. Currently only display raise used for sub/superscripts.
;; code snipped copied from tex-mode
@@ -3194,9 +3194,8 @@ or an event. It defaults to \\(point)."
(defun adoc-image-overlay-at (location)
"Get image overlay at LOCATION."
(adoc-with-point-at-event location
- (cl-loop for ov being the overlays from (1- location) to (1+ location)
- when (overlay-get ov 'adoc-image)
- return ov)))
+ (seq-find (lambda (ov) (overlay-get ov 'adoc-image))
+ (overlays-in (1- location) (1+ location)))))
(defun adoc-remove-image-overlay-at (&optional location flush)
"Delete overlay at LOCATION.