From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages Date: Wed, 10 Feb 2021 14:17:12 +0300 Message-ID: References: <7e12c1c3c1aae58993e2@heytings.org> <8ed9b43502bad8cafcf1@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: help-gnu-emacs@gnu.org To: Gregory Heytings Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 10 12:22:33 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 1l9nZo-000A0R-G9 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 10 Feb 2021 12:22:32 +0100 Original-Received: from localhost ([::1]:47340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9nZn-0004be-Ig for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 10 Feb 2021 06:22:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9nZ0-0004ZZ-U4 for help-gnu-emacs@gnu.org; Wed, 10 Feb 2021 06:21:42 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:42739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9nYx-0007db-KB for help-gnu-emacs@gnu.org; Wed, 10 Feb 2021 06:21:41 -0500 Original-Received: from localhost ([::ffff:41.202.241.3]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001DFF5.000000006023C1C1.00002ACA; Wed, 10 Feb 2021 04:21:36 -0700 Mail-Followup-To: Gregory Heytings , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <8ed9b43502bad8cafcf1@heytings.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:127766 Archived-At: * Gregory Heytings [2021-02-09 12:18]: > > > > 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]. > > > > In my understanding those third party packages usually define major or > > minor modes so the reservation of keys for third party packages is thus > > already supported that way. > > > > That's not correct, many packages (not all of them, but many) implement > commands that are intended to be globally bound. The "org-capture" command > is an example. A package implementing advance bookmark commands is another > one, a packages implementing a dictionary search command is yet > another one. Alright, but without reading the text below, I do not see here what is not correct and how is your paragraph in any contradiction to my quoted statement above. Maybe you know this technically better. If I remember well org-capture suggested {C-c c} and I remember it was suggested to me to place this line in the init.el: (global-set-key "\C-cc" 'org-capture) so I did so. This is all in alignment with what I meant, maybe I have not expressed me well, and is in alignment on what you said. Package authors may then research which key could be best and give suggestions, but they will normally not bind it for user. Then they give suggestions in accordance with the reserved key bindings. > > There are more than one keys reserved already in the manner you > > described such as those reserved for users can be proposed and used by > > third party packages, including those for minor and major modes, they > > can be used by third party packages. > > Third-party packages cannot do that, and they do not do that. A third-party > package cannot bind a key C-c LETTER key, it can at best advise its users to > do so. It's what Org-mode does. That is what I also meant. I do not see disagreements, but you see. It is interesting. > > Maybe one could make a package that changes the prefix key or various > > packages or the package that could "see" which packages are used and > > which of them need positioning of their prefix keys. Then such package > > could ask user with proposal: > > > > - C-c bind prefix key for Org functions > > > > - C-, bind prefix for Magit functions > > > > Approve or change above y/n? > > > > The first question is not an allowed one, C-c can only be used by > users. OK but I do not see disagreement: - when text message in the package proposes to user to bind C-c c for org-capture that is proposal and user can decide if to accept it or not - package could ask user to insert such configuration. Computer software should be smarter than it is today. Users still need to do a lot of work. Little more artificial intelligence is needed. - dedicated imaginary package could manage and help users with placement of keys and collisions between packages. I would regard that as artificial intelligence. > The second question is not a good one, C-, cannot be used in terminals. That was an example. It was not meant to be 2 choices, it was not meant to be those keys specifically, artificial intelligence program would find out possible choices and have maybe some "mind" of most popular packages and could help user with choices and let user make decisions. Such program would recognize which key bindings could be possibly bound and ask user to bind it conveniently but which exact key bindings would be offered would be left to the algorithm. Jean