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: Wed, 10 Feb 2021 22:44:03 -0500 Message-ID: References: <8ed9b43502ae1480e06b@heytings.org> <83r1lohqoc.fsf@gnu.org> <87wnvfenry.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33661"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: bugs@gnu.support, "Alfred M. Szmidt" , emacs-devel@gnu.org, gregory@heytings.org, Matt Armstrong , Lars Ingebrigtsen , Eli Zaretskii To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 11 04:46:15 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 1lA2vn-0008di-4R for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Feb 2021 04:46:15 +0100 Original-Received: from localhost ([::1]:34028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lA2vm-0007pR-6D for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Feb 2021 22:46:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA2u2-0007Hi-W1 for emacs-devel@gnu.org; Wed, 10 Feb 2021 22:44:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA2tl-0005U7-I0; Wed, 10 Feb 2021 22:44:26 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CF327440C21; Wed, 10 Feb 2021 22:44:05 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8CDF0440BF0; Wed, 10 Feb 2021 22:44:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613015044; bh=M8fGF19IYUgqHT8YXPJ8htvQNQuV9NaeE5g1vU91Oss=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Vh6t17v71EfpknccrKGtv3t7QVHhNHI6xNftWzta5q1JwEjFYEVkaX/Kqsbew1GRw TGX0mRR8rUlKITU4PhRhhI92X4ARIQdEtoIq/VsIHCdMA+1yiSVCm6vX0k+HFWIABH i4cgbCIpjg3wpSLlWcKK/uEkQwcc+BLFFlegohCGFx+hJemLabKSweOKy3gcMv67dj ZDdzdgwkKxS9Kg6QYRsvG/bbL/o2R02vZdoUXubuEYJ9wPj7B23ig2koqiKkAQfApt D7ZCxY/ONP4t0hMo5XBNLijMxIo+YhvF8/EIRHtghxTEQ9wgNonzlls16FowVWg42g 7DoC4GnUJTPRw== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 378151200B7; Wed, 10 Feb 2021 22:44:04 -0500 (EST) In-Reply-To: (Stefan Kangas's message of "Wed, 10 Feb 2021 20:50:10 -0600") 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:264347 Archived-At: > It would indeed be very useful to provide a mechanism to exclude > commands from M-x that are useless outside of their major mode. Similarly, you may mark some commands so they're just never available to `M-x`. This could apply to some major and minor modes which are only meant to be used "internally", or to commands which only work when provided with a mouse event, or ... That should be a very easy change to `execute-extended-command`. > I've had a related idea to make `M-X' (a.k.a. `M-S-x') run a version of > `M-x' that *includes* only commands that are specifically relevant to > the current major mode. This would be used when I specifically want to > do something in my major mode, as opposed to looking at the gazillion > different entry points for things like calendar, gnus, or tetris. Yes, there's clearly a lot of room for improvement. I moved that function to ELisp to make it easier to hack on it, and I'm still hopeful that Someone=E2=84=A2 will make use of it. Stefan