emacs-epc
emacs-epc copied to clipboard
Package cl is deprecated in Emacs-27
Would be nice to fix this, since if the user uses any package that depends on this, they'll get a warning on startup.
Does clrefer to Common-Lisp ? I do not like to see this warning on each startup but I guess many popular packages depend on cl ?
Yes. It is relatively easy to depend on (require 'cl-lib) in place of (require 'cl). cl-lib was published many years ago as a better alternative to cl. And in Emacs-27 cl now has a deprecation warning.
is this particular warning can be just turned off ?
is this particular warning can be just turned off ?
As long as you have packages calling cl, I think the warning will remain. I have tried cl-libify without success.
Add this to init.el
(setq byte-compile-warnings '(cl-functions))
Even if our own .emacs requires only cl-lib, the warning remains. How can I identify the packages that depend on cl? Alternatively, how can I make the "Package cl is deprecated" warning be more verbose, by saying, for example: "while requiring package X: Package cl is deprecated"?
@sangjeedondrub Thanks, the code removes the warning for me. Just had to put it early in the init.
@ghali see the following link for info on how to list packages that depend on cl
https://github.com/hlissner/doom-emacs/issues/3372#issuecomment-643567913
Even if our own .emacs requires only cl-lib, the warning remains. How can I identify the packages that depend on cl? Alternatively, how can I make the "Package cl is deprecated" warning be more verbose, by saying, for example: "while requiring package X: Package cl is deprecated"?
(require 'loadhist)
(file-dependents (feature-file 'cl))
edit: I missed Pedro-w's comment. Follow his link for more info
Add this to
init.el(setq byte-compile-warnings '(cl-functions))
I have read the documentation of this variable, just curious:
byte-compile-warnings is a variable defined in ‘bytecomp.el’.
Its value is t
This variable is safe as a file local variable if its value
satisfies the predicate which is a byte-compiled expression.
You can customize this variable.
Probably introduced at or before Emacs version 23.1.
Documentation:
List of warnings that the byte-compiler should issue (t for all).
Doesn't it means (setq byte-compile-warnings '(cl-functions)) only issue warnings of cl-functions?
Add this to
init.el(setq byte-compile-warnings '(cl-functions))I have read the documentation of this variable, just curious:
byte-compile-warnings is a variable defined in ‘bytecomp.el’. Its value is t This variable is safe as a file local variable if its value satisfies the predicate which is a byte-compiled expression. You can customize this variable. Probably introduced at or before Emacs version 23.1. Documentation: List of warnings that the byte-compiler should issue (t for all).Doesn't it means
(setq byte-compile-warnings '(cl-functions))only issue warnings ofcl-functions?
I agree with you.
It seemed to me that it should be (setq byte-compile-warnings '(not cl-functions)) , this did not work for me however
(setq byte-compile-warnings '(cl-functions)) did.
Then I tried (setq byte-compile-warnings '(not obsolete)) and this worked too.
My guess is then that the warning is listed as an obsolete warning and that when you set byte-compile-warnings to be only
cl-functions, that works only because it exludes obsolete warnings.
FYI neither (setq byte-compile-warnings '(cl-functions)) nor (setq byte-compile-warnings '(not obsolete)) work on my system. Emacs 27.1 MacOS 10.15.7
I had the same issue, but I got (setq byte-compile-warnings '(cl-functions)) to work if I put it in early-init.el.
FYI neither
(setq byte-compile-warnings '(cl-functions))nor(setq byte-compile-warnings '(not obsolete))work on my system. Emacs 27.1 MacOS 10.15.7
i am seeing this as well. is there a difference in how emacs initialize in Mac OS?
@rafiks @danieljamesross did you put it in early-init.el as suggested by @Holdnack here? That worked for me, same version of emacs and MacOS.
@danieljamesross I had the same issue. emacs 27.1-3 on manjaro 20.1.1
when I found an Orphaned package using 'cl in elpa/ , I remove it.
Then put (setq byte-compile-warnings '(cl-functions)) in early init.el.
Finally, the warning is disappeared.
What about slime, the package, because when I run
(require 'loadhist)
(file-dependents (feature-file 'cl))
I got as output the following packages
"/home/txarly/.emacs.d/elpa/deft-20200515.1513/deft.elc"
"/home/txarly/quicklisp/dists/quicklisp/software/slime-v2.23/contrib/slime-repl.el"
"/home/txarly/quicklisp/dists/quicklisp/software/slime-v2.23/contrib/bridge.el"
"/home/txarly/quicklisp/dists/quicklisp/software/slime-v2.23/contrib/slime-presentations.el"
"/home/txarly/quicklisp/dists/quicklisp/software/slime-v2.23/slime.el"
Then, checking one by one (excepting ..deft.elc because it's a *.elc one file) I found out they already call for 'cl-lib but immediately there is a line which reads (eval-when-compile (require 'cl))
I'd appreciate any clue on this.
@rafiks @danieljamesross did you put it in early-init.el as suggested by @Holdnack here? That worked for me, same version of emacs and MacOS.
yes. i also just tried emacs 28 and it still did not work for me.. I have Doom Emacs and d12frosted's Emacs.
Confirm that this error is now squashed, thanks @Holdnack and @pedro-w.
For anyone new, I'll reiterate:
Put (setq byte-compile-warnings '(cl-functions)) in early-init.el.
I didn't have an early-init.el file, so I created one at ~/.emacs.d/early-init.el
for those on prelude - i got it to work by adding a file in the ~/.emacs.d/personal/preload/ folder containing this line (setq byte-compile-warnings '(cl-functions))
I had the same issue, but I got
(setq byte-compile-warnings '(cl-functions))to work if I put it in early-init.el.
This finally worked for me on macOS 11.2.3, Big Sur. Thank you so much! 🥂