Bug 2524933 - emacs warns missing lexical-binding cookie in rpmdev-init.el
Summary: emacs warns missing lexical-binding cookie in rpmdev-init.el
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmdevtools
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2545603
TreeView+ depends on / blocked
 
Reported: 2026-08-27 11:36 UTC by Akira TAGOH
Modified: 2026-12-05 13:42 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
fedora-admin-xmlrpc: mirror+


Attachments (Terms of Use)

Description Akira TAGOH 2026-08-27 11:36:01 UTC
Emacs started to open a warning buffer at the startup time which contains:
⛔ Warning (files): Missing ‘lexical-binding’ cookie in "/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el".


Reproducible: Always

Steps to Reproduce:
1.run emacs -q with rpmdevtools installed
2.
3.
Actual Results:
warning buffer is shown

Expected Results:
no warning buffer

Comment 1 Peter Oliver 2026-09-16 17:48:15 UTC
There's a partial workaround in https://src.fedoraproject.org/rpms/rpmdevtools/pull-request/14, in that it allows one to uninstall rpmdev-init.el without uninstalling the rest of rpmdevtools.

Comment 2 Jun Go 2026-12-05 13:42:41 UTC
rpmdevtools: rpmdev-init.el lacks lexical-binding cookie, Emacs 30+ warns at every startup

Description of problem:
/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el has no
"lexical-binding" file-local variable cookie. Since Emacs 30, loading an
Elisp file without the cookie emits a warning, and because this file is
in site-start.d it is loaded on every Emacs startup, so every user who
has rpmdevtools installed sees:

  Warning (files): Missing 'lexical-binding' cookie in
  "/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el".

The file is part of the upstream rpmdevtools tarball, so this may need
forwarding to https://pagure.io/rpmdevtools.

Version-Release number of selected component:
rpmdevtools-9.6-15.fc45.noarch
emacs-common-31.1-8.fc45.aarch64

How reproducible:
Always

Steps to Reproduce:
1. dnf install emacs rpmdevtools
2. Start Emacs normally (not with -Q, which skips site-start)
3. Look at the *Warnings* buffer

Actual results:
A "Missing 'lexical-binding' cookie" warning for rpmdev-init.el is shown
at every startup.

Expected results:
No warning.

Additional info:
Adding a first line is enough:

  ;;; rpmdev-init.el --- rpmdevtools integration for rpm-spec-mode  -*- lexical-binding: t; -*-

Lexical binding changes no behavior here: the only let-binding
(`packager' in rpmdev-init-packager) is purely local, and the
rpmdev-packager-* variables are declared with defvar. With the cookie
added, Emacs 31.1 byte-compiles the file with only two warnings, both
present without the cookie too:

  Warning: reference to free variable 'rpm-spec-user-mail-address'
  Warning: reference to free variable 'rpm-spec-user-full-name'

Free variable references stay dynamic under lexical binding, so these
are harmless; adding
  (defvar rpm-spec-user-mail-address)
  (defvar rpm-spec-user-full-name)
near the top would silence them as well.


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