]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't hide flymake diagnostics on empty first line (bug#70310)
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 11 Apr 2024 11:55:39 +0000 (13:55 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Apr 2024 16:58:07 +0000 (18:58 +0200)
A diagnostic first in the buffer, typically the lexical cookie warning,
got lost if that line was empty.

* lisp/progmodes/elisp-mode.el (elisp-flymake--byte-compile-done):
Make sure the location interval doesn't go beyond the buffer bounds.

(cherry picked from commit b436f430e3897e1aa6dcb5a39564a3553bbf631f)

lisp/progmodes/elisp-mode.el

index c99c34c9c0ffce0c1726cf41969d2d6d517a30ea..680dd331fbf6227f711fc8de99f7af4c8260b577 100644 (file)
@@ -2150,8 +2150,13 @@ Calls REPORT-FN directly."
                                  (point-max)))
                   collect (flymake-make-diagnostic
                            (current-buffer)
-                           (if (= beg end) (1- beg) beg)
-                           end
+                           (if (= beg end)
+                               (max (1- beg) (point-min))
+                             beg)
+                           (if (= beg end)
+                               (min (max beg (1+ (point-min)))
+                                    (point-max))
+                             end)
                            level
                            string)))))))