unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64272: 28.1; lisp_file_lexically_bound_p behavior mismatches file local variables
@ 2023-06-24 18:22 LdBeth
  2023-06-24 18:52 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: LdBeth @ 2023-06-24 18:22 UTC (permalink / raw)
  To: 64272


Basically, if an emacs lisp source file starts with some whitespace

| ;; -*- lexical-binding: t -*-
|(let ((x 1)) (setq foo (lambda () x)))
|(funcall foo)

rather than

|;; -*- lexical-binding: t -*-
|(let ((x 1)) (setq foo (lambda () x)))
|(funcall foo)

that will cause `load' eval the file with `lexical-binding' set to nil,
and would report `x' is a void variable.

This behavior is in contrast to how file local variables are applied
when opening a file, that is, as long as the variable list is in
the first line, it is applied.

Either the documentation should bring up this behavior, or the
C function `lisp_file_lexically_bound_p' in `src/lread.c' should be fixed.



-- 
ldb






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

end of thread, other threads:[~2023-11-21 13:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-24 18:22 bug#64272: 28.1; lisp_file_lexically_bound_p behavior mismatches file local variables LdBeth
2023-06-24 18:52 ` Eli Zaretskii
2023-06-24 19:08   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25  2:11   ` LdBeth
2023-06-25  6:08     ` Eli Zaretskii
2023-06-25 13:37       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 15:02         ` Eli Zaretskii
2023-06-25 15:42           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 17:17           ` LdBeth
2023-06-25 18:16             ` Eli Zaretskii
2023-06-25 23:00               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26  0:53                 ` LdBeth
2023-06-26 11:13                   ` Eli Zaretskii
2023-06-26 15:18                     ` Gregory Heytings
2023-06-26 15:23                       ` Eli Zaretskii
2023-11-21 13:12                       ` Gerd Möllmann
2023-06-26 10:59                 ` Eli Zaretskii
2023-06-25 23:16               ` LdBeth
2023-06-26  0:45                 ` LdBeth

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).