From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master bf21025: * lisp/emacs-lisp/bytecomp.el: Remember location of unresolved calls Date: Thu, 25 Mar 2021 13:42:06 -0400 Message-ID: References: <20210319223536.5620.7190@vcs0.savannah.gnu.org> <20210319223537.784692101A@vcs0.savannah.gnu.org> <87ft0j88o2.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7468"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 25 18:43:30 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lPU14-0001ou-1V for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Mar 2021 18:43:30 +0100 Original-Received: from localhost ([::1]:56048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPU13-00019v-2M for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Mar 2021 13:43:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPTzx-0008BN-AT for emacs-devel@gnu.org; Thu, 25 Mar 2021 13:42:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPTzq-0000gx-Tt for emacs-devel@gnu.org; Thu, 25 Mar 2021 13:42:19 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BE4B9440FEC; Thu, 25 Mar 2021 13:42:13 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 019274401DB; Thu, 25 Mar 2021 13:42:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616694128; bh=hrUl3LLV3n4SmNeA7ZK+8JsjrpyBnPLajXdhlGL0AYA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ux2CofplIo1tiWeF7TE8fxi2/fL4Bruqjpxg1YytaYRVfSxgZ+eybzPOVohvxIjyF BJMvItWpnfQMjpI4UPVjF+nGuI6ncgOzwGzrMd0cs31onjKVqTUDbML2GviDireQAz ExEX4FMPdLGjqwsytkbx0vM1qhdz+i5WIh87sieLUJ0EM2A8jSKLvwVLLKKZy9S/Zw CWx3mFRujTzN0jAodPO5T6CNzFmKFbrj2Dauy8C7ijjF40SkF4Lsd3lzFhesJqhIgB 94pcZHd1ckTzrMQheV4zrqpW0hxBamI4zQPMe3jDbbtYGTNfmr5SK7k2i+wgrIOLGR TFNpzOPUbT9Yw== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 826B2120313; Thu, 25 Mar 2021 13:42:07 -0400 (EDT) In-Reply-To: <87ft0j88o2.fsf@tcd.ie> (Basil L. Contovounesios's message of "Thu, 25 Mar 2021 17:06:37 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267043 Archived-At: > Does that mean this part can be removed, or are its side effects still > needed somewhere? > > diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el > index 0babbbb978..dd8d15e167 100644 > --- a/lisp/emacs-lisp/bytecomp.el > +++ b/lisp/emacs-lisp/bytecomp.el > @@ -2190,9 +2190,6 @@ byte-compile-from-buffer > (byte-compile-toplevel-file-form form))) > ;; Compile pending forms at end of file. > (byte-compile-flush-pending) > - ;; Make warnings about unresolved functions > - ;; give the end of the file as their position. > - (setq byte-compile-last-position (point-max)) > (byte-compile-warn-about-unresolved-functions))) > byte-compile--outbuffer))) I think so, yes. > BTW, would we like the effect of declare-function to be local to its > lexical scope? Would this be feasible? Yes and yes. > I guess we'd need a new var to keep track of unresolved fns per scope, > and merge its remaining contents with the global unresolved and > noruntime lists when popping scope, or something like that? Can't remember enough of the code to be able to tell. > My motivating example is, had I declared tab-bar-height within > frame-notice-user-settings for --without-x builds, then that would have > shadowed its later unqualified use in frame-inner-height, leaving > bug#47234 unnoticed. (Of course the same would be true if the > declaration were at top-level.) Similarly, I like to put the `declare-function`s right after `require` when a function requires a package from its body, but this precision is currently lost. > Remembering to support a variety of build configurations is already > tricky enough, so maybe this will help prevent some subset of bugs. > Or would it not be worth the effort? I expect the benefit will be fairly minor (which is why I haven't looked into it). But don't let that stop you ;-) Stefan