GNU bug report logs - #70310
flymake in elisp buffer elides warning on a blank first line

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Tue, 9 Apr 2024 13:47:02 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 70310 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>,
 70310 <at> debbugs.gnu.org
Cc: Spencer Baugh <sbaugh <at> janestreet.com>,
 João Távora <joaotavora <at> gmail.com>
Subject: Re: bug#70310: flymake in elisp buffer elides warning on a blank
 first line
Date: Tue, 9 Apr 2024 23:10:22 +0300
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)))))))






This bug report was last modified 1 year and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.