Commit d645628e authored by Mattias Engdegård's avatar Mattias Engdegård

Always use lexical-binding in lisp-interaction-mode (bug#38835)

* lisp/progmodes/elisp-mode.el (lisp-interaction-mode):
Set lexical-binding.
* lisp/startup.el (command-line, startup--get-buffer-create-scratch):
Don't set lexical-binding here.
* doc/lispref/variables.texi:
* etc/NEWS:
Make it clear that lisp-interaction-mode uses lexical-binding.
parent c42198f7
Pipeline #4545 passed with stage
in 54 minutes and 20 seconds
......@@ -1187,6 +1187,9 @@ When evaluating Emacs Lisp code directly using an @code{eval} call,
lexical binding is enabled if the @var{lexical} argument to
@code{eval} is non-@code{nil}. @xref{Eval}.
Lexical binding is also enabled in Lisp Interaction and IELM
mode, used in the @file{*scratch*} and @file{*ielm*} buffers.
@cindex special variables
Even when lexical binding is enabled, certain variables will
continue to be dynamically bound. These are called @dfn{special
......@@ -338,7 +338,8 @@ answers, but also function keys like 'F1', character events such as
** Lexical binding is now used when evaluating interactive Elisp forms.
More specifically, lexical-binding is now used for 'M-:', '--eval', as
well as in the "*scratch*" and "*ielm*" buffers.
well as in lisp-interaction-mode and ielm-mode, used in the "*scratch*"
and "*ielm*" buffers.
** The new user option 'tooltip-resize-echo-area' avoids truncating
......@@ -933,7 +933,8 @@ Paragraphs are separated only by blank lines.
Semicolons start comments.
:abbrev-table nil)
:abbrev-table nil
(setq-local lexical-binding t))
;;; Emacs Lisp Byte-Code mode
......@@ -1435,8 +1435,7 @@ please check its value")
(if (get-buffer "*scratch*")
(with-current-buffer "*scratch*"
(if (eq major-mode 'fundamental-mode)
(funcall initial-major-mode))
(setq-local lexical-binding t)))
(funcall initial-major-mode))))
;; Load library for our terminal type.
;; User init file can set term-file-prefix to nil to prevent this.
......@@ -2317,7 +2316,6 @@ A fancy display is used on graphic displays, normal otherwise."
(or (get-buffer "*scratch*")
(with-current-buffer (get-buffer-create "*scratch*")
(set-buffer-major-mode (current-buffer))
(setq-local lexical-binding t)
(defun command-line-1 (args-left)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment