unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Stefan Kangas <stefan@marxist.se>
Cc: emacs-devel@gnu.org
Subject: RE: Recommend lexical-binding in Coding Conventions
Date: Wed, 21 Oct 2020 07:52:10 -0700 (PDT)	[thread overview]
Message-ID: <c6e5a620-7dcc-4f9f-81d2-06eed23f2747@default> (raw)
In-Reply-To: <jwv5z73aeuj.fsf-monnier+emacs@gnu.org>

> 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	other threads:[~2020-10-21 14:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  1:05 Recommend lexical-binding in Coding Conventions Stefan Kangas
2020-10-21  4:32 ` Drew Adams
2020-10-21 13:33 ` Stefan Monnier
2020-10-21 14:52   ` Drew Adams [this message]
2020-10-21 15:14     ` Stefan Kangas
2020-10-21 15:30       ` Alan Mackenzie
2020-10-21 16:07         ` Robert Pluim
2020-10-21 16:19         ` Stefan Kangas
2020-10-21 16:38       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6e5a620-7dcc-4f9f-81d2-06eed23f2747@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).