]> git.eshelyaron.com Git - emacs.git/commitdiff
Flymake: fix bug in end-of-line overlay updates
authorJoão Távora <joaotavora@gmail.com>
Thu, 21 Sep 2023 13:02:59 +0000 (14:02 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 21 Sep 2023 13:03:13 +0000 (14:03 +0100)
* lisp/progmodes/flymake.el (flymake--update-eol-overlays): Rename
from flymake--eol-overlay-update and fix.
(flymake--handle-report): Call flymake--update-eol-overlays.

lisp/progmodes/flymake.el

index 1b232050855e3bfdefb801b4a423015d91e3b1d0..ffe95cce6ca195398f3acb7aaeaf08931553fd52 100644 (file)
@@ -717,14 +717,14 @@ associated `flymake-category' return DEFAULT."
    (put-text-property 0 1 'cursor t retval)
    (cl-return retval)))
 
-(defun flymake--eol-overlay-update ()
+(defun flymake--update-eol-overlays ()
   (save-excursion
     (widen)
-    (cl-loop for o in (overlays-in (point-min) (point-max))
-             for src-ovs = (overlay-get o 'flymake-eol-source-overlays)
-             if src-ovs
-             do (overlay-put o 'before-string (flymake--eol-overlay-summary src-ovs))
-             else do (delete-overlay o))))
+    (dolist (o (overlays-in (point-min) (point-max)))
+      (when (overlay-get o 'flymake--eol-overlay)
+        (if-let ((src-ovs (overlay-get o 'flymake-eol-source-overlays)))
+            (overlay-put o 'before-string (flymake--eol-overlay-summary src-ovs))
+          (delete-overlay o))))))
 
 (cl-defun flymake--highlight-line (diagnostic &optional foreign)
   "Attempt to overlay DIAGNOSTIC in current buffer.
@@ -974,7 +974,7 @@ report applies to that region."
     (when (and flymake-show-diagnostics-at-end-of-line
                (not (cl-set-difference (flymake-running-backends)
                                        (flymake-reporting-backends))))
-      (flymake--eol-overlay-update))
+      (flymake--update-eol-overlays))
     (flymake--update-diagnostics-listings (current-buffer))))
 
 (defun flymake--clear-foreign-diags (state)