all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70310: flymake in elisp buffer elides warning on a blank first line
@ 2024-04-09 13:45 Mattias Engdegård
  2024-04-09 20:10 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Mattias Engdegård @ 2024-04-09 13:45 UTC (permalink / raw)
  To: 70310; +Cc: João Távora

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.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#70310: flymake in elisp buffer elides warning on a blank first line
  2024-04-09 13:45 bug#70310: flymake in elisp buffer elides warning on a blank first line Mattias Engdegård
@ 2024-04-09 20:10 ` Dmitry Gutov
  2024-04-11 12:04   ` Mattias Engdegård
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2024-04-09 20:10 UTC (permalink / raw)
  To: Mattias Engdegård, 70310; +Cc: Spencer Baugh, João Távora

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







^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#70310: flymake in elisp buffer elides warning on a blank first line
  2024-04-09 20:10 ` Dmitry Gutov
@ 2024-04-11 12:04   ` Mattias Engdegård
  0 siblings, 0 replies; 3+ messages in thread
From: Mattias Engdegård @ 2024-04-11 12:04 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 70310-done, Spencer Baugh, João Távora

9 apr. 2024 kl. 22.10 skrev Dmitry Gutov <dmitry@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.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-11 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 13:45 bug#70310: flymake in elisp buffer elides warning on a blank first line Mattias Engdegård
2024-04-09 20:10 ` Dmitry Gutov
2024-04-11 12:04   ` Mattias Engdegård

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.