emacs-epc icon indicating copy to clipboard operation
emacs-epc copied to clipboard

Package cl is deprecated in Emacs-27

Open abo-abo opened this issue 6 years ago • 21 comments

Would be nice to fix this, since if the user uses any package that depends on this, they'll get a warning on startup.

abo-abo avatar Oct 16 '19 09:10 abo-abo

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 ?

pietrodito avatar Dec 18 '19 09:12 pietrodito

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.

abo-abo avatar Dec 18 '19 09:12 abo-abo

is this particular warning can be just turned off ?

slk500 avatar Dec 21 '19 13:12 slk500

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.

holzee avatar Jan 10 '20 17:01 holzee

Add this to init.el

(setq byte-compile-warnings '(cl-functions))

sangjeedondrub avatar Jul 19 '20 12:07 sangjeedondrub

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"?

ghali avatar Aug 12 '20 23:08 ghali

@sangjeedondrub Thanks, the code removes the warning for me. Just had to put it early in the init.

abo-abo avatar Aug 13 '20 08:08 abo-abo

@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

pedro-w avatar Aug 14 '20 11:08 pedro-w

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

genedelisa avatar Aug 16 '20 10:08 genedelisa

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?

snowman avatar Oct 11 '20 10:10 snowman

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?

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.

MerlinsGreatBeard avatar Oct 17 '20 18:10 MerlinsGreatBeard

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

danieljamesross avatar Nov 10 '20 14:11 danieljamesross

I had the same issue, but I got (setq byte-compile-warnings '(cl-functions)) to work if I put it in early-init.el.

ghost avatar Nov 13 '20 01:11 ghost

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 avatar Dec 31 '20 22:12 rafiks

@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.

pedro-w avatar Jan 02 '21 14:01 pedro-w

@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.

DeepBlueRobot avatar Jan 08 '21 11:01 DeepBlueRobot

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.

touxstone avatar Jan 09 '21 10:01 touxstone

@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.

rafiks avatar Jan 13 '21 04:01 rafiks

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

danieljamesross avatar Feb 04 '21 16:02 danieljamesross

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))

gsime1 avatar Apr 25 '21 07:04 gsime1

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! 🥂

michaelpass avatar Apr 25 '21 18:04 michaelpass