From 6a9c353d99482bf87d6f9296cfe341311465c290 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Apr 2025 22:48:01 -0400 Subject: [PATCH] lisp/files.el (internal--get-default-lexical-binding): Handle nested loads (cherry picked from commit 9dc6177206a10efcc3a25894aa7aabaa54044adc) --- lisp/files.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index 7228f28e726..cc87651eea8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4290,7 +4290,9 @@ You can add one with `M-x elisp-enable-lexical-binding RET'. See `%s' and `%s' for more information." (if (not (and (bufferp from) - (equal (buffer-name from) " *load*") + (string-match-p + "\\` \\*load\\*\\(-[0-9]+\\)?\\'" + (buffer-name from)) load-file-name)) from (abbreviate-file-name load-file-name)) -- 2.39.5