help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package cl is deprecated


From: Thibaut Verron
Subject: Re: Package cl is deprecated
Date: Wed, 28 Jul 2021 16:04:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 28/07/2021 15:36, Hongyi Zhao wrote:
On Wed, Jul 28, 2021 at 9:33 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
On Wed, Jul 28, 2021 at 9:23 PM Thibaut Verron <thibaut.verron@gmail.com> wrote:

On 28/07/2021 15:03, Hongyi Zhao wrote:
On Wed, Jul 28, 2021 at 6:04 PM Jean-Christophe Helary
<lists@traduction-libre.org> wrote:

On Jul 28, 2021, at 18:54, Thibaut Verron <thibaut.verron@gmail.com> wrote:

On 28/07/2021 11:46, Hongyi Zhao wrote:
On Wed, Jul 28, 2021 at 5:33 PM Thibaut Verron <thibaut.verron@gmail.com> wrote:
On 28/07/2021 11:23, Hongyi Zhao wrote:
When I start Emacs, I always notice the following message in *Messages* buffer:

Package cl is deprecated

Any hints for eliminating it?
If you have (require 'cl) somewhere in your init file, replace it with
(require 'cl-lib). You might need to change some macro calls to use
cl-<name> instead of <name>.
$ egrep 'require[ ]*'\''cl' .emacs.d/init.el
(require 'cl-lib)
Then it's from a package and you need to identify it.

You can try (untested):

find .emacs.d/ -name "*.el" -exec grep "(require 'cl)" {} \;
find .emacs.d/ -name "*.el" -exec grep "(require 'cl)" {} \; -print
There are so many matches:

$ find .emacs.d/ -name "*.el" -exec grep -q "(require 'cl)" {} \;
-print 2>/dev/null | sort -u | wc -l
40

So this method is basically useless for finding the problem.
I just tried it, indeed quite a few packages contain some form of
(require 'cl) as a backward-compatibility tool (52 matches in my case).
Most of those are test files which are never loaded in a normal emacs
session.

To narrow the search, you can use egrep -q "^\(require 'cl\)" instead.
In my .emacs, the matches go from 52 to 15. Interestingly enough,
exactly one of them is loaded at init time (key-combo.el), without any
warning.
Strange, I found nothing with this enhanced pattern:

$ find .emacs.d/ -type f -name "*.el" -exec grep -q "^[ ]*\([
]*require[ ]+'cl[ ]*\)" {} \; -print | wc -l
0
Sorry, egrep should be used:

$ find .emacs.d/ -type f -name "*.el" -exec egrep -q "^[ ]*\([
]*require[ ]+'cl[ ]*\)" {} \; -print | egrep -v  '[/]tests?[/]'
.emacs.d/straight/repos/dash.el/dash.el
.emacs.d/straight/repos/dash.el/dev/examples.el
.emacs.d/straight/repos/stardiviner-sdcv.el/sdcv.el
.emacs.d/straight/repos/showtip/showtip.el
.emacs.d/straight/repos/unicode-escape.el/unicode-escape.el
.emacs.d/straight/repos/use-package/use-package-tests.el
.emacs.d/straight/repos/macrostep/lib/cl-lib.el
.emacs.d/straight/repos/macrostep/lib/ert.el
.emacs.d/straight/repos/emacs-websocket/websocket-functional-test.el
.emacs.d/straight/repos/s.el/dev/ert.el

The point of the regexp was to exclude files which have something (including indentation) before the form, if you allow [ ]* you lose that. That's the case in dash.el for example.

In any case, the number of candidates is now small enough that you can examine them. The dev/ and lib/ folders can probably be safely ignored to.

Best wishes,

Thibaut




reply via email to

[Prev in Thread] Current Thread [Next in Thread]