"Zack Weinberg" writes: > ``` > (declare-function ansi-color-apply-on-region "ansi-color" > (begin end &optional preserve-sequences)) > > (declare-function dired-get-marked-files "dired" > (&optional localp arg filter distinguish-one-marked error)) > > (eval-when-compile > (check-declare-file byte-compile-current-file)) > > (defun colorize-buffer () > (interactive) > (ansi-color-apply-on-region (point-min) (point-max))) > > (defun find-marked-files () > (interactive) > (mapc 'find-file (dired-get-marked-files))) > ``` > > If you visit this file in emacs -Q and then invoke check-declare-file on > it interactively, check-declare-file generates no warnings, which is > correct. However, if you invoke `emacs -Q --batch -f batch-byte-compile > test.el` from the shell, you will get this output: > > ``` > uncompressing ansi-color.el.gz... > uncompressing ansi-color.el.gz...done > uncompressing dired.el.gz... > uncompressing dired.el.gz...done > > In end of data: > test.el:13:4: Warning: the function ‘ansi-color-apply-on-region’ might > not be > defined at runtime. > ``` > > "The function ‘...’ might not be defined" is the phrase used by > byte-compile-warn-about-unresolved-functions. It's not a check-declare > diagnostic. Indeed - so we have an interference between byte compilation, `eval-when-compile' and `check-declare-file'. This seems to help and might (?) be a good thing to do anyway: