From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.devel Subject: Re: master a30781399b3: * subr-x (eval-command-interactive-spec): New function. Date: Tue, 06 Jun 2023 12:18:27 +0100 Message-ID: <875y80g7p8.fsf@melete.silentflame.com> References: <168595059426.2523.2109338263713299231@vcs2.savannah.gnu.org> <20230605073635.19060C00613@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 06 13:19:22 2023 Return-path: Envelope-to: ged-emacs-devel@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 1q6Uif-0008Hy-H6 for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Jun 2023 13:19:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6Uhu-0006PX-FW; Tue, 06 Jun 2023 07:18:34 -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 1q6Uht-0006PH-Bi for emacs-devel@gnu.org; Tue, 06 Jun 2023 07:18:33 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6Uhr-0002Bt-Rq for emacs-devel@gnu.org; Tue, 06 Jun 2023 07:18:33 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 891345C0178; Tue, 6 Jun 2023 07:18:30 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 06 Jun 2023 07:18:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc: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=1686050310; x= 1686136710; bh=R/gPJqrwduAkCOEP8y26wLsOeP0GY9prBL5vlxQhoBU=; b=G IfiwzTQy/Uq7AayA+41hxGc0tyH01tv6r5b5+FdGklFkz8ZJUl9IBw4J3HzqoQQ4 Cw+wRMf36ATs0PwCSJTQAi3TrCC8bY1f8CQRvi2z7j4p7/E65levgzkTwV4oz97x i4Uu91X7U1QRGQNgU4Gup5i3tOhKeLsc99inc/+9UDoVjYMwgzkdPpus09h+uMi4 ZaaAT3wn4ERuZ3tjnPGtVQFtt2EBh44TIgP6IoEv3TH5AgYT92QIFI1WYhFMFD5M 5gfFHVftVxPNZzhj28LJU3iWBYfV90U3jTwnoALHM4a+6opqPkzAdOZ0IaFG0Cwl +IJ6AtD3I1GLI5qMGZMzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm1; t=1686050310; x=1686136710; bh=R/gPJqrwduAkC OEP8y26wLsOeP0GY9prBL5vlxQhoBU=; b=XTk51rDLyhqA+tqq1zjoWTRuzUGvZ OsL8J3eDMRaouJNqH/8TcFEJ4atve5uqjMPk1nxhid4FqGMd4fvYmBr/vKnbBcDg p7oLqrj9LSYBENxt56Z0GuNMAta7P2Zng/SNLJSS1uDT4YK888iSAmNhLPNWLyDD I3UPeVhrjXtL6k9BGCr1eu+BVvZbkgPehpauXGw+bSmTlH2MGT9L7Pr7LaGxJ41S 0LqVIMOYj0hfueVbhttEQhGbExro8Wo1H5sl//b/AbBc7der0g9x4JR5/6H1W0O5 Sq9kh8FiMQb+3u8VgG+hEC34we2+o1bsqhmUxB+FgZUyrtLS9N5QVp2iA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtuddgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkfgggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpedtffdvffeuleeuvdetkedvveehgfehvdegvefghfevudek geegleevgeejkeetkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i23c04076:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Jun 2023 07:18:29 -0400 (EDT) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id C927E7E42F6; Tue, 6 Jun 2023 12:18:27 +0100 (BST) In-Reply-To: (Stefan Monnier's message of "Mon, 05 Jun 2023 12:14:24 -0400") Received-SPF: pass client-ip=66.111.4.27; envelope-from=spwhitton@spwhitton.name; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306662 Archived-At: Hello, On Mon 05 Jun 2023 at 12:14PM -04, Stefan Monnier wrote: >> * subr-x (eval-command-interactive-spec): New function. > [...] >> +;; FIXME: How about renaming this to just `eval-interactive-spec'? >> +;; It's not specific to the advice system. > > Agreed. > >> +(defun eval-command-interactive-spec (command) >> + "Evaluate COMMAND's interactive form and return resultant list. >> +If COMMAND has no interactive form, return nil." >> + (advice-eval-interactive-spec >> + (cadr (or (and (symbolp command) (get command 'interactive-form)) >> + (interactive-form command))))) > > Why the `get` business? If we want that, it should be in > `interactive-form`, no (and AFAICT it is there, BTW)? I missed that interactive-form already handles this. I've dropped it now. > And why is that preferable over `(advice-)eval-interactive-spec`? You mean, why is it worth factoring out (advice-eval-interactive-spec (cadr (interactive-form command))) ? Well, it's indeed less worth factoring out now that you've pointed out my mistake about interactive-form, but it seems seems worth it to me on balance. -- Sean Whitton