Bug 2545603 - numerous emacs lisp modules complaining about missing lexical binding cookies
Summary: numerous emacs lisp modules complaining about missing lexical binding cookies
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: 45
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Daiki Ueno
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2524933 2535610 2535611 2535612 2567364 2591262 2591265 2591267 2591275 2528349 2528383 2545728 2545918 2545926 2576585 2577807
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-10-04 02:28 UTC by Stephen Degler
Modified: 2026-12-05 21:40 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.