all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69120@debbugs.gnu.org, Konstantin Kharlamov <Hi-Angel@yandex.ru>
Subject: bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body
Date: Thu, 15 Feb 2024 10:21:03 -0500	[thread overview]
Message-ID: <jwvv86pahb8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86v86qw77z.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Feb 2024 08:51:28 +0200")

>> >    ;;; -*- lexical-binding: t -*-
>> >    (defun foo ()
>> >      (defun hello()
>> >        (print "hello"))
>> >      (hello))
>> 
>> An interesting fact: inserting a `(declare-function hello nil)` after a
>> `defun` suppresses the warning. So I guess `defun` should work somehow
>> similarly to `declare-function`.
>
> Perhaps Stefan (CC'ed) will have some comments or advice.

Both `defun` and `declare-function` work in unsatisfactory ways in this
respect.

Any `declare-function` anywhere in the file will silence all warnings
about this function in the whole file, which is too lax.

`defun` in contrast only silences the warnings if it's at the top-level,
which is too restrictive.

We should make them both work a bit more like `defvar`.


        Stefan






      reply	other threads:[~2024-02-15 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 11:16 bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body Konstantin Kharlamov
2024-02-14 15:23 ` Eli Zaretskii
2024-02-14 15:28   ` Konstantin Kharlamov
2024-02-14 16:07     ` Eli Zaretskii
2024-02-14 16:10       ` Konstantin Kharlamov
2024-02-14 16:38         ` Eli Zaretskii
2024-02-14 16:58           ` Konstantin Kharlamov
2024-02-15  3:57             ` Konstantin Kharlamov
2024-02-15  4:00               ` Konstantin Kharlamov
2024-02-15  6:51                 ` Eli Zaretskii
2024-02-15 15:21                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=jwvv86pahb8.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69120@debbugs.gnu.org \
    --cc=Hi-Angel@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.