[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#69120: Spurious "function is not known to be defined" if defined in
From: |
Konstantin Kharlamov |
Subject: |
bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body |
Date: |
Wed, 14 Feb 2024 18:28:15 +0300 |
User-agent: |
Evolution 3.50.3 |
On Wed, 2024-02-14 at 17:23 +0200, Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
> > Date: Wed, 14 Feb 2024 14:16:09 +0300
> >
> > I have many functions that are only useful inside a specific mode.
> > So I
> > group them with `use-package`, by defining them inside `:init` or
> > `:config` section, depending on the use.
> >
> > It turns out, byte-compiler does not consider such functions to be
> > defined and prints a warning about it.
> >
> > # Steps to reproduce (in terms of terminal commands)
> >
> > λ cat test.el
> > ;;; -*- lexical-binding: t -*-
> > (use-package prog-mode
> > :init
> > (defun hello()
> > (print "hello"))
> > (hello))
> > λ emacs -batch -f batch-byte-compile test.el
> >
> > In end of data:
> > test.el:6:4: Warning: the function ‘hello’ is not known to be
> > defined.
> >
> > ## Expected
> >
> > File gets compiled with no warnings
> >
> > ## Actual
> >
> > There's a warning
> >
> > test.el:6:4: Warning: the function ‘hello’ is not known to be
> > defined.
>
> What do you get if you macro-expand your code?
Wrapping the above code to a `(macroexpand …)` gives a:
"hello"
nil
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Konstantin Kharlamov, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Eli Zaretskii, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body,
Konstantin Kharlamov <=
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Eli Zaretskii, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Konstantin Kharlamov, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Eli Zaretskii, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Konstantin Kharlamov, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Konstantin Kharlamov, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Konstantin Kharlamov, 2024/02/14
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Eli Zaretskii, 2024/02/15
- bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body, Stefan Monnier, 2024/02/15