[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Declaring 'lexical-binding: nil' obsolete
From: |
Stefan Kangas |
Subject: |
Re: Declaring 'lexical-binding: nil' obsolete |
Date: |
Sat, 25 Sep 2021 17:50:52 -0700 |
Po Lu <luangruo@yahoo.com> writes:
> Stefan Kangas <stefan@marxist.se> writes:
>
>> The roadmap I propose will give you a decade or so to adjust, and even
>> then will you only need to change one line per ELisp file for it to work
>> just as it does today.
>>
>> Before then, the worst that will happen is that you will see a warning.
>
> Yes, but is there any compelling reason other than "it's obsolete" to
> make this change?
Is there any compelling reason not to?
Of course we have plenty of compelling reasons, but the main one is that
we currently have two dialects of Emacs Lisp, where it would be better
and less confusing to have one.
> If it's to prevent new Emacs Lisp authors from inadvertently writing
> dynamically-bound code, I suggest to rewrite (eintr)Prevent confusion
> and other places in the documentation aimed at new users that seem to
> encourage them to write dynamically-bound code. I'm sure that a large
> part of the dynamically bound code present today stems from users not
> knowing better; instead of a blanket obsoletion, better and more
> immediate solutions can be found, such as updating the Introduction to
> Programming in Emacs Lisp to not refer users to dynamic binding.
I'm sure that we will review those parts of the documentation in due
time. But the "blanket" (not sure why you add this word) obsoletion is
precisely about discouraging the use of the 'lexical-binding:nil'
dialect of Emacs Lisp.
If you read my proposal carefully, I hope it is clear that this
obsoletion mostly just entails our strong recommendation. Support for
'lexical-binding:nil' will need to be there for the foreseeable future.
I do not include removing this feature in the plan I propose, and this
is not by accident.
> Perhaps a notice in Emacs Lisp mode when creating new dynamically bound
> files would also be prudent. (For instance: "This file is being
> dynamically bound. If you don't intend for it to be this way, please
> read (elisp)Lexical Binding")
(Note that we already have a warning in the mode-line.)
Re: Declaring 'lexical-binding: nil' obsolete, Eduardo Ochs, 2021/09/25
Re: Declaring 'lexical-binding: nil' obsolete, Eli Zaretskii, 2021/09/26