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: cl-lib warnings (was: bug#60102: Move gv-expander of substring to cl-lib) Date: Tue, 20 Dec 2022 13:42:32 -0500 Message-ID: References: <86o7s3lsnx.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19014"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 20 19:51:25 2022 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 1p7hi0-0004hh-Tp for ged-emacs-devel@m.gmane-mx.org; Tue, 20 Dec 2022 19:51:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7hZi-0001YR-6h; Tue, 20 Dec 2022 13:42:50 -0500 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 1p7hZf-0001MD-LU for emacs-devel@gnu.org; Tue, 20 Dec 2022 13:42:47 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7hZd-00024M-U3 for emacs-devel@gnu.org; Tue, 20 Dec 2022 13:42:47 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E631A44115D; Tue, 20 Dec 2022 13:42:43 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3940D440F76; Tue, 20 Dec 2022 13:42:42 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671561762; bh=X2HIAwj5oQSY3YsHIey4hnlFDbLDxhsgkFEun8F4aq0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Kvsm6nia+46Mt/LpWaVbD5hT6NxnnOcLdmHo1IgJDXQq2QK+2kdNSkQsbDwD/xHtG N0UMJoIf+IgoZJUiXBxMOe/YsWjtUxlhLmkalQ5gfrcQTEtvi5KtHbyJdFtpbk47+t J6q0NylfQwG/yZ2jOIksE+wsAaU0djlS9Gw5W+gnpGONjxMLnxp49SMFGxBCHA0Z1Q bpY3U6bO1oMRzzqN9UiDAGi3awz3WL73FNSV3zx6jph1QgIrga2bf4IG7cnqqPYssY 5x++RXE3/vAXC9nGZd29e9DUdgkioSWYZ20oEuQW67erqBxJj6tlVd4GjjGshRcsMr p8VDca3SGLmhg== Original-Received: from alfajor (66-163-28-139.ip.tor.radiant.net [66.163.28.139]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0A8E7120903; Tue, 20 Dec 2022 13:42:42 -0500 (EST) In-Reply-To: <86o7s3lsnx.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 16 Dec 2022 09:22:10 +0200") 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301696 Archived-At: >> The `gv-expander` of `substring` uses the `cl--set-substring` function >> that's defined only in `cl-lib`, so currently, you can compile >> >> (setf (substring ...) ...) >> >> without requiring `cl-lib` but at run time it will tend to signal >> a `void-function` error. >> We could autoload `cl--set-substring`, but I think a better choice is to >> move this `gv-expander` to `cl-lib.el`. > > I tried your patch by evaluating `(tab-bar-make-keymap-1)`, > but it still fails with: My match was indeed motivated by the `tar-bar.el` code, but it doesn't fix the `tab-bar.el` code, indeed. The problem of the `tab-bar.el` code is (well, was, since I changed it in the mean time) that `(setf (substring ...) ...)` needs `cl-lib` but `tab-bar.el` doesn't `(require 'cl-lib)`. It is compounded by the fact that `cl-lib` is preloaded in `src/bootstrap-emacs`, so we don't get a compiler warning about the possibility that `cl--set-substring` won't be available at runtime, since `tab-bar.el` is preloaded and hence compiled by `src/bootstrap-emacs`. And even if you try to recompile it with `src/emacs`, you still won't get a compilation warning if you're using the native compiler, because the native compiler itself requires `cl-lib`. IOW, it's becoming difficult to be warned by the compiler about missing `(require 'cl-lib)` :-( Looking at historical evolution, I think the sanest way to fix this is to preload `cl-lib`. Stefan