Subject: bug#44854: [PATCH] Add lexical-binding cookie to autoload files

From: Eli Zaretskii <[email-masked]>
Date: Thu, 26 Nov 2020 16:02:24 +0200

> From: Stefan Kangas <[email-masked]>
> Date: Wed, 25 Nov 2020 16:07:19 -0500
> Cc: [email-masked]
> 
> >> I was not discussing specifically `loaddefs.el`.
> >> The reason to change it in `loaddefs.el` now rather than later is
> >> because I can't see any benefit to doing it later.
> >
> > That's not a reason good enough in my book, sorry.
> 
> FWIW, I have been working towards this crude metric:
> 
>   find -iname "*.el" -exec egrep -L "lexical-binding: *t" {} \; | wc -l
> 
> This gives some indicator for how ready we are to "flip the switch".  An
> even better metric would of course be possible, for example by counting
> SLOC or making it ignore files with side-effect free statements.  But it
> hasn't seemed worth the trouble.
> 
> Also, the above metric can easily be converted to a TODO-list:
> 
>   find -iname "*.el" -exec egrep -L "lexical-binding: *t" {} \; | sort
> 
> This is how I've been using it.  I've been looking to make the number of
> files go down by adding the cookie to even insignificant files, as they
> stand in the way of seeing the files that actually need work.[1]
> 
> May I ask why you are against it?  If we agree that it should make no
> difference one way or the other, why not just do it?

I have nothing against converting Lisp files to lexical-binding, and
have never objected to any of your recent changes in that direction.
But this makes sense only in files which be affected by that, and
autoloads files aren't.  "Converting" them to lexical-binding, and
modifying the code which produces those files on top of that, sounds
like we are afraid of our own shadows, or don't know what
lexical-binding is about (or both).

My point is that when the time comes to "flip the switch", we can do
that without having lexical-binding in autoloads files.  They cannot
be affected by the switch.  If they are, it's probably some subtle bug
somewhere.