all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: Re: Emacs Lisp Linter fail to identify function defined in a "use-package" block
Date: Fri, 13 Oct 2023 03:47:59 +0200	[thread overview]
Message-ID: <87wmvr70og.fsf@dataswamp.org> (raw)
In-Reply-To: 87il7c8le4.fsf@dataswamp.org

> Well, here the discussion can go both ways! Because in a way
> it makes sense that every file `provide' its stuff, and
> every other file that wants to use it `require' it.

Yes, this is a huge problem if you want to tidy up one's Elisp
using elint. You get so many warnings this or that variable
isn't known to be defined, you check where it is defined but
that source file isn't `provide'd or in some cases (e.g.
`float-pi') it is incorrectly provided (i.e. it is defined in
float-sup.el but that file provides its services as
"lisp-float-type").

Note that this isn't elint's fault, on the contrary, the fault
is with those files. But what happens is the interesting
situation that one cannot use elint to tidy up one's Elisp,
because the Elisp of vanilla Emacs isn't tidy enough. Not good!

Yeah, all files should `require' everything they need and
provide itself in the end. This situation in itself isn't
optimal - well, as we have just seen, it is error prone -
since it can and should be automated, there is no need to rely
on humans to do this work, however now it isn't and that means
one must get it right manually.

> Update 1, elint is correctly seeing defuns in lexical
> let-closures, and there is no need to use `declare-function'
> for it do that as was incorrectly theorized the day before.
> This is interesting because the byte-compiler does not see
> those so there declare-function is needed.

Unfortunately, this isn't exactly true either. Both elint and
the byte-compiler are silent if a defun in a lexical
let-closure is just defined. However if and where it is
_used_, elint cannot see it, and `define-function' doesn't
help. define-function does shut up the byte-compiler in this
situation tho.

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2023-10-13  1:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12  0:32 Emacs Lisp Linter fail to identify function defined in a "use-package" block Kiong-Gē Liāu
2023-10-12  5:22 ` Emanuel Berg
2023-10-13  1:47   ` Emanuel Berg [this message]
2023-10-13  1:55   ` Emanuel Berg
2023-10-13  2:05   ` Emanuel Berg
2023-10-13  2:29   ` Emanuel Berg
2023-10-13  3:33   ` Emanuel Berg
2023-10-26 20:29     ` Emanuel Berg
2023-11-06 23:51       ` Emanuel Berg
2023-11-08  3:10         ` Richard Stallman
2023-11-08  8:56           ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2023-10-11 17:19 Kiong-Gē Liāu
2023-10-10 14:51 Kiong-Gē Liāu
2023-10-10 22:25 ` Emanuel Berg
2023-10-11  0:59 ` Emanuel Berg
2023-10-11  1:43 ` Emanuel Berg

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=87wmvr70og.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=emacs-devel@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.