The first line of a .el file used to be
;;; foo.el - a foo package
Does it works if the magic comment is added after this?
;;; foo.el - a foo package
;;; -*- lexical-binding: t -*-
Or even later in the file?
(elisp) Using Lexical Binding
(emacs) Specifying File Variables
This must be in the first line. An exception is made for shell scripts (only), where it may alternatively be on the second line.
Note that, unlike other file-local vars, lexical-binding
can only appear in this first-line listing.