[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nongnu] elpa/org-contrib eaef050f28: lisp/ox-bibtex.el (org-bibtex-
|
From: |
Emanuel Berg |
|
Subject: |
Re: [nongnu] elpa/org-contrib eaef050f28: lisp/ox-bibtex.el (org-bibtex-goto-citation): Add missing require |
|
Date: |
Wed, 31 Jan 2024 15:51:35 +0100 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier wrote:
>> Does it mean that you would not recommend moving
>> declare-function inside function if that function does not
>> have require?
>
> The `declare-function` tells the compiler "trust me, this
> function will exist by the time we reach this point in the
> code".
>
> Often as a programmer, what makes me confident to say such
> a thing is that I just did a `require`, but not always [...]
If you have a lexical let-closure (a `let' or `let*' at
top-level and a `defun' within it) and byte-compile the file,
the byte-compiler will warn the function isn't known to be
defined it it is refered to in the code. So after the defun
one can use `declare-function', either inside the closure or
after it.
I have mentioned it a couple of times so I know it is
well-known, and probably a bug or area of possible improvement
in the byte-compiler.
--
underground experts united
https://dataswamp.org/~incal