bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70310: flymake in elisp buffer elides warning on a blank first line


From: Dmitry Gutov
Subject: bug#70310: flymake in elisp buffer elides warning on a blank first line
Date: Tue, 9 Apr 2024 23:10:22 +0300
User-agent: Mozilla Thunderbird

On 09/04/2024 16:45, Mattias Engdegård wrote:
On Emacs master:

1. Open an Elisp file.
2. Enable flymake.
3. Insert a blank line at the top.

This should result in a warning about a missing 'lexical-binding' cookie but 
none is shown.
Making the first line non-empty, even a single space, makes the warning appear.

Some brief experiment shows that these lines are relevant, though I'm not sure why, given that the byte-compiler's output is the same, whether the first line is empty or not:

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 9b4c3f994cd..bc03130827c 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -2151,8 +2151,8 @@ elisp-flymake--byte-compile-done
                                  (point-max)))
                   collect (flymake-make-diagnostic
                            (current-buffer)
-                           (if (= beg end) (1- beg) beg)
-                           end
+                           beg
+                           (if (= beg end) (1+ end) end)
                            level
                            string)))))))







reply via email to

[Prev in Thread] Current Thread [Next in Thread]