From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73881: 31.0.50; Unexpected warnings about recursive occurrences of obsolete functions Date: Sat, 19 Oct 2024 22:24:57 -0400 Message-ID: References: <86wmi4jh54.fsf@gnu.org> <86jze4j6wh.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18866"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73881@debbugs.gnu.org, Andrea Corallo , Eshel Yaron , Stefan Kangas To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 20 04:26:14 2024 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 1t2Le2-0004ij-CU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Oct 2024 04:26:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2Lde-0007RW-GF; Sat, 19 Oct 2024 22:25:50 -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 1t2LdT-0007R9-8O for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 22:25:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2LdR-0001OU-W4 for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 22:25:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=FG19S5J32nvxyRA4mkyL45Xbb6S8oRXXOyvGe4K934E=; b=JG9TmKX+Yhg949FpApJtge3Jyk38HeFVPQV2Nt6N4vs/V0GhDHmcqR5VNMANRhGlHDsqi3oZt2Buhk+80RSe5l29DgHpxsWkp1sbN36M9nrczSj3ilAexXBdc4XeUgeCuGn/oWjMzZrd8bZrE+q2/X2ETfwGROAeG3yjtf1bd3R0By51FmwjSMulRht8akFwOyxk6Rb1X5SWWC10vfu5ywMXZ7RMzSJl16XZ2NX5TPMCZPhX+wehl4CVepMHkLYFyrC9nwc+qjdbzRKoDocjKUIWbo8WHMR+D6GmBHWvHLhVWgnD11xTUcUyexoU1H4K4HQ+PidVtAhjUda2RiRbog==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t2Ldq-00021V-3f for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 22:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Oct 2024 02:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73881 X-GNU-PR-Package: emacs Original-Received: via spool by 73881-submit@debbugs.gnu.org id=B73881.17293911397746 (code B ref 73881); Sun, 20 Oct 2024 02:26:02 +0000 Original-Received: (at 73881) by debbugs.gnu.org; 20 Oct 2024 02:25:39 +0000 Original-Received: from localhost ([127.0.0.1]:45267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2LdT-00020r-9O for submit@debbugs.gnu.org; Sat, 19 Oct 2024 22:25:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t2LdP-0001w7-SK for 73881@debbugs.gnu.org; Sat, 19 Oct 2024 22:25:37 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 98405100180; Sat, 19 Oct 2024 22:25:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729391104; bh=tTO0wqeopS7kTTGApvRVvldL2f2rOPPTinkvj1mauUs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IrwQvwv3kD6JUGEAsDwXzBwAYqRDXXPmc10xGav8o/zdqreTh+jDQLz5dN9S7mc+f wJg4nYlgshDgzRnfBCt/up4nhm8OHTv0pq717b7FkS8l9nJ1bOiZbaOE2PN7+ka4bM 4YnrjBbgZkic9B0xxMJBtfUa18AWT6ow86Thj6VzYeRmjLSyfpx2K3xGL9g2JF8e1f eJ1oWVxjdANGBR96GDg6x7K3r8hVknmHmId+pXuoiIP/3WXF+DpJB1B91nQdKzx4fX vXqmZU3h3lD/KAdAWbbOjdo8vaFqqXqB9d5aSDH0OCK0lOkL9IF4wOKhaM8DY5uKlx kFuaeeCEK1M0A== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4A34E100043; Sat, 19 Oct 2024 22:25:04 -0400 (EDT) Original-Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1006512033B; Sat, 19 Oct 2024 22:25:04 -0400 (EDT) In-Reply-To: <86jze4j6wh.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Oct 2024 21:15:42 +0300") 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:293921 Archived-At: >> As for an easy fix, maybe something like this? >> >> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el >> index 29e7882c851..edb8160a250 100644 >> --- a/lisp/emacs-lisp/bytecomp.el >> +++ b/lisp/emacs-lisp/bytecomp.el >> @@ -1533,6 +1533,7 @@ byte-compile-arglist-signature-string >> >> (defun byte-compile-function-warn (f nargs def) >> (when (and (get f 'byte-obsolete-info) >> + (not (eq f byte-compile-current-form)) ; Recursive call. >> (not (memq f byte-compile-not-obsolete-funcs))) >> (byte-compile-warn-obsolete f "function")) > > Thanks, let's see what others think about this. Hmm... I distinctly remember writing code to try and silence obsolescence warnings in the code coming from the same file as the `make-obsolete` call. If I installed that code into Emacs, clearly it's not doing its job. ..Hmm.. I think I see the problem: the code I wrote was for variables rather than for functions: ;; If foo.el declares `toto' as obsolete, it is likely that foo.el will ;; actually use `toto' in order for this obsolete variable to still work ;; correctly, so paradoxically, while byte-compiling foo.el, the presence ;; of a make-obsolete-variable call for `toto' is an indication that `toto' ;; should not trigger obsolete-warnings in foo.el. (byte-defop-compiler-1 make-obsolete-variable) (defun byte-compile-make-obsolete-variable (form) (when (eq 'quote (car-safe (nth 1 form))) (push (nth 1 (nth 1 form)) byte-compile-global-not-obsolete-vars)) (byte-compile-normal-call form)) So maybe we should just do the same for `make-obsolete`? Stefan