emacs-devel
[Top][All Lists]
Advanced

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

RE: Recommend lexical-binding in Coding Conventions


From: Drew Adams
Subject: RE: Recommend lexical-binding in Coding Conventions
Date: Wed, 21 Oct 2020 07:52:10 -0700 (PDT)

> There's a minor risk of confusion where this could be taken to mean that
> we recommend code should be rewritten not to use any dynamically scoped
> variables at all.
> 
> I'm not sure what would be the best wording to avoid this confusion.  Maybe:
> 
>     @item
>     We recommended to enable @code{lexical-binding} in all new code, and
>     to convert existing Emacs Lisp code to enable @code{lexical-binding}
>     if it doesn't already.  @xref{Using Lexical Binding}.

I think the risk is more than minor, and there is already
a fair amount of confusion out there about this.

My suggestion is to speak only in terms of the variable,
`lexical-binding'.  Recommending that people set it to
non-nil is, I think, exactly what we want.  If they do
that then everything is as desired.

That doesn't say anything about using lexical or dynamic
binding.  And it automatically entails making code that
uses non-nil DTRT: if you set it to non-nil then you
need to make whatever changes are needed for that.



reply via email to

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