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
** 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
Semicolons start comments.
\\{lisp-interaction-mode-map}"
- :abbrev-table nil)
+ :abbrev-table nil
+ (setq-local lexical-binding t))
;;; Emacs Lisp Byte-Code mode
(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.
(or (get-buffer "*scratch*")
(with-current-buffer (get-buffer-create "*scratch*")
(set-buffer-major-mode (current-buffer))
- (setq-local lexical-binding t)
(current-buffer))))
(defun command-line-1 (args-left)