Bug 2524933

Summary: emacs warns missing lexical-binding cookie in rpmdev-init.el
Product: [Fedora] Fedora Reporter: Akira TAGOH <tagoh>
Component: rpmdevtoolsAssignee: Neal Gompa <ngompa13>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: bugs.michael, decathorpe, gojun077, kevin, mattias.ellert, mavit, ngompa13, stephen, twoerner
Target Milestone: ---Flags: fedora-admin-xmlrpc: mirror+
Target Release: ---   
Hardware: Unspecified   
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:    
Bug Blocks: 2545603    

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.