From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#65797: `buffer-match-p` should not use `func-arity` Date: Mon, 18 Sep 2023 17:23:56 +0000 Message-ID: <87sf7b8ker.fsf@posteo.net> References: <87v8cmct9b.fsf@breatheoutbreathe.in> <87sf7o38g1.fsf_-_@posteo.net> <871qf1rbdo.fsf@posteo.net> <87o7hz4zg2.fsf@posteo.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="2448"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65797@debbugs.gnu.org, Joseph Turner To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 18 19:25:10 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 1qiHzh-0000Pi-Lf for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Sep 2023 19:25:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiHzT-0004g2-Ma; Mon, 18 Sep 2023 13:24: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 1qiHzS-0004fu-8U for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 13:24:54 -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 1qiHzS-0003n8-0h for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 13:24:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiHza-00019W-9l for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2023 13:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2023 17:25:02 +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.16950578574362 (code B ref 65797); Mon, 18 Sep 2023 17:25:02 +0000 Original-Received: (at 65797) by debbugs.gnu.org; 18 Sep 2023 17:24:17 +0000 Original-Received: from localhost ([127.0.0.1]:54300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiHyq-00018I-NM for submit@debbugs.gnu.org; Mon, 18 Sep 2023 13:24:17 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:48145) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiHym-000183-4i for 65797@debbugs.gnu.org; Mon, 18 Sep 2023 13:24:15 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A1DAA240027 for <65797@debbugs.gnu.org>; Mon, 18 Sep 2023 19:23:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695057837; bh=w4o5e/JifI1x2Plcut6VnQ9gY+uYEoC9dXS5BrCl20E=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=cG6T0jT6x3PvF5LC7zApnnrb2aOTPrcQq/SXQrqWh+nmDbdGzrzAKb7Wr83U8z3Xg EWLeNa92EPRnsQNDGJPMcfci8p5v5tw0ByXHEbSb5A+cCsEtRplUfFomU5/EqowibI CQDwfHDBkWMNXzHlyMgWWbuhyNYOEplPewaMlIRFoB3Et7P+zO09LkCTYJREjV/Tpv kRhKXWFFEW/DQCLM+OltuEupeumjgsJnC17rBRTUwgElTYw3aIVPfBkFy42JLafmF6 8W+3SzCLMVgquLQp2h51bD8lmEbsHZ7c7r2UrypdwNpMRPYRJogJVu7sfgv9WIy5hA XdPi6ECZ5OeQA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RqBV44sX2z6twC; Mon, 18 Sep 2023 19:23:56 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon, 18 Sep 2023 07:55:32 -0400") X-Hashcash: 1:20:230918:monnier@iro.umontreal.ca::H4ZEzCTVLYI34Jn5:1kjR X-Hashcash: 1:20:230918:joseph@breatheoutbreathe.in::KPOJi46q4VjHZ368:2V35 X-Hashcash: 1:20:230918:65797@debbugs.gnu.org::Wc6tB3MugcbzVz6E:32bH Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:270829 Archived-At: Stefan Monnier writes: >>>>>> 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. I would be disappointed to see this path taken, since part of my hope with buffer-match-p was that it could be used in project.el as well (allowing this to be a thing is one of the reasons I started working on Compat). > - 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). So `(arg1 ,(lambda (x) ...)) and `(arg2 ,(lambda (x y) ...))? Or only one, and otherwise we assume that the function can be invoked with a single/two arguments? > - Live with the occasional breakage and bug reports like the current one. The issue here was related to advising a function. And you are saying there is no way around this, not even by annotating the function symbol with the initial arity before it is advised. >> 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 > -- Philip Kaludercic