|
From: | Nicolas Richard |
Subject: | bug#20139: 25.0.50; eval-buffer ignores lexical-binding |
Date: | Thu, 19 Mar 2015 10:56:37 +0100 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Jorgen Schäfer <contact@jorgenschaefer.de> writes: > . I.e. the following snippet will message (lambda nil t) and > then (closure (t) nil t): > > (with-temp-buffer > (setq lexical-binding t) > (insert "(message \"%S\" (lambda () t))") > (eval-buffer) > (eval-region (point-min) (point-max))) And this will reverse the behaviour : (with-temp-buffer (insert ";; -*- lexical-binding: t; -*-\n(message \"%S\" (lambda () t))") (eval-buffer) (eval-region (point-min) (point-max))) IOW eval-buffer obeys the "file"-local variable by calling specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil); while eval-region simply uses the current value of lexical-binding. -- Nicolas
[Prev in Thread] | Current Thread | [Next in Thread] |