GNU bug report logs - #69290
declare-function doesn't work when combined with --eval and -batch

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Tue, 20 Feb 2024 19:01:01 UTC

Severity: normal

Full log


Message #8 received at 69290 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Cc: 69290 <at> debbugs.gnu.org
Subject: Re: bug#69290: declare-function doesn't work when combined with --eval
 and -batch
Date: Tue, 20 Feb 2024 21:51:59 +0200
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Tue, 20 Feb 2024 21:59:31 +0300
> 
> Stumbled upon that while trying to improve CI in Evil mode. Enabling byte-compilation
> causes warnings about `undo-redo` undeclared on older Emacs'es, so tried to work
> around that with `declare-function`. Turns out it doesn't work.

Of course it does.  If used correctly, that is.  We do that in
gazillion places in our sources.

>     λ cat test.el
>     ;;; -*- lexical-binding: t -*-
>     (hello)
>     λ emacs -batch --eval '(declare-function hello nil)' -f batch-byte-compile test.el
> 
>     In end of data:
>     test.el:2:2: Warning: the function ‘hello’ is not known to be defined.
> 
> ## Expected
> 
> There's no warning

What does the doc string of declare-function tell you about its usage
and effect?




This bug report was last modified 1 year and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.