Bug 2545603

Summary: numerous emacs lisp modules complaining about missing lexical binding cookies
Product: [Fedora] Fedora Reporter: Stephen Degler <stephen>
Component: emacsAssignee: Daiki Ueno <dueno>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 45CC: benson_muite, dan.cermak, dueno, gordon.messmer, marcandre.lureau, mavit, michal.jnn, msekleta, phracek
Target Milestone: ---Keywords: EasyFix, FastFix
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2524933, 2535610, 2535611, 2535612, 2567364, 2591262, 2591265, 2591267, 2591275, 2528349, 2528383, 2545728, 2545918, 2545926, 2576585, 2577807    
Bug Blocks:    

Description Stephen Degler 2026-10-04 02:28:55 UTC
Here is a sample of these errors:
■  Warning (files): Missing ‘lexical-binding’ cookie in "/usr/share/emacs/site-lisp/site-start.d/cmake-init.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.
 ■  Warning (files): Missing ‘lexical-binding’ cookie in "/usr/share/emacs/site-lisp/site-start.d/mercurial-site-start.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.
 ■  Warning (files): Missing ‘lexical-binding’ cookie in "/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.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.
 ■  Warning (files): Missing ‘lexical-binding’ cookie in "/usr/share/emacs/site-lisp/site-start.d/systemtap-init.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.


I get these errors at startup.


Reproducible: Always

Steps to Reproduce:
1. start emacs.
2. Observe warnings in the *Warnings* buffer.

Actual Results:
emacs spews diagnostics on startup for files the user doesn't have the privileges to fix.


Expected Results:
emacs starts up cleanly


Additional Information:
elisp-enable-lexical-binding in the appropriate buffer fixes the error.  I did not observe it introduce any errors in the files I modified this way.

Comment 1 Peter Oliver 2026-10-05 10:00:15 UTC
This new warning is a deliberate change in Emacs 31 (https://www.gnu.org/software/emacs/news/NEWS.31.html#text-2-8-10).  The files you list are provided by other packages, and are for them to fix.

Please find the packages by running `rpm -qif` on the files, and log bugs against those packages.  Feel free to mark those bugs as blocking this one, and we can keep this bug open as a tracking bug.  Thanks.

Comment 2 Peter Oliver 2026-12-04 14:18:34 UTC
An alternative approach to adding the lexical-binding cookie to affected files is to eliminate the affected files entirely, where appropriate.

In Fedora 46 (rawhide at the time of writing), https://fedoraproject.org/wiki/Changes/Emacs_Package_Packaging offers a way of doing this suitable for some packages, via the new %{_emacs_package_install} macro.  See case A in https://docs.fedoraproject.org/en-US/packaging-guidelines/Emacs/ for more details.

Comment 3 Michal Jaegermann 2026-12-04 22:25:18 UTC
It looks to me that at least those 2524933 2535612 2591262 2591265 2591267 2591275 should appear on the "Depends On" list but I do not know how to do that.