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#65797: `buffer-match-p` should not use `func-arity` Date: Mon, 18 Sep 2023 07:55:32 -0400 Message-ID: References: <87v8cmct9b.fsf@breatheoutbreathe.in> <87sf7o38g1.fsf_-_@posteo.net> <871qf1rbdo.fsf@posteo.net> <87o7hz4zg2.fsf@posteo.net> 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="23444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65797@debbugs.gnu.org, Joseph Turner To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 18 13:56:08 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 1qiCrI-0005r9-AI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Sep 2023 13:56:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiCr5-00020B-5T; Mon, 18 Sep 2023 07:55:55 -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 1qiCr3-0001zp-OK for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 07:55:53 -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 1qiCr3-0006ip-GA for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 07:55:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiCrB-00070t-JN for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 07:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2023 11:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65797 X-GNU-PR-Package: emacs Original-Received: via spool by 65797-submit@debbugs.gnu.org id=B65797.169503815326944 (code B ref 65797); Mon, 18 Sep 2023 11:56:01 +0000 Original-Received: (at 65797) by debbugs.gnu.org; 18 Sep 2023 11:55:53 +0000 Original-Received: from localhost ([127.0.0.1]:52297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiCr2-00070V-Tm for submit@debbugs.gnu.org; Mon, 18 Sep 2023 07:55:53 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiCr0-00070E-B6 for 65797@debbugs.gnu.org; Mon, 18 Sep 2023 07:55:51 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 40CFF4424F2; Mon, 18 Sep 2023 07:55:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1695038134; bh=rd0IuHLHsitDBIhqBe4apoCth9TNzyy+Dm0Zfn9cGVA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HchvohwUWpcvm8sDFJUYbhI7lrYARceQG9YtT252NQ6RwZmuR1MCstiDsjANsmRTk taFuSv8qLB++xxgeJBGLZm93jJIRUIWb32nU1FLLF+CsSv3RBBGOPMUU6ovtAGWqdL 3cwAcl+rK5gNSLXQLDf02Gu9pBPvCBTRFSZPqKpML9CfXddJngnw4QhaFCtwcmHbjn 2v+i0/Wny9JM5h6JBMwNdews9nJCMsSOyBAkXWO+K+2bHkCvacKuzkXgBl4w1dNHEN +4b6pgDumkw5FpPyTdqF/bb2XfJ7r6HgWoKBSSAS790TPrLTBkSzRGqBSETYEEWfht GGYKB+/FXjXzg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B7E27441392; Mon, 18 Sep 2023 07:55:34 -0400 (EDT) Original-Received: from pastel (unknown [45.72.220.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8E833120193; Mon, 18 Sep 2023 07:55:34 -0400 (EDT) In-Reply-To: <87o7hz4zg2.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 18 Sep 2023 09:12:45 +0000") 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:270784 Archived-At: >>>>> FWIW The intention here was to be able and specify simpler conditions >>>>> that don't have to handle the alist. >>>> You mean for `display-buffer-alist`? >>>> Do you have examples that rely on this? >>> From the core? No, I cannot think of an example, but any user >>> configuration may make use of this feature. >> From the core would have been good, but from elsewhere (including >> random .emacs config you may find on the web) would be helpful to gauge >> how important that could be. > I don't know of any examples. In that case I suggest we deprecate this feature (i.e. the fact that the function can take a single arg). >>> I am not sure if I just missed it, but is there no technical solution >>> around the advice issue? Couldn't `func-arity' check if the actual >>> function and the advice function have the same arity, and return the >>> right value in that case? My impression is that in 99% of the cases, >>> advice isn't used to increase or decrease the arity of a function. >> There are various 99% solutions, yes. >> There is no 100% solution, OTOH :-( >> So the documented behavior is inherently unreliable. > So what are the options then? Alternatives I can see: - Deprecate the feature with no replacement (i.e. users will have to use a (lambda (x y) (foo x)) wrapper to drop the second arg if they were using the feature). That's my favorite option at this point. - Replace it with some alternative (e.g. provide two different syntaxes for functions, one for functions that expect all args and one for functions that only take a single arg). - Live with the occasional breakage and bug reports like the current one. > Does one have to pick a 99% solution? Hopefully not. The 99% solution (whichever one is used) should hopefully only be used temporarily for backward compatibility while the feature is phased out. Stefan