From: Mattias EngdegÄrd Date: Thu, 11 Apr 2024 11:55:39 +0000 (+0200) Subject: Don't hide flymake diagnostics on empty first line (bug#70310) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e02935dcbbe630f92fdf4138e6c6d2421e9391a4;p=emacs.git Don't hide flymake diagnostics on empty first line (bug#70310) 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) --- diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index c99c34c9c0f..680dd331fbf 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -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)))))))