[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color
From: |
Michael Heerdegen |
Subject: |
bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’ |
Date: |
Thu, 29 Jun 2023 05:43:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
> > --- a/lisp/emacs-lisp/bytecomp.el
> > +++ b/lisp/emacs-lisp/bytecomp.el
> > @@ -554,7 +554,9 @@ byte-compile-initial-macro-environment
> > (let ((byte-compile-unresolved-functions
> > byte-compile-unresolved-functions)
> > (byte-compile-new-defuns
> > - byte-compile-new-defuns))
> > + byte-compile-new-defuns)
> > + (byte-compile-noruntime-functions
> > + byte-compile-noruntime-functions))
> > (setf result
> > (byte-compile-eval
> > (byte-run-strip-symbol-positions
>
> Hmm... this doesn't look right: one of the main purpose of
> `byte-compile-eval` is (beside calling `eval`) to populate
> `byte-compile-noruntime-functions`, so if you let-bind it around the
> call, it's like calling `eval` and we can just get rid of
> `byte-compile-noruntime-functions` altogether.
Hmm - ok.
> The "natural" place to put the let-binding would be in
> `byte-compile-close-variables` (assuming it still fixes the bug).
Seems it does not. Maybe we should try to understand what is happening
first.
Part of the problem is the dependency
check-declare -> compile -> comint -> ansi-color
so the compiler might think we are `requiring' ansi-color (which the
compiled file uses) inside our `eval-when-compile' by purpose.
The warning is the same as when one did just
#+begin_src emacs-lisp
(eval-when-compile
(require 'ansi-color))
#+end_src
When removing that `eval-when-compile' the warning message goes away.
So the compiler warns stricter when something is required inside
`eval-when-compile', even if there would be no warning at all without
it.
Michael.
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Zack Weinberg, 2023/06/22
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Eli Zaretskii, 2023/06/24
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Zack Weinberg, 2023/06/24
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Michael Heerdegen, 2023/06/27
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Stefan Monnier, 2023/06/28
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’,
Michael Heerdegen <=
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Stefan Monnier, 2023/06/29
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Michael Heerdegen, 2023/06/30
- bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Eli Zaretskii, 2023/06/30
bug#64232: 28.2; Incorrect(?) byte compilation warning about ‘ansi-color-apply-on-region’, Michael Heerdegen, 2023/06/29