all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69290@debbugs.gnu.org
Subject: bug#69290: declare-function doesn't work when combined with --eval and -batch
Date: Tue, 20 Feb 2024 22:56:01 +0300	[thread overview]
Message-ID: <2f376e6d58b58f3fa8afa5376018a37b1ba3fab4.camel@yandex.ru> (raw)
In-Reply-To: <868r3eoqw0.fsf@gnu.org>

On Tue, 2024-02-20 at 21:51 +0200, Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <Hi-Angel@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?

It says `Tell the byte-compiler that function FN is defined, in FILE`,
and then FILE may be nil. In the context of the problem it seems the
only thing that's relevant. There's a lot more text, but the rest of it
just explains behavior of different parameters. Is there anything I'm
missing?





  reply	other threads:[~2024-02-20 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 18:59 bug#69290: declare-function doesn't work when combined with --eval and -batch Konstantin Kharlamov
2024-02-20 19:51 ` Eli Zaretskii
2024-02-20 19:56   ` Konstantin Kharlamov [this message]
2024-02-20 20:03     ` Eli Zaretskii
2024-02-20 20:13       ` Konstantin Kharlamov
2024-02-20 20:20         ` Eli Zaretskii
2024-02-20 20:31           ` Konstantin Kharlamov
2024-02-20 21:28             ` Konstantin Kharlamov
2024-02-21  3:30               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f376e6d58b58f3fa8afa5376018a37b1ba3fab4.camel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=69290@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.