From: João Távora Date: Thu, 21 Sep 2023 13:02:59 +0000 (+0100) Subject: Flymake: fix bug in end-of-line overlay updates X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=57c6c067d35e519bc3787966cd6346904bc75e16;p=emacs.git Flymake: fix bug in end-of-line overlay updates * lisp/progmodes/flymake.el (flymake--update-eol-overlays): Rename from flymake--eol-overlay-update and fix. (flymake--handle-report): Call flymake--update-eol-overlays. --- diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 1b232050855..ffe95cce6ca 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -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)