After switching from Emacs 25 to Emacs 28 I started to get this warning message during the loading of my custom settings

.emacs.d/init.el: Warning: (lambda nil \.\.\.) quoted with ' rather than with #'

I upgraded all installed packages and everything works as expected, but I don't know what is this.

  • 5
    It's a warning, not an error, so you can ignore it if you want, but you should probably fix it, if only to avoid being nagged. Search in your init.el for a single quote quoting a lambda expression: '(lambda - you can just follow the recommendation of the warning and change it to #'(lambda - but lambda expressions are self evaluating in any case, so there is probably no reason to quote it at all. However, you might want to post the relevant snippet from your init.el file in your question and ask how to fix it (if a fix is necessary).
    – NickD
    Oct 28, 2022 at 15:23
  • 6
    Effectively, the Emacs compiler can compile #'(lambda ...) to byte code, whereas '(lambda ...) can be a plain lisp list which just happen to start with the atom lambda, so the compiler is not allowed to compile it. Oct 28, 2022 at 20:24
  • 1
    thanks. I corrected all '(lambda to #'(lambda in the init.el file and now the error disappeared. I wonder why this didn't happen with Emacs 25. Probably it was more tollerant (?) Nov 2, 2022 at 8:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.