From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: master 927b885 1/3: Disable filtering of commands in M-x completion Date: Wed, 17 Feb 2021 22:01:16 +0200 Organization: LINKOV.NET Message-ID: <87blcih3ar.fsf@mail.linkov.net> References: <20210217165944.26910.26583@vcs0.savannah.gnu.org> <20210217165946.030D420DFC@vcs0.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="35990"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 21:16:18 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 1lCTFC-0009ES-17 for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 21:16:18 +0100 Original-Received: from localhost ([::1]:38782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCTFB-0003Oo-2s for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 15:16:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCTD7-0001y6-Me for emacs-devel@gnu.org; Wed, 17 Feb 2021 15:14:14 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:38959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCTD4-0004xg-DO; Wed, 17 Feb 2021 15:14:09 -0500 Original-Received: from mail.gandi.net (m91-129-96-116.cust.tele2.ee [91.129.96.116]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 97D6220000C; Wed, 17 Feb 2021 20:14:03 +0000 (UTC) In-Reply-To: (Stefan Kangas's message of "Wed, 17 Feb 2021 11:27:11 -0800") Received-SPF: pass client-ip=217.70.178.232; envelope-from=juri@linkov.net; helo=relay12.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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:265077 Archived-At: > I think we should take one of the below actions: > > a) Add a key to show the unfiltered list of matches in `M-x'. > (We could use any key, but how about just using `M-x M-x' to show the > unfiltered list? It would affect recursive minibuffers, but we could > just require a third `M-x' for that.) > > b) Add a new command, e.g. on `C-x x x', that always acts like the old > `M-x'. > > c) Both. Also maybe a key to toggle filtering in the already active completion (and a key to toggle sorting). > I have never understood why Emacs suggests commands for execution in a > context where they will obviously fail. I think this is a glaring > deficiency in our default UI -- you are proposed useless commands (that > won't work there, will screw up your buffer, etc.). No longer doing > that is in my view a big step forward for Emacs usability. I have no problem with unrelated commands displayed by M-x, but for the new option I'd like also to suggest to filter out commands having "r" in their interactive specs - they signal an error when the region is not active, so no need to show them. Also filter out commands with "*" in read-only buffers. > From the discussions we've had so far, it is my understanding that some > like to use it for searching for and discovering commands. That is fine > and valid, and reason for having an option to opt-out of this behavior. > (I also think we should add a `describe-command' to try to better cover > this use-case.) `describe-command' is a very good idea for searching and discovering commands. > Footnotes: > [1] Some modes are prudent in saying: > > (unless (derived-p 'foo-mode) (user-error "Nope")) > > I think up until now this has often been the right and safe thing > to do, but it has unfortunately been severely underused. Yet it > still has the deficiency that the command will show up in 'M-x`, > and it provides no fire-escape. Isearch mode uses such idiom that when an internal command is called when Isearch is not active, then it's activated before the command is executed, with such a guard clause: (unless isearch-mode (isearch-mode t))