bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47843: 28.0.50; Setting enable-local-variables to nil *appears* to i


From: Lars Ingebrigtsen
Subject: bug#47843: 28.0.50; Setting enable-local-variables to nil *appears* to inhibit lexical-binding (but doesn't)
Date: Tue, 04 May 2021 12:22:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Phil Sainty <psainty@orcon.net.nz> writes:

> With enable-local-variables set to nil, when editing an elisp buffer
> using lexical-binding it can *seem* as though lexical-binding is not
> enabled, as -*- lexical-binding: t -*- is being inhibited along with
> any others.
>
> Experimentally, Emacs appears to do the right thing, still evaluating
> the code using lexical-binding.  I tested loading compiled and
> uncompiled code, as well as `eval-buffer', and all of those seemed
> to work correctly.

enable-local-variables doesn't affect byte-compiling or loading the
file -- only the current buffer settings.

So I tried visiting this file, with enable-local-variables set to nil:

;; -*- lexical-binding: t; -*-

(defun foo ()
  (let ((a 1))
    (lambda ()
      (message "%s" a))))

(funcall (foo))

And `C-M-x' on the two forms failed, as expected.  (When enabling the
variable, they are successful.)

So I think everything works as expected here?  That is, the buffer
doesn't use lexical mode if you set enable-local-variables to nil.

Are you seeing something different?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]