From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65797: `buffer-match-p` should not use `func-arity` Date: Tue, 19 Sep 2023 19:13:40 +0300 Message-ID: <0371b6ff-58e4-961e-29c9-4efb65b82185@gutov.dev> References: <87v8cmct9b.fsf@breatheoutbreathe.in> <87sf7o38g1.fsf_-_@posteo.net> <871qf1rbdo.fsf@posteo.net> <87o7hz4zg2.fsf@posteo.net> <87sf7b8ker.fsf@posteo.net> <87y1h2blxq.fsf@posteo.net> <874jjqb715.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38069"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Joseph Turner , Stefan Monnier , 65797@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 19 18:15:23 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 1qidNf-0009Wi-Rz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Sep 2023 18:15:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qidNH-0006W2-Nv; Tue, 19 Sep 2023 12:14: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 1qidNF-0006Vg-C3 for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 12:14: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 1qidNF-0006Fh-3H for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 12:14:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qidNN-00035c-Ko for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 12:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2023 16:15: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.169514004311785 (code B ref 65797); Tue, 19 Sep 2023 16:15:01 +0000 Original-Received: (at 65797) by debbugs.gnu.org; 19 Sep 2023 16:14:03 +0000 Original-Received: from localhost ([127.0.0.1]:57703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qidMQ-00033t-Ct for submit@debbugs.gnu.org; Tue, 19 Sep 2023 12:14:02 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qidMM-00033L-J1 for 65797@debbugs.gnu.org; Tue, 19 Sep 2023 12:14:00 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 496915C0185; Tue, 19 Sep 2023 12:13:43 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 19 Sep 2023 12:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1695140023; x=1695226423; bh=TSTfNluyl9Cent2/STidE9QqeShvOXquBHs VOWrQLxk=; b=drtAbrQJXcPn3X+VQC/VmLJDNSggOATA5hOFyS+wt5axdom9F8r zU3VrvzSkneco1K5caTKt+mAiyuWQlDRP+cySKoX2fLu/wTZ2zsXJaOgNxZe+cLl 5gyNFuPmBiifvbQjaA+hJhR7UwUXtErZC3hBGrHK/cdU6qM7wXHiP8al18WIVBl9 L/2JUmTBsRmV1Fv4fDAUhQLFNMpuXdGVq4iJR+PgKoZ8Tw4IRaP4Q6ePZU4zLj4N hal69bxefiDlheLBPNGXGAGGiyrQ8Sre+z2Y2ZpiL+TYzDAganBwyiHhOeuPxPfv Iua6YXObXkZsbXz0zcjwbmdUOay/cDXjpOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695140023; x=1695226423; bh=TSTfNluyl9Cent2/STidE9QqeShvOXquBHs VOWrQLxk=; b=Ud/NTo/RyBpnUH8hnuE4DFCA6Za2A1rxzq0pB9v2k9mfjGmDTzS JkVeoX6JFUrxQNmgZa91tOimBI0lK5Dnk3XeXctKqnX3tQu4GP1kSmNh57qr9e0q K4nxiz4uq4RNqFzXTEkqdIU2y5OUx4JnLrnhOYDzQ3tnWrl6+cXtlujleeGmGX5k /283gCoIc8h8xd/AMqoEP/H1HcRgYQBDhHzmqDOHMTugBJ6i4Ulfyw+u9TJGp9Zf 86e+xG+GlciJjzO6El2+R7hgDWiJ0IM8d5o+HZFJ4wDx9/2nJ4skpnvy+jN4hS3k XWM21x8lOvGUt+VY0k+6GBXt1MQU7vb6YCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudekuddgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Sep 2023 12:13:41 -0400 (EDT) Content-Language: en-US In-Reply-To: <874jjqb715.fsf@posteo.net> 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:270885 Archived-At: On 19/09/2023 16:56, Philip Kaludercic wrote: > Dmitry Gutov writes: > >> On 19/09/2023 11:34, Philip Kaludercic wrote: >>>> [ BTW, changing the code to use `&rest args` instead of `&optional arg` >>>> would help for this, right? ] >>> How come? >> In project.el buffer-match-p would be called without an extra >> argument, so the predicates would be called without an extra argument >> as well. >> >> That should take care of that compatibility, I think. > But what does that have to do with &rest vs &optional? Stringly speaking, nothing, because you can manage the same scheme with &optional - just dispatching to pred with different number of arguments depending on whether the &optional arg is nil. Though that breaks a little when nil is a meaningful value (probably a rare case). Rewriting the function in terms of &rest just makes this solution the most natural one, I suppose. Though we'll still have to document the distinction in the docstrings of project-kill-buffer-conditions and etc (the number of the arguments called with).