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#67034: 30.0.50; Make `derived-mode-p` take a single arg Date: Thu, 16 Nov 2023 17:38:00 -0500 Message-ID: References: <96367d39-4861-41e6-9383-a9a18efa0678@daniel-mendler.de> 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="22114"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67034@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 16 23:39:13 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 1r3l0y-0005aT-K7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Nov 2023 23:39:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3l0q-0000Ns-4Y; Thu, 16 Nov 2023 17:39:04 -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 1r3l0o-0000Nh-Qx for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 17:39:02 -0500 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 1r3l0o-0002ZS-IS for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 17:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3l0o-0003No-D3 for bug-gnu-emacs@gnu.org; Thu, 16 Nov 2023 17:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Nov 2023 22:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67034 X-GNU-PR-Package: emacs Original-Received: via spool by 67034-submit@debbugs.gnu.org id=B67034.170017429112945 (code B ref 67034); Thu, 16 Nov 2023 22:39:02 +0000 Original-Received: (at 67034) by debbugs.gnu.org; 16 Nov 2023 22:38:11 +0000 Original-Received: from localhost ([127.0.0.1]:44800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3kzy-0003Mh-SF for submit@debbugs.gnu.org; Thu, 16 Nov 2023 17:38:11 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3kzw-0003MU-P8 for 67034@debbugs.gnu.org; Thu, 16 Nov 2023 17:38:09 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A770380595; Thu, 16 Nov 2023 17:38:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700174281; bh=VSBLW7ykDi6JeEDRGtf0dFpVY72fQ2cjGeO3vourRUA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=UGbubxzMRVyrvASDEaROEI/LFTh0SNSixW6Nw+QtLN6QrYiczLJwXIuIogOitYZId SM1R0MUkDPNvrfJZhnCsIc72vvBeqg2mAgAjj7dxFrCxkLrMETizdnwXHTC4c3++9u XA+9+nuL15xdbMP/Nz+ksQw3RbcAKBi8ipLQDmD4E71v/6dwpzxm92mzc2i9fh8Uqv OSZ7MuF3v5gwVoDRO7QKAk83S5jOwN0gYACsUjwnR2ugO8ZyVxfmVk79wBrxKcXPda 2gqMliRaVwPa+rTVCLePG5/odLbkyWR0Ame9gzKAjKaqKq0WNhEQK1AxjvCcotRlF6 DvMJ4kyS6u2/A== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 859F98076B; Thu, 16 Nov 2023 17:38:01 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5F4A11203EF; Thu, 16 Nov 2023 17:38:01 -0500 (EST) In-Reply-To: <96367d39-4861-41e6-9383-a9a18efa0678@daniel-mendler.de> (Daniel Mendler's message of "Fri, 10 Nov 2023 13:18:32 +0100") 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:274483 Archived-At: > This change would affect many packages. I grepped through my elpa > directory and found multiple uses of derived-mode-p and > provided-mode-derived-p with multiple arguments as shortcuts: > > (derived-mode-p 'mode1 'mode2) instead of (or (derived-mode-p 'mode1) > (derived-mode-p 'mode2) With the new convention the code would be (derived-mode-p '(mode1 mode2)) which seems just as good. > There are also multiple call sites with apply, but these would be > arguably nicer if derived-mode-p takes a list argument as proposed. Exactly. > Still, do the benefits of this change outweigh the required changes? I think they do, especially since we preserve backward compatibility, so the change can be done progressively. > I wonder if this extra allocation of &rest makes any difference in any > benchmark, though. I hope not, tho I've seen several situations where the cost of apply+&rest dominates execution time (mostly because of the time spent in the GC collecting the allocated cons cells), so it's within the realm of possible. Note that the recent introduction of `derived-mode-all-parents` should already have made `derived-mode-p` faster (tho it wasn't the purpose). Stefan