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: [External] : Re: command mode-specificity [was: scratch/command 064f146 1/2: Change...] Date: Wed, 17 Feb 2021 11:12:28 -0500 Message-ID: References: <87tuqbft57.fsf@telefonica.net> <87im6rndo0.fsf@gnus.org> <87v9aqn5eq.fsf@gnus.org> <87r1len1j9.fsf@gnus.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="2758"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: =?windows-1252?Q?=D3scar?= Fuentes , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 17:13: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 1lCPS3-0000bp-Gm for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 17:13:19 +0100 Original-Received: from localhost ([::1]:32992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCPS2-0005cj-Jj for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 11:13:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCPRL-00058A-W0 for emacs-devel@gnu.org; Wed, 17 Feb 2021 11:12:36 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCPRJ-0000Wh-BD for emacs-devel@gnu.org; Wed, 17 Feb 2021 11:12:35 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 03AE8807CB; Wed, 17 Feb 2021 11:12:32 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2DD9E80052; Wed, 17 Feb 2021 11:12:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1613578350; bh=CCJ1Xp2OR9AfjSAT0Gb6jMg6QW6QxxdZFNA1d4kUxdE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ywfc6wfgtpEx0SmzmMx5plOQSgnMUiNoWVU/H4gSe21Zxui1AEr8kcqsP8p4tj4KA gDByajRxSJJ7NQ4xVEC7RanJg1t2LrXDxjVEYWk+SUu8QsQI0/DPIUzL0w2PiVA39f Hm3ULkAMous6llOLFPYHO3vWVkEgFZgkzkMsnsF/UM0oE02ydzOv5LIZYfUwxudKY9 rqaQuhxDjTUNd5XzkgKv2X5U67l3bLqdsveBAiyjoV9f+QFYKH2xlKIZPFyB1r/ien sIS32dTXn5V+7k+qGjC4E7AUvAfn9hp/I5gNibeYO8h1jDeyPyOumciZ9UKXmhJk7o 4KvGSZpeSqiiw== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E57591204BD; Wed, 17 Feb 2021 11:12:29 -0500 (EST) In-Reply-To: <87r1len1j9.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 17 Feb 2021 16:42:50 +0100") 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:265013 Archived-At: >> I think it would be good to try and clarify what should be the >> criterion, and not in terms of "should be listed in M-x" since that >> inherently depends on opinions, but rather in more technical terms that >> depend on what the command does. >> [ A bit like with docstrings: we like docstrings that say what the >> function does rather than when/where it's meant to be used. ] >> >> Maybe something like "would inevitably signal an error"? > > I don't think there's any hard and fast criterion that can be used, > though. That's what I suspect also, but I think we need to try and "formalize" this at least to the extent possible, so we can decide whether a given problem is due to a tagging-error or to an incorrect expectation on the side of the user of that tagging info. > For instance, there was one mode I tagged up that had a > `foo-quit' command, which just buried the buffer. Now, that's a command > that can work anywhere... but the reason it exists is presumably > because the person who wrote it either missed out on inheriting from > `special-mode', or didn't know you can bind `bury-buffer' directly, or > whatever. I know exactly what you mean ;-) [ BTW, the better course of action in those cases is of course to mark those commands obsolete and derive from special-mode (or at least to align the code&behavior as much as possible with that of special-mode). ] > Now, lots of commands do, indeed, signal an error outside the proper > mode, or completely mess things up outside the proper mode, and those > are no-brainers. > > I'd planned on writing a little essay for the lispref manual about this, > once I'd gotten some more experience, because it's not immediately > obvious what's the right thing to do until you've evaluated a few > instances. Great, looking forward to it. BTW, I think you can already put something in it and refine it later on; for the benefit of other people who might want to help the tagging process. Stefan