From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Making `interactive' conditional (was: Leaving out non-applicable commands on Mx) Date: Sun, 10 Jan 2016 10:22:28 -0800 (PST) Message-ID: <6e3b5001-3d9f-4993-8e79-94fff1c13780@default> References: <87mvszdp6b.fsf@gnus.org> <8737u9kv6f.fsf@russet.org.uk> <87fuy7hdc6.fsf_-_@wanadoo.es> <87bn8vh8q4.fsf@wanadoo.es> <4002fc97-5629-4367-8b8f-48b659fefdce@default> <20160110152710.GB3580@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452450186 19453 80.91.229.3 (10 Jan 2016 18:23:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 18:23:06 +0000 (UTC) To: Alan Mackenzie , Yuri Khan , =?utf-8?B?w5NzY2FyIEZ1ZW50ZXM=?= , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 10 19:22:48 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aIKdb-0002r6-7A for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2016 19:22:47 +0100 Original-Received: from localhost ([::1]:48479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIKda-0000rC-8m for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2016 13:22:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIKdW-0000r4-6t for emacs-devel@gnu.org; Sun, 10 Jan 2016 13:22:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIKdS-00036u-VY for emacs-devel@gnu.org; Sun, 10 Jan 2016 13:22:42 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:29443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIKdS-00036V-O1 for emacs-devel@gnu.org; Sun, 10 Jan 2016 13:22:38 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0AIMU02009913 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 10 Jan 2016 18:22:30 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u0AIMTC1012009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 10 Jan 2016 18:22:30 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u0AIMTiU014219; Sun, 10 Jan 2016 18:22:29 GMT In-Reply-To: <20160110152710.GB3580@acm.fritz.box> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197991 Archived-At: > This might be OK if the only reason you every use M-x is to execute a > command. But it's not. People (in particular, me) use it to discover > Emacs, to find the exact name of a command which has only vaguely > embedded itself in the memory, to get this name into the kill ring to be > yanked into another source file or into documentation, and so on. Try > M-x sometime, and explore the wealth of Emacs commands. > :-) Precisely. (It sounds to me like those who now want to remake/cripple `M-x' might not even be using it to its ordinary potential.) > What do we gain that would offset this loss? What is this > feature for? Indeed, there has been no spec of what it is for, what requirement/need it is hoping to satisfy. > People have suggested filtering by mode, by read-onliness, and so on. > Somebody (I think it was Artur M.) even suggested removing initial > checks from commands, on the grounds that M-x filtering would render it > unneeded. I don't think that could ever be the case. Indeed. It seems like some people do not see why we raise an argument error in the function body, and not just in the `interactive' spec. =20 > > writing code to automatically consider every interactive function > > *without an autoload token* as being conditional on any modes > > defined in the same package (likely determined by prefix matching). >=20 > At which point I see the complexity rapidly increasing, unforeseen Bad > Things happening, and generally a lot of pain. Ditto. And not only because of corner cases or things that are not obvious. Mainly because it is a coarse rule - a hammer, not tweezers or a needle. One size does not fit all. > > Thus, proper UI behavior for M-x falls out by design, and we > > get to make use of conditionality for other purposes, such as > > better errors when command functions are called outside their > > expected environment. >=20 > Any chance of an example of such an improvement? How are we to > improve on, for example, "Can't execute - not in Foo mode"? IOW, please specify the dreamt-of feature in some detail. Hand-waving solicits only "Great idea!" or "Hell no!" - more noise than light. > > I'm open to a feature branch implementing such conditionality, > > as a candidate for merging to master... Before calling immediately for a pilot implementation, how about a bit more of a spec of just what is intended? > Again, what is this feature for? Yup. > Is it going to make editing easier for experienced users? > Is it really going to attract new users, ones who would be > very happy in Emacs but for the huge number of commands > presented to them in an M-x? >=20 > I'm sceptical on both counts. And are there perhaps better ways, even perhaps existing ways, to accomplish the goals? But first, just what are those goals?