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 #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: declare-function doesn't work when combined with --eval and -batch
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.


# Steps to reproduce (in terms of terminal commands)

    λ 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

## Actual

There's a warning about undeclared function which is declared

# Additional information

Versions tested:

* commit d4d5830f8a0 built 3 weeks ago from master.
* 27.1, 26.3, 25.3




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

Previous Next


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