aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-01-13 14:53:11 +0100
committerMattias EngdegÄrd2020-01-13 18:03:41 +0100
commitd645628e3cf6ebe5eaea3b40100bd77b9c823f8b (patch)
tree6c8ce3cab0e654100329275709ca58b553d7c1bf
parentc42198f78cbf7a75be67187a5de02e353a0918e8 (diff)
downloademacs-d645628e3cf6ebe5eaea3b40100bd77b9c823f8b.tar.gz
emacs-d645628e3cf6ebe5eaea3b40100bd77b9c823f8b.zip
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.
-rw-r--r--doc/lispref/variables.texi3
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/progmodes/elisp-mode.el3
-rw-r--r--lisp/startup.el4
4 files changed, 8 insertions, 5 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 1ec97e2f3de..1e357754abe 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1187,6 +1187,9 @@ When evaluating Emacs Lisp code directly using an @code{eval} call,
1187lexical binding is enabled if the @var{lexical} argument to 1187lexical binding is enabled if the @var{lexical} argument to
1188@code{eval} is non-@code{nil}. @xref{Eval}. 1188@code{eval} is non-@code{nil}. @xref{Eval}.
1189 1189
1190Lexical binding is also enabled in Lisp Interaction and IELM
1191mode, used in the @file{*scratch*} and @file{*ielm*} buffers.
1192
1190@cindex special variables 1193@cindex special variables
1191 Even when lexical binding is enabled, certain variables will 1194 Even when lexical binding is enabled, certain variables will
1192continue to be dynamically bound. These are called @dfn{special 1195continue to be dynamically bound. These are called @dfn{special
diff --git a/etc/NEWS b/etc/NEWS
index 61b9e4a7237..031ddf58005 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -338,7 +338,8 @@ answers, but also function keys like 'F1', character events such as
338 338
339** Lexical binding is now used when evaluating interactive Elisp forms. 339** Lexical binding is now used when evaluating interactive Elisp forms.
340More specifically, lexical-binding is now used for 'M-:', '--eval', as 340More specifically, lexical-binding is now used for 'M-:', '--eval', as
341well as in the "*scratch*" and "*ielm*" buffers. 341well as in lisp-interaction-mode and ielm-mode, used in the "*scratch*"
342and "*ielm*" buffers.
342 343
343--- 344---
344** The new user option 'tooltip-resize-echo-area' avoids truncating 345** The new user option 'tooltip-resize-echo-area' avoids truncating
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 774e3324c2e..2617a6e4cce 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -933,7 +933,8 @@ Paragraphs are separated only by blank lines.
933Semicolons start comments. 933Semicolons start comments.
934 934
935\\{lisp-interaction-mode-map}" 935\\{lisp-interaction-mode-map}"
936 :abbrev-table nil) 936 :abbrev-table nil
937 (setq-local lexical-binding t))
937 938
938;;; Emacs Lisp Byte-Code mode 939;;; Emacs Lisp Byte-Code mode
939 940
diff --git a/lisp/startup.el b/lisp/startup.el
index c27af726f9c..2a85c004da1 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1435,8 +1435,7 @@ please check its value")
1435 (if (get-buffer "*scratch*") 1435 (if (get-buffer "*scratch*")
1436 (with-current-buffer "*scratch*" 1436 (with-current-buffer "*scratch*"
1437 (if (eq major-mode 'fundamental-mode) 1437 (if (eq major-mode 'fundamental-mode)
1438 (funcall initial-major-mode)) 1438 (funcall initial-major-mode))))
1439 (setq-local lexical-binding t)))
1440 1439
1441 ;; Load library for our terminal type. 1440 ;; Load library for our terminal type.
1442 ;; User init file can set term-file-prefix to nil to prevent this. 1441 ;; 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."
2317 (or (get-buffer "*scratch*") 2316 (or (get-buffer "*scratch*")
2318 (with-current-buffer (get-buffer-create "*scratch*") 2317 (with-current-buffer (get-buffer-create "*scratch*")
2319 (set-buffer-major-mode (current-buffer)) 2318 (set-buffer-major-mode (current-buffer))
2320 (setq-local lexical-binding t)
2321 (current-buffer)))) 2319 (current-buffer))))
2322 2320
2323(defun command-line-1 (args-left) 2321(defun command-line-1 (args-left)