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: Tue, 20 Oct 2020 21:32:03 -0700 (PDT)

> I would suggest to add it, and have attached a first draft for what it
> could look like.  Thoughts?

Mine:

tl;dr: Just recommend setting var `lexical-binding' to non-nil.
___

1. The recommendation to set variable `lexical-binding'
to non-nil is good.

2. The recommendation to "convert existing Emacs Lisp
code to use lexical binding" is unclear or ambiguous.

Setting the variable to non-nil just makes lexical
binding the default (e.g. for a file), which is what
we should encourage.

#2 can easily be misinterpreted to mean that code
should not use dynamic binding, which would be
misguided, IMO.

There's a reason that Common Lisp and Emacs Lisp have
both kinds of binding.  Both are useful for Lisp, and
dynamic binding has particular usefulness for Emacs
users.

I see no reason for adding #2.  It doesn't mean
anything good, clear, or important, IMO.  #1 suffices,
and is the message to send, I think.

On the other hand, if what you meant by #2 was just
an elaboration of #1, i.e., convert existing code to
work with `lexical-binding' non-nil, then that's OK.

But it's not necessary, as it follows from #1: if you
set `lexical-binding' to non-nil in existing code then
you'll find out what changes you might need to make,
to get it to continue to work well.



reply via email to

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