Subject: bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’

From: Michael Heerdegen <[email-masked]>
Date: Thu, 29 Jun 2023 06:17:43 +0200

Zack Weinberg <[email-masked]> writes:

> (eval-when-compile
>   (check-declare-file byte-compile-current-file))

BTW, I think a better alternative might be

#+begin_src emacs-lisp
(require 'cl-lib)
(cl-eval-when (compile)
  (check-declare-file byte-compile-current-file))
#+end_src

which behaves like you want and also doesn't break loading the source of
your file like your version does.  If you don't want to load cl-lib, I
guess adding something like

#+begin_src emacs-lisp
(defmacro check-declarations ()
  (check-declare-file byte-compile-current-file)
  t)
(check-declarations)
#+end_src

could also work.

Michael.