[Top][All Lists]

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

Re: cl-case is not autoloaded in Emacs 27

From: Bozhidar Batsov
Subject: Re: cl-case is not autoloaded in Emacs 27
Date: Wed, 21 Jul 2021 21:40:05 +0300
User-agent: Cyrus-JMAP/3.5.0-alpha0-539-g8589ead45b-fm-20210721.001-g8589ead4

To my knowledge nothing from cl-lib has ever been autoloaded (as those functions/macros are not commands it doesn't really make sense to autoload them). You need to require cl-lib, not cl-macs. Most of the time some package that you've loaded will have required cl-lib, that's why probably you didn't notice that it's not required by default. 

On Wed, Jul 21, 2021, at 8:18 PM, Daniele Nicolodi wrote:

I have been trying to understand why some ERT unit tests I wrote fail in
Emacs 27 while they suceed in Emacs 26. After some head scratching I
found that the problem is caused by the fact that Emacs 27 does not seem
to know about the cl-case macro unless I (require 'cl-macs).

Indeed, if I try to byte-compile some trivial code like

(let ((x ?c))
  (cl-case x
    (?a 0)
    (?b 1)))

in Emacs 27.1 or Emacs 27.2 I obtain these warnings:

In toplevel form:
test.el:1:1:Warning: ‘97’ is a malformed function
test.el:1:1:Warning: ‘98’ is a malformed function

In end of data:
test.el:7:1:Warning: the function ‘cl-case’ is not known to be defined.

Adding a (require cl-macs) to my code solves my problem, however, the
doc string of cl-case would suggest that this should not be necessary.

Am I missing something?

Thank you.


reply via email to

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