Subject: Re: bug#59714: 30.0.50; (void-function cl-letf)

From: Eli Zaretskii <[email-masked]>
Date: Wed, 30 Nov 2022 19:05:45 +0200

> Date: Wed, 30 Nov 2022 07:45:51 +0100
> From:  Manuel Uberti via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> - emacs -Q
> - Evaluate: (cl-letf (((default-value 'process-environment) nil)))
> - You see the following error:
> 
> Debugger entered--Lisp error: (void-function cl-letf)
>    (cl-letf (((default-value 'process-environment) nil)))
>    (progn (cl-letf (((default-value 'process-environment) nil))))
>    eval((progn (cl-letf (((default-value 'process-environment) nil)))) t)
>    elisp--eval-last-sexp(nil)
>    eval-last-sexp(nil)
>    funcall-interactively(eval-last-sexp nil)
>    call-interactively(eval-last-sexp nil nil)
>    command-execute(eval-last-sexp)

I don't understand how autoloading macros or functions from cl-lib could
work as the above expects.  The autoload forms of these functions and macros
are written to cl-loaddefs.el, but the only file that loads cl-loaddefs.el
is cl-lib itself.  So you must (require 'cl-lib) to be able to use cl-letf.

Stefan, did I miss something?