From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#64232: 28.2; Incorrect(?) byte compilation warning about =?UTF-8?Q?=E2=80=98ansi-color-apply-on-region=E2=80=99?= Date: Wed, 28 Jun 2023 04:10:27 +0200 Message-ID: <87jzvoe3qk.fsf@web.de> References: <874jmzs23h.wl-zack@owlfolio.org> <83o7l5yt9k.fsf@gnu.org> <9c38fe1a-ee3a-4b6d-aaa7-33aa4909e331@app.fastmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2508"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 64232@debbugs.gnu.org, Stefan Monnier To: Zack Weinberg Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 28 04:11:29 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEKeX-0000Vp-IX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Jun 2023 04:11:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEKe9-0005SS-Us; Tue, 27 Jun 2023 22:11:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEKe7-0005PD-46 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 22:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEKe6-0003ck-SI for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 22:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEKe6-00035a-H8 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 22:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Jun 2023 02:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64232 X-GNU-PR-Package: emacs Original-Received: via spool by 64232-submit@debbugs.gnu.org id=B64232.168791824711845 (code B ref 64232); Wed, 28 Jun 2023 02:11:02 +0000 Original-Received: (at 64232) by debbugs.gnu.org; 28 Jun 2023 02:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:49761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEKdr-00034z-7K for submit@debbugs.gnu.org; Tue, 27 Jun 2023 22:10:47 -0400 Original-Received: from mout.web.de ([212.227.15.4]:43829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEKdk-00034f-Ux for 64232@debbugs.gnu.org; Tue, 27 Jun 2023 22:10:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1687918229; x=1688523029; i=michael_heerdegen@web.de; bh=iStLkts7EcnwAsDncLMMTKOT4sHzweGBGP8HZ8uMMgA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=bEz3zYjOePc7NkeF70QOzUyInVExH9Odw0gkRQ9sDoo2npUNqxCVIiGOFxyyOy4rQtzbj3u fGjvHEjp0S2V1a1+KeW7o+u6B+3fI5XpWbJUB2kPPQg2UzXHIQ661ThdVstlSpYbuiol33TIA CTcXYArp6UpZjqdDgm/qO7v3sZCk9j40shqUuV8d9pHf8zDqkusg4AbhttUvavomvYnrLl9Ax ISK3AgY4PFx3XzN2EQfCijUjebKLNooX89tRhUhvz+rOgMNroKp+Ql/BajdLpB/2GBYoVDwuT Ar5e6Bs4QiPBfqXYEZPzEVoXfe99JqAAQGGdElSzdRsoezhfb9mw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([217.247.69.86]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MSqXS-1qdBal1la2-00UTHy; Wed, 28 Jun 2023 04:10:29 +0200 In-Reply-To: <9c38fe1a-ee3a-4b6d-aaa7-33aa4909e331@app.fastmail.com> (Zack Weinberg's message of "Sat, 24 Jun 2023 11:15:42 -0400") X-Provags-ID: V03:K1:V8/3UvqfA3w2O681RXwpDWh7vFWvmGCpBXlWwpFb+U2LlJaxw/7 g2BHnUio+94kKAoGjUBaJ2XdQKyFCUtdvGQ4cmoXIbHXT1Q6meprG9p46DULebNferdyqcx rTZTXpDsWMVG2usJZ8jVxQhXuo+2l0MqGKPxJOOTGAWC5NmkuCFSg3rdn6oH9Bg5H+JcXz6 RjLn6HBRFhRZb6gkQW75g== UI-OutboundReport: notjunk:1;M01:P0:vK2iwM0sz2I=;hll0728+C0uswZyw7r2m1LGORg7 GwFPV6WbAwqJGhJSrVXnsBYhJRDySOxk1bkLdecEmigHWNtP58Ar+gTlgSbxkrMxyQK8pFKQy OJbyyWpZKyyalFa8iHDMRLed8K1urwghKRdde9cw660dQFkDvRPwlcJDSOU7xVT6ogs9Vxfne FruzTFvAlX+Rhf0WpbbhGBnJmht+Xs7NK0Acbj/6BhqH+WxEGhFahPIsdp2SKWYVICCOaCSj9 GBA9DHXK/cyb/dCVMepfYT9Y/PQYH2BwtrIHikk/0F4r6k76R2X7Baike9MCDXL9DFJ3yBvS8 rCAxPvmbf/f3uoaanRxARKiq8fc8pSvfYEScOcS1swGAJGm9wtqoEG9EqStxeMJ68rMJPXOCt U991PJ/4vaY5Ah3jdN8R4nmVq5Uh9/v/DfFEOsvnRP8uDsGz0c44ULzV6EvBjsFiRPX2NQgps XknsHPgM/mzQ1W+P2sIT0WY2Tplz8Sr7loUgaFfv4KSTqVyH2zV14HgFJ7BnRbbh56RPYjOb2 P01tIG7cQ3TfK2DO38HPFjPjrvVqkpOygHYLRdopu0TE3ev3Hp7XRWKZ0d43E+Vx39e+20zKH N+Vqa+E7gTK/cjEXNCj37iroR2R0RrV2oEoPcJDrfCzbym8XwyVQAIa9a6ex6KU4ewsZ1Xa5u BVdAFgzqgaFb5JlONHvGH61256I636SrcCAmaMb8yRzERSp+Y7XOcj0yK/zGTCXbuyO1xMPxX +8EoytNy0hu6HzWCPdVhGXHrvTt8lw8prAly9R+4sampiiUVbyD+vI6/StLJN0Nqcv86LHI4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264190 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Zack Weinberg" writes: > ``` > (declare-function ansi-color-apply-on-region "ansi-color" > (begin end &optional preserve-sequences)) > > (declare-function dired-get-marked-files "dired" > (&optional localp arg filter distinguish-one-marked err= or)) > > (eval-when-compile > (check-declare-file byte-compile-current-file)) > > (defun colorize-buffer () > (interactive) > (ansi-color-apply-on-region (point-min) (point-max))) > > (defun find-marked-files () > (interactive) > (mapc 'find-file (dired-get-marked-files))) > ``` > > If you visit this file in emacs -Q and then invoke check-declare-file on > it interactively, check-declare-file generates no warnings, which is > correct. However, if you invoke `emacs -Q --batch -f batch-byte-compile > test.el` from the shell, you will get this output: > > ``` > uncompressing ansi-color.el.gz... > uncompressing ansi-color.el.gz...done > uncompressing dired.el.gz... > uncompressing dired.el.gz...done > > In end of data: > test.el:13:4: Warning: the function =E2=80=98ansi-color-apply-on-region= =E2=80=99 might > not be > defined at runtime. > ``` > > "The function =E2=80=98...=E2=80=99 might not be defined" is the phrase u= sed by > byte-compile-warn-about-unresolved-functions. It's not a check-declare > diagnostic. Indeed - so we have an interference between byte compilation, `eval-when-compile' and `check-declare-file'. This seems to help and might (?) be a good thing to do anyway: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-Try-to-fix-Bug-64232.patch Content-Transfer-Encoding: quoted-printable =46rom e972af2cd4d27b42cad7cf697bcfa32127cb0591 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Wed, 28 Jun 2023 04:02:44 +0200 Subject: [PATCH] WIP: Try to fix Bug#64232 =2D-- lisp/emacs-lisp/bytecomp.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 99202185d8d..f468e34bb42 100644 =2D-- 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-position= s =2D- 2.30.2 --=-=-= Content-Type: text/plain Would be nice if someone like Stefan or Mattias could tell whether this is an appropriate addition (independently from this obscure issue). Michael. --=-=-=--