Subject: bug#77918: 31.0.50; Warnings about missing 'lexical-binding' cookie in *Async-native-compile-log*

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 Apr 2025 14:45:56 +0300

> From: Roi Martin <[email-masked]>
> Date: Sat, 19 Apr 2025 10:41:35 +0200
> 
> 
> Several warnings about missing 'lexical-binding' cookie show up in
> *Async-native-compile-log*.  They seem to show up when a feature that
> has not been compiled yet is used and needs to be compiled.  The issue
> is reproducible by just running 'emacs -Q'.  You can find some of the
> warnings below.
> 
>   Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-async-comp-dired-aux-xXuqdt.el".
>   You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>   See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>   for more information.
>   Compiling /home/n/src/emacs/lisp/dired-aux.el...
>   Compilation finished.
>   Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-async-comp-shell-rZsYYK.el".
>   You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>   See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>   for more information.
>   Compiling /home/n/src/emacs/lisp/shell.el...
>   Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-async-comp-pcomplete-lO4nJm.el".
>   You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>   See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>   for more information.
>   Compiling /home/n/src/emacs/lisp/pcomplete.el...
>   Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-async-comp-files-x-oLXnPa.el".
>   You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>   See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>   for more information.
>   Compiling /home/n/src/emacs/lisp/files-x.el...
>   Compilation finished.
>   Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-async-comp-rfc2047-XugClb.el".
>   You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>   See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>   for more information.
>   Compiling /home/n/src/emacs/lisp/mail/rfc2047.el...
>   Compilation finished.
> 
> What follows is one of the .el files that produced the warning
> (emacs-async-comp-icomplete-tWY9i1.el).  Note that I elided the
> native-comp-eln-load-path and load-path values to shorten the report.
> 
>   (require 'comp)(setq comp-async-compilation t warning-fill-column most-positive-fixnum)(setq comp-file-preloaded-p 'nil native-comp-verbose '0 native-comp-eln-load-path '(...) load-path '(...) byte-compile-warnings 't)nil(message "Compiling %s..." "/home/n/src/emacs/lisp/icomplete.el")(comp--native-compile "/home/n/src/emacs/lisp/icomplete.el" t)

Andrea, what would you suggest as the solution for these warnings?

(This was already reported as part of the discussion on emacs-devel,
but we never finalized the solution for this aspect.)