From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Smarter M-x that filters on major-mode Date: Thu, 11 Feb 2021 00:02:54 -0500 Message-ID: <79F95080-50A7-4B34-B8FD-8EE3B5DC6728@gmail.com> References: <8ed9b43502ae1480e06b@heytings.org> <83r1lohqoc.fsf@gnu.org> <87wnvfenry.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) 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="40185"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jean Louis , Stefan Kangas , gregory@heytings.org, emacs-devel , "Alfred M. Szmidt" , Matt Armstrong , Lars Ingebrigtsen , Eli Zaretskii To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 11 06:04:19 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 1lA49L-000AKw-1U for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Feb 2021 06:04:19 +0100 Original-Received: from localhost ([::1]:41388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lA49K-0003c0-3p for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Feb 2021 00:04:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lA487-0002jQ-DE for emacs-devel@gnu.org; Thu, 11 Feb 2021 00:03:05 -0500 Original-Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:42665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lA481-00079K-Fh; Thu, 11 Feb 2021 00:03:03 -0500 Original-Received: by mail-qt1-x82d.google.com with SMTP id e15so3351262qte.9; Wed, 10 Feb 2021 21:02:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9LPO6erTzTKX3esOSWvlanSTi2kGJ4PNyc5vLMkU+A4=; b=AGjqhvyFdBURlDKb9BZ3rGA3OhofE0XsdkvqqFQVqRH+xFbkE3WacIijMKuN8n/zNB RqUFJ5R34rVcZXaVIKz0Eb5JgbFLvWMOS6PBIMMANmNmGaG3OwIK5XuVirSneemnLi40 oo8u6d+27RykTygYhGwRDlskG/qCnyjaXEmE6Rs3DD4qTYbIDynQhU++bUFxLWXDvRJL nYUnpSA8qq/l3V6tLA9pZzv9PvR8QB5Jsb7GzXdYKe9R0asTFmZgpnoHsXtntfUT1+eY kvgPSZtWgkquLnTmFRwOGaY7qggKd+qJr7uIbtks1lkdRZ0yXHXttL1Ialu3Fw0bVg4v DzYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9LPO6erTzTKX3esOSWvlanSTi2kGJ4PNyc5vLMkU+A4=; b=hLapm/j1qHbd/EbNNDwsCIAvssvI0d8O/f8Cr3NROmqF25jKxwKexyfjVoPpTFP+yQ YzRY3OdKrAwD15AZKMxuRS3uB27/jGlnqbGiCPsMStXxxL4+qMGbq0G9wSXfhhUhgDke LolHW0COD+yBDdbtoOOZuc92EUYu7gZoR7nSB+fymwFq0/3b/9kvXkqPFxo6hBB+VCPl iLwvHchnF/PX4tMyPj68mOXjyPUkss5Q9cTOCeLt7o4WICrpInSBdVii1ixQ4pb0/ceu bjLpK+QvYakcsdSS4QUhCt6N6uP2uWPCnve0uotfWZetioGqQtebiV2DCLlwjNyF1udO H5Kg== X-Gm-Message-State: AOAM5335oQ9ePg1URtmvzsFSh/WYGGEV1SB9rJymv5DkNqstfRFYkCpe rhRoqx5kuINSk1o1dwE2u30= X-Google-Smtp-Source: ABdhPJyTH79goXqef20C1c9FolgxDT0ZuN6uoz8PE1+ae2kTPRA4E0MIE61nS8ifJhZronYnpkCmew== X-Received: by 2002:a05:622a:183:: with SMTP id s3mr6146697qtw.223.1613019775745; Wed, 10 Feb 2021 21:02:55 -0800 (PST) Original-Received: from ?IPv6:2601:98a:4200:9210:c4db:a4dc:ebbc:cd97? ([2601:98a:4200:9210:c4db:a4dc:ebbc:cd97]) by smtp.gmail.com with ESMTPSA id i7sm963421qke.5.2021.02.10.21.02.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2021 21:02:55 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=casouri@gmail.com; helo=mail-qt1-x82d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:264349 Archived-At: > On Feb 10, 2021, at 10:44 PM, Stefan Monnier = wrote: >=20 >> It would indeed be very useful to provide a mechanism to exclude >> commands from M-x that are useless outside of their major mode. >=20 > 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 ... >=20 > That should be a very easy change to `execute-extended-command`. >=20 >> 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. >=20 > 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. >=20 >=20 > Stefan >=20 >=20 Another idea that I once had is that to make a special M-x such that it = only contains some selected commands, and as soon as there is only one = candidate left, it is immediately executed (without pressing RET). This = is somewhat between a keybinding and normal M-x. Yuan