From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: command mode-specificity [was: scratch/command 064f146 1/2: Change...] Date: Wed, 17 Feb 2021 16:42:50 +0100 Message-ID: <87r1len1j9.fsf@gnus.org> References: <87tuqbft57.fsf@telefonica.net> <87im6rndo0.fsf@gnus.org> <87v9aqn5eq.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="22830"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: =?utf-8?Q?=C3=93scar?= Fuentes , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 16:43:50 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 1lCOzV-0005o9-EN for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 16:43:49 +0100 Original-Received: from localhost ([::1]:32954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCOzU-0007UP-Ev for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 10:43:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCOyh-00071d-98 for emacs-devel@gnu.org; Wed, 17 Feb 2021 10:42:59 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:55138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCOyf-0000Lk-KY for emacs-devel@gnu.org; Wed, 17 Feb 2021 10:42:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vn7WBvOBiwrr4+zv8e4W9fbG9kosm1khaN2zq315xcQ=; b=SUx6qX+23NUpfyJTIqSwNUZnNA AH+G3aulxh1RLU124uZhSZo8otKqU4dyqZ2MEYbeSO4tSpcjupMm6gxqbkMRxIOJM9qz6Jqayt26c OtbeM/sZtDCkOHWqpKnvGgEGbKZAQdD6DzlpFS+iYiuNquBX9tyRbClOOdoWCal4F6yQ=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCOyZ-0001Xo-Qe; Wed, 17 Feb 2021 16:42:54 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEUMBQsqHSw9LkJa R1ZLOk1lV2tiUmWNgIz///+Yq8ziAAAAAWJLR0QIht6VegAAAAd0SU1FB+UCEQ8jGL6h6wEAAAGk SURBVDjLrZPBUoNADIaT2gfYBcYzu3U8K1n3jMD0DbaeBcsbOLy+CSxQdb2ZgSn5v/7JJi0AgAYA tNESmbUKUBIQkW9UMAdKninWcEluQ4sJ1J5rpSFWwBNUmw7ZXq0IQM+7ZXsqQgBtl6+pW/DimvWR u4HZEmst7HWXc6BSiNo+QGM08mREHesnoleZ8zxyc5KJciKqVEE0fDRa4UsQwGPSHI6cJfJG4XUG JRQLoNrCyY+NwjCDGvIIFKqcfKWLBVQbMFaz40M/LoC6qPdYFeTHka4RrKGxyVgfRb8FLlNHdc9g /AkMj3iXcJDs6phwkOzqkHLIDvPvYCDPPcRw8dfLXspP09s0fcrSJ4ndEYLYuQeGtyDXr+YokydP 5WPvW+DFMaZA+X+g/gPInzUNnqDEVd+B9/4J6gSYe7z/0Rzf4ZwGfXIlVB96GOIOv4NjP293+wW7 DQzaD/va3QpKLtVSPNcMXCt6Wx6dnsF4jaW61gmoc8cvhI+lWtdxtORa/mgMk1iqi8HcZtYUay2g lXTW4IN4h6WHW/WGX27byQkH6fIFbI7eJls64ykAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDIt MTdUMTU6MzU6MjMrMDA6MDCZedU1AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTAyLTE3VDE1OjM1 OjIzKzAwOjAw6CRtiQAAAABJRU5ErkJggg== X-Now-Playing: Peter Zummo's _Deep Drive_: "Actual Serpentine (reprise)" In-Reply-To: (Stefan Monnier's message of "Wed, 17 Feb 2021 10:20:42 -0500") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org 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, 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:265008 Archived-At: Stefan Monnier writes: > 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. 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. In any case, it's not a command that anybody not using `foo' will (or should) be using, so I'd say (and I did say) that it's a mode-specific command. 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no