From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Smarter M-x that filters on major-mode Date: Thu, 11 Feb 2021 11:05:12 -0500 Message-ID: References: <8ed9b43502ae1480e06b@heytings.org> <83r1lohqoc.fsf@gnu.org> <87wnvfenry.fsf@gnus.org> <87blcrdlqf.fsf@gnus.org> <87v9aydg3f.fsf@gnus.org> <83y2fuheph.fsf@gnu.org> <87im6yd4sz.fsf@gnus.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="34031"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 11 17:06:40 2021 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 1lAEUJ-0008kj-Jq for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Feb 2021 17:06:39 +0100 Original-Received: from localhost ([::1]:42844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAEUI-0003Af-Gm for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Feb 2021 11:06:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAETC-0001eY-9B for emacs-devel@gnu.org; Thu, 11 Feb 2021 11:05:30 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAET2-00060w-VX; Thu, 11 Feb 2021 11:05:29 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E993110025D; Thu, 11 Feb 2021 11:05:15 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 730A2100229; Thu, 11 Feb 2021 11:05:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613059514; bh=TseJFMK+36DvmmDXSIIT3uP/7qdcpZXgAEVUgzU8n/Q=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=cLjJyzxQcpW6l2CF4k6E+nhtbzcvp2+pFj8emGOBchFJl1nhzgn79G0MemYLcn4uL cprd+7QnIBYr7VIOUifLaxu/M03JPar2/6RTkv6lC3ZaK1FI4e4GC3fSayK69rRKue NDm8pB3H6Kg4zArzT8cs0s7l89wlnB5r699Ul2VU2AQWjupBIh8RNWAg/LbPTJlALX cZELP4zj0BxRw2ssgr3AmYlAhd17uOnoFcr0rI81AK43bXItxqFTx+W/iPWD4lZuuW 5+5PJ48bjrcHULOKyUo1JQmjU2zkCg1QDlC6tD2mVs5560xG89FbnG8Z7FKhvPsksg RNzPx3lGBKplw== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CCAA21202DA; Thu, 11 Feb 2021 11:05:13 -0500 (EST) In-Reply-To: <87im6yd4sz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 11 Feb 2021 16:04:12 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:264402 Archived-At: > And since more than 90% of the commands will eventually get this sort of > annotation (I didn't actually count), that seemed kinda inefficient. That's indeed possible, but I'm not sure it will be the case (it seems like a lot of work to get there, unless we can come up with some way to automatically infer most of those predicates somehow, or to specify them "globally" by grouping in the source code commands that share the same predicate, or something). But since you're touching the `interactive-form` part, it's a good opportunity to mention that some commands would benefit from being able to specify not just how to build the arguments for interactive use but also what to do with the result (such as how to display it). So there's a case to be made that we should allow the `interactive-form` to specify a generic wrapper: a function that takes a single argument (the function to be called) and is then in charge of building the arglist, calling the function, and do what it wants with the result. I'm not sure how best to integrate this with the kind of predicates we're discussing here... Stefan