Skip to content

Conversation

@fnussbaum
Copy link
Collaborator

Addresses #16959.

For most files lexical-binding: t should also work without changes. But for each file, someone would need examine it and check whether dynamic binding is relied on somewhere. Hence I went with the current default of lexical-binding: nil for most files for now to pacify the warnings in Emacs 31.

For most files lexical-binding: t should also work without changes. But for each
file, someone would need examine it and check whether dynamic binding is relied
on somewhere. Hence I went with the current default of lexical-binding: nil for
now to pacify the warnings in Emacs 31.
@korayal
Copy link
Contributor

korayal commented Apr 22, 2025

With this version, the only warning I'm now getting is from ~/.emacs.d/.cache/company-statistics-cache.el which is auto-generated at boot :/

@bcc32
Copy link
Collaborator

bcc32 commented Apr 22, 2025

With this version, the only warning I'm now getting is from ~/.emacs.d/.cache/company-statistics-cache.el which is auto-generated at boot :/

Consider reporting upstream?

@bcc32 bcc32 merged commit 55c9c2f into syl20bnr:develop Apr 22, 2025
9 checks passed
@fnussbaum
Copy link
Collaborator Author

fnussbaum commented Apr 23, 2025

With this version, the only warning I'm now getting is from ~/.emacs.d/.cache/company-statistics-cache.el which is auto-generated at boot :/

@korayal Thanks for testing! Until this is fixed upstream, you could try something like the following in dotspacemacs/user-init:

(advice-add
 'company-statistics--load :around
 (lambda (orig-fun)
   (let ((warning-inhibit-types '((files missing-lexbind-cookie))))
     (funcall orig-fun))))

@korayal
Copy link
Contributor

korayal commented Apr 24, 2025

@fnussbaum that works perfectly, thanks!

saintaardvark added a commit to saintaardvark/dot.emacs.d that referenced this pull request Jun 15, 2025
I upgraded to the latest Emacs today, and saw warnings about the lack
of a lexical-binding cookie in these files.  After a bit of reading,
it looks like lexical-binding is where Elisp is going and probably
harmless, so I've decied to enable it here.

Refs:

      - https://lists.gnu.org/r/emacs-devel/2024-05/msg00250.html
      - magit/magit#5361
      - syl20bnr/spacemacs#16960
      - https://www.emacswiki.org/emacs/DynamicBindingVsLexicalBinding
saintaardvark added a commit to saintaardvark/dot.emacs.d that referenced this pull request Jun 24, 2025
I upgraded to the latest Emacs today, and saw warnings about the lack
of a lexical-binding cookie in these files.  After a bit of reading,
it looks like lexical-binding is where Elisp is going and probably
harmless, so I've decied to enable it here.

Refs:

      - https://lists.gnu.org/r/emacs-devel/2024-05/msg00250.html
      - magit/magit#5361
      - syl20bnr/spacemacs#16960
      - https://www.emacswiki.org/emacs/DynamicBindingVsLexicalBinding
@fnussbaum fnussbaum deleted the add-most-lexical-binding-cookies branch November 4, 2025 13:19
hydravigil pushed a commit to hydravigil/spacemacs that referenced this pull request Jan 6, 2026
* Enable lexical binding for some files

* Disable lexical binding for remaining files missing declaration

For most files lexical-binding: t should also work without changes. But for each
file, someone would need examine it and check whether dynamic binding is relied
on somewhere. Hence I went with the current default of lexical-binding: nil for
now to pacify the warnings in Emacs 31.

* [core] Enable lexical binding in spacemacs/dump-vars-to-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants