From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.help Subject: PROPOSAL: Repurpose one key and reserve it for third-party packages Date: Mon, 08 Feb 2021 10:02:07 +0000 Message-ID: <7e12c1c3c1aae58993e2@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15313"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 08 17:39:20 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1l99ZH-0003s1-Qi for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 17:39:19 +0100 Original-Received: from localhost ([::1]:58272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l99ZE-0003lf-GY for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 11:39:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l93N9-0002xt-IS for help-gnu-emacs@gnu.org; Mon, 08 Feb 2021 05:02:32 -0500 Original-Received: from heytings.org ([95.142.160.155]:41688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l93Mz-0004kx-KF for help-gnu-emacs@gnu.org; Mon, 08 Feb 2021 05:02:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1612778527; bh=zVMroFROLz5DEYK2rsyymnWIpaPwAeJgTskcMgbrP0A=; h=Date:From:To:Subject:Message-ID:From; b=gjSt6+YTK6S6UADuOBhpkHZPI+1Clne1NjNJO3G33k/vjhmQE/ZqZGOsrSMAU3DXW rus4RmI6169NKJkCU4rInQWcsCu77T6LPcTGkozPbjfzW+eACFUkwJGLumtPZfTP5M Ws4wN6CcjkpSoC/73mm1IWZQus/i8ZioohE1zmO5qPQg9mM6ZboCo4GbhG4ap1a9uD ujV53hYqo5wkkxa9QzBwtWL8ul76t2T653TZVLjWcueiMHnO161aOO9F7hZmxXbu5I nzzErySdC0bGQa1nsn0UYRC4YAduAcz+fvmsjYtjcmMJQYTMeoeHMouL0MiHL0WogQ p2D5tDGK+S1pw== Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127659 Archived-At: [S Boucher apparently intended to reply to the following proposal sent on emacs-devel.] =Proposal= It is proposed to repurpose one key, and to reserve it in the key binding conventions for third-party packages. The keys that could be reserved for that purpose are: Option 1. C-z, with a single exception: "C-z C-z" would be bound to "suspend-frame" Option 2. C-z and M-z, with two exceptions: "C-z C-z" would be bound to "suspend-frame", and "M-z M-z" to "zap-to-char" Option 3. C-o, with a single exception: "C-o C-o" would be bound to "open-line" Option 4. C-o and M-o, with two exceptions: "C-o C-o" would be bound to "open-line", and "M-o M-o" to "facemenu-keymap" =Rationale= The current key binding conventions (see `(elisp) Key Binding Conventions') reserve keys for users, for major modes and for minor modes, but not for third-party packages [1]. When such packages need to bind a command to a key, they can (1) either suggest users to bind it to a key reserved for users (for example, org-mode suggests to globally bind "C-c c" to org-capture), or (2) bind it to a key currently unused by Emacs (for example, Magit binds "C-x g" to magit-status in buffers visiting a file in a Git repository). Neither of these solutions are optimal: (1) requires an explicit configuration by the user, something which might confuse newcomers, and which other users might not want to do because they already use the keys reserved for users for other purposes, and (2) might conflict with the evolution of Emacs when one or more commands are bound to a yet unused key. Reserving one key for third-party packages solves the above problems: third-party packages can automatically bind a few keys in that reserved area, without conflicting with keys reserved for users and without conflicting with future Emacs evolutions. =Limit= Conflicts are still possible, when two or more packages bind the same keys. These are, however, conflicts between packages, not between a package and Emacs, or between a package and users' personal configurations. Such conflicts are also less likely for typical users, who install a few packages each binding a few keys. Finally, such conflicts can be dealt with without confusing users too much: a package could automatically choose fallback key bindings when the preferred ones are already used by another package, and/or issue a warning to the user that they need to bind its commands manually. =Note= [1] These conventions were written 25 years ago, at a time when there were far fewer third-party packages, and have not changed substantially since them.