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>

To reply to this bug, email your comments to 70310 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#70310; Package emacs. (Tue, 09 Apr 2024 13:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Apr 2024 13:47:02 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Emacs Bug Report <bug-gnu-emacs <at> gnu.org>
Cc: João Távora <joaotavora <at> gmail.com>
Subject: flymake in elisp buffer elides warning on a blank first line
Date: Tue, 9 Apr 2024 15:45:50 +0200
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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70310; Package emacs. (Tue, 09 Apr 2024 20:11:01 GMT) Full text and rfc822 format available.

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)))))))






Reply sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
You have taken responsibility. (Thu, 11 Apr 2024 12:05:02 GMT) Full text and rfc822 format available.

Notification sent to Mattias Engdegård <mattias.engdegard <at> gmail.com>:
bug acknowledged by developer. (Thu, 11 Apr 2024 12:05:03 GMT) Full text and rfc822 format available.

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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 70310-done <at> debbugs.gnu.org, 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: Thu, 11 Apr 2024 14:04:21 +0200
9 apr. 2024 kl. 22.10 skrev Dmitry Gutov <dmitry <at> gutov.dev>:

> 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:

Yes, I got as far as you did and wondered where this information ends up and if we need to do something there.
Then I stopped overthinking it and just bolted on some clamps (b436f430e38).
Seems to work, so I'm closing the bug.





This bug report was last modified 23 days ago.

Previous Next


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