From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: master 927b885 1/3: Disable filtering of commands in M-x completion Date: Thu, 18 Feb 2021 16:25:45 +0000 Message-ID: References: <20210217165944.26910.26583@vcs0.savannah.gnu.org> <20210217165946.030D420DFC@vcs0.savannah.gnu.org> <87blcih3ar.fsf@mail.linkov.net> <87sg5toh2y.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10573"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Stefan Kangas , "emacs-devel@gnu.org" To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 18 17:28: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 1lCmA5-0002es-Vn for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 17:28:18 +0100 Original-Received: from localhost ([::1]:54794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCmA4-0006pl-Tn for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Feb 2021 11:28:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCm7n-0005Xj-Bt for emacs-devel@gnu.org; Thu, 18 Feb 2021 11:25:55 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:43052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCm7k-0006KY-Fm; Thu, 18 Feb 2021 11:25:54 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11IG9Em3114108; Thu, 18 Feb 2021 16:25:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=SLTISRiWwDpUEYsj0jAqtfQLiy01tcwuXeNv+5if0Zk=; b=FXevz6l5xmwDg/iNvUabtT4i/1vif+qPcsSy6gHPUw7EICh6y5Xu2zR9EcBlRABMp92x MP5P3Q/jrWooVVpFqILLwz1LKImW+s/FJgITKHaVIQhiWvjrPTZ3w3cLp8VGn8xheG4d LnlrCNacpwfwhIErnQKA8ejf+r6eBhoKHI0RM74lohryjNpVhf+pF9JzH6N2GIae6tR/ X+Y6V/Devr+KmK3uiEhjvD8EudQvTaJ6/gxFRtLcZNh8b70TGh1J7KB9LsE6yJYu6INm 0sLv0js5VA3W3ut6apRPYF6lKcsmmD0XA2zFwbyD+iM+6E8jtnzNdHDJ+LIC0SoZwOjN kw== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 36p66r6hm3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Feb 2021 16:25:47 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11IGACmP127745; Thu, 18 Feb 2021 16:25:47 GMT Original-Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by userp3030.oracle.com with ESMTP id 36prq0pe02-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Feb 2021 16:25:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAPyNNAUKJ77z2QneHLN+uooRtftUhGiDgrqL4+rrCkmhua5oxfHjpGO/ppmAZGgha1HSJDbISRu47LVMZ3rclAM+TwVAUA8o7JmvHJ9wJfHPWQhXlXPFjYRE5D5azYFaha2hMH1n9LrdIIkinr0lDH3rlz+g+eGhwizv7knOcLoWFc8CJwUOHFj0S/ULw3YTZHLlLd7hEgjZClm1+pQ1Z69oX4aymjVNpm/2urBNzUR1KTgHzPv52C6/8VizIwbllV3r2DCir1ViygyHJ6sxD9MWH+XjfY7e+ptNGaWd+yzHW8arG+RjqWH/1RT6ZqMEJKsRVQnGDYpQmGNInoJ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SLTISRiWwDpUEYsj0jAqtfQLiy01tcwuXeNv+5if0Zk=; b=QHxfBhFCVMQHbiqBe/b94r/ZditLRdns2vE5DavHdX2RN4a8v4xAymV7nlO7Si2kvtUNuI6Nz5SdvqT2jLZ5VJ7ePrMQL0SwCef7OTEFpTU6PDwOMpjU6VAVh62f+VorXkL7DNEIwCKNuH5xbfWr6yOcdFZ2dGGY1uCBPFs6OK0tjgP58wVpCFm5W5Y1jlbAxbaeTFVLQ2JY/g0qGsx3EVuHi3m55241NXu3XzM0hQV6fZtBCaWyqh9p80j8f0kXTIHuse+poh0OxEEd1YwFZNM56WPZW1qsJx4RcxX49X3XO/howO67OMsnJ7BsTssLTgDsB49nf8ZWYMG5HTgcXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SLTISRiWwDpUEYsj0jAqtfQLiy01tcwuXeNv+5if0Zk=; b=mt+Tsbs3qk6e8BHJALTkwVnJTYtsE/o091ewgMt15LPt+Alvq3x9/8LS05G3UZTrYfpeNEeAVZqXYy290cXWi8RCRSerr7WgOXzABhQmiYzLX0CvX4le6F7inwRaWLgpw7ZI4YgU+kdsnyytUcFdgjy3zd5v+WR/3OwMFoi0Elw= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SA2PR10MB4523.namprd10.prod.outlook.com (2603:10b6:806:113::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Thu, 18 Feb 2021 16:25:45 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315%5]) with mapi id 15.20.3846.043; Thu, 18 Feb 2021 16:25:45 +0000 Thread-Topic: [External] : Re: master 927b885 1/3: Disable filtering of commands in M-x completion Thread-Index: AQHXBdveyu8rBhrJ8ke/u4USPEk766peE8Ow In-Reply-To: <87sg5toh2y.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US authentication-results: linkov.net; dkim=none (message not signed) header.d=none;linkov.net; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be730a3d-41f4-4415-aece-08d8d429d80c x-ms-traffictypediagnostic: SA2PR10MB4523: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tHTlW3QCM1Etbm5tLq6bUgLjc2v9V+S5P+qBHTWFtv1n/E08BAHLuy5xPtrH9NJ9tszv6b33eUsjdvERhMAhQMtkHZszmHGLCDLCmUo12ilG098qz7V22qtvdfhoUTL7oAQDMUo2Ff4c/LxzpQAs8rz8vF4z3c0LHnpY4mNcUuMarrbWuGPh8auDeBtO45YLvx7IxMt55AAQUvizTpTyED+3xC+yagOPDKZVibwnGocaSfAJ7RW618s/elUoUQuogirRNdczC+ROqB3BfwcGbu7E6tHWuOOgbMi5PQXVMgsrAMMor4j9qxataPDYXFuSvSkfGQCYcbS3P2HCn8c/+Ba0LPlSBeiaJJ6JCiBSzubLznE2B1B0B1eKhsVNspobiScqzRiknfQtgsMwOyv61rGiMXGd2Qu86678psI1AsyO5NJz2J9h7SflXpdfLazDfgt83q9+6aqzzVu26mUZzofngfZf5514XmNrM0AKeHwFgshbh6pocdel8Xj+hPvQ/DoNH9u4quyn23d8q8/GhA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(396003)(376002)(346002)(39860400002)(66556008)(64756008)(52536014)(66446008)(76116006)(71200400001)(83380400001)(54906003)(66476007)(44832011)(6916009)(4326008)(8676002)(6506007)(66946007)(33656002)(186003)(8936002)(9686003)(26005)(5660300002)(7696005)(2906002)(86362001)(316002)(478600001)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?gIcELnw6KNM2F7OaNXcn6edA4HSGLopZT+/OTg4eoCbDt3u/craX4RQcHaEv?= =?us-ascii?Q?VEcZHRT2SGbtrI44Yc4CgMFdTIWuac7KyxqVCOTxUux4jA4jsd6ieqWowKr6?= =?us-ascii?Q?U8Tscb35yINnBYapy+fSOF7F4CoMjXYssGTG/KWwF7BOQlyoZI9QgZTijpKi?= =?us-ascii?Q?O6DJnpuKxBb9BE3cNY6ianUgRdLtWXE+ReA2Z/5dWKwxJv800XzyUUEjb+wj?= =?us-ascii?Q?BnYGEtAZS4mMvFfzVwljsp2wAoYD9SkkrptpDcVWUK71zZTo4COq+D2ZsemV?= =?us-ascii?Q?5DJfEJv2gegSTAQmfuaIqTNhO7brxIXR2YW0Ufr7mX5FBz+taxoqxR8R6af4?= =?us-ascii?Q?yrioGcBJ408py8dFOVb+K4UPo+g9Hz4enp7ug+At0dS83+nvlH+qB1fMT+bd?= =?us-ascii?Q?yOKMOFFC/OTQCvAewrloaIvEICROVBkv5ZqMlG+jdDf478OLPycIJphfyEMX?= =?us-ascii?Q?kIZVkKeGVWXyhMbRn46EfCk+DzQJkGOO0SVKIMTFq3t3bNWw4iqlFZbxxk7j?= =?us-ascii?Q?r2k5r+/BAcmxx23xuYQo/wQcZGqX4ZKEsuZ57kb6fpvjovEN85GNslkjaNgA?= =?us-ascii?Q?KKvz6fLU5gfXvSrZkeuB1647CdNvKmClEv3TBbMcC0oAaw+2EgAkIfRoRZvw?= =?us-ascii?Q?Mz+f x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be730a3d-41f4-4415-aece-08d8d429d80c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2021 16:25:45.5078 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ocxIQwb0hVJURjSHwKYMPvyFw9AhIXBqrDerBOIkN4hDzF5MTM2csC56J2GVzjc5OTyXLQuOGPWT5bolftDbEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4523 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9898 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 phishscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102180140 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9898 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102180140 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:265160 Archived-At: > >> 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. > > > > Are you sure they raise an error? > > > > (defun foo (&optional beg end) > > (interactive "r") > > (message "FOO")) >=20 > Yes, I'm sure. 'M-x foo RET' without an active region > raises an error: > command-execute: The mark is not active now I don't see that in Emacs 27.1 or prior (with `emacs -Q'). Is this perhaps new for 28? If so, why would we do that? `interactive' code `r' gives you the region limits, regardless of whether the region is active - which is TRT. I don't understand why this should now raise an error (even if `r' gave you the limits only when the region were active - which it shouldn't). And certainly in a case like the example I gave, where the args are optional. I don't see the motivation for now raising an error. > > I also think it's misleading to base filtering on > > an `interactive' form that uses a string. That's > > inherently fragile/limiting. It won't apply to a > > form that evaluates a sexp to provide the args. > > The resulting incoherence will confuse users. >=20 > This means that more complex interactive specs > need manual tagging using a new tag: > (declare (predicate (use-region-p))) That's not what `r' has done forever (up through Emacs 27.1, at least). It's never been only about the _active_ region. Anyway, that's only for `r'. You can no doubt propose something for other `interactive' codes. But even that won't handle arbitrary `interactive' sexps, right? `interactive' can accept a string arg, which, in effect, has its own, parsable language. So you can try to parse, and try to do some somewhat relevant tagging based on that parsing. But `interactive' is much more general than what's represented by that string-arg language. Trying to base your tagging on `interactive' seems fundamentally flawed/misguided. > >> Also filter out commands with "*" in read-only buffers. > > Same problem. Relying on a string arg to `interactive' > > is not a great idea, I think. >=20 > Same tag: > (declare (predicate (not buffer-read-only))) And what about commands that might be usable interactively, but whose `interactive' spec doesn't encapsulate all that's involved? In that case, manual addition of a declaration will need to look into the logic of the command body as well. (Admittedly, such commands are uncommon.) > >> `describe-command' is a very good idea for searching > >> and discovering commands. > > > > I mentioned that I defined that long ago. But I'll > > also mention that `describe-function' with a prefix > > arg already gives you that behavior. Oops! Nope, > > that too is something I defined long ago in > > `help-fns+.el'. > > > > Similarly, I defined `describe-option', and a prefix > > arg to (my definition of) `describe-variable' limits > > choices to user options (like `describe-option'). >=20 > Using a prefix arg for 'C-h f' and 'C-h v' to limit the list > of completions would be nice. >=20 > But I guess M-x can't use a prefix arg to limit completions? Why do you think so? `C-u M-x describe-function TAB' (with my definition from `help-fns+.el') shows only commands as candidates.