From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.help Subject: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages Date: Sat, 13 Feb 2021 15:28:27 +0100 Message-ID: <87ft20f3ec.fsf@posteo.net> References: <7ef75c33936136eb3a20@heytings.org> <87tuqia845.fsf@posteo.net> <87pn16a1xn.fsf@posteo.net> <87lfbu9q5x.fsf@posteo.net> <329d68a5ed6d1194f3c0@heytings.org> <87czx5a947.fsf@posteo.net> <329d68a5ed1656b4427e@heytings.org> <87zh098lo4.fsf@posteo.net> <329d68a5ed26ba41356b@heytings.org> <87h7mhgyxj.fsf@posteo.net> <329d68a5ed0dcd10a78a@heytings.org> <87czx5gpuj.fsf@posteo.net> <329d68a5ed4f4c7e84fb@heytings.org> <877dndgnhp.fsf@posteo.net> <329d68a5edfafadfe7cd@heytings.org> <87y2fsg5ve.fsf@posteo.net> <87mtw8fi6k.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36064"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) 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 Sat Feb 13 15:29:29 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 1lAvvJ-0009E5-Ea for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 15:29:25 +0100 Original-Received: from localhost ([::1]:33862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAvvI-0006uz-Gn for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 09:29:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAvuU-0006tg-Dd for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 09:28:34 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:33673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAvuR-00072G-Py for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 09:28:34 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 72F3F2400FC for ; Sat, 13 Feb 2021 15:28:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613226509; bh=8Q4ENS9F1RVF21wVz8efR+VvAl0sF1deC6WzrrUfeT4=; h=From:To:Cc:Subject:Date:From; b=E8hHojH82sl3KnQJy2AAWBfls+UmPsmE9sV7mgU0GvFacsyTwM9LMwFYa00AfEtYX 9oVqYElLkYyUh6n6m4sYCgEzYVuhpIb+PGRCIrxrRHdehg2pr9q8TJyoU2MqDICdiR aBOKBgXQV1MMnXxoNTynFEBY2Qd3INDx9DJy5I4ja3I2fVVUijlaHpwdqyA19o4TnG EeS6+3O8Zb3jnkEVkyUQm7RBdMeFtDJB5j+ptFBPDtFk/1V1fPnvrsylu/AmokVPwq oKqlgsFnE/naTfJdRZ1rCPYi6ustjmC7UZZ6nShoZmm3MYUnjPpIoZ4W7xa8bGWGDN WEOF4YjltaOKQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DdCQh5DKFz6tmJ; Sat, 13 Feb 2021 15:28:28 +0100 (CET) In-Reply-To: (Gregory Heytings's message of "Sat, 13 Feb 2021 13:06:55 +0000") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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:127935 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sorry for protracting the conversation, I just think the interpretation of the guideline is important. Gregory Heytings writes: >>> But that would be forbidden by the guideline "Don't define 'C-c >>> LETTER' as a key in Lisp programs", wouldn't it? >> >> It seems to me that this is a matter of "in the word of the law" or >> "in the spirit of the law". I understand the "spirit" of the >> guideline to be saying that external code shouldn't try to bind keys >> that are reserved for the users to decide what to bind. This is not >> because they are external, but because they would make a decision >> for the user. > > Indeed, my understanding of the "spirit of the law" is different: my > understanding is that no code in a library should bind C-c LETTER key,=20 > conditionally or not, and that these keys are strictly reserved for > users, who have to explicitly bind them in their init file. This seems to be more of a literal interpretation, unless I'm missing something. When talking about the "spirit of the law", I'm trying to consider why a key-space would have been reserved for users. Or to put it this way, the problem that the guideline tries to prevent is primarily that {minor,major} modes don't shadow certain keys, and secondarily that libraries don't override these same keys. I distinguish between primary and secondary motivations, because the latter is something that should be avoided in the first place, no matter what key is bound. Because what difference does it make who binds the key, or where it is bound? You could have a function like (defun foo-bind-to (key) (global-set-key (kbd key) #'foo-function)) even though it is nonsensical, it violates what I consider the literal interpretation (global-set-key is called from a library), but not how I'm reading it (the user decides to call foo-bind-to, and might pass a C-c LETTER for KEY). > AFAIU, this is also how the author of Magit understands that > guideline: Magit binds three keys globally unless > magit-define-global-key-bindings, whose default value is t, has been > set to nil, and only recommends in the docstring to bind "C-c g". > With your understanding of the guideline, Magit could have added a > third possible to magit-define-global-key-bindings, say 'best, with > which the "C-c g" binding would have been created automatically. No, because the user is not asked, and I have to add extra configuration, to prevent Magit from changing my environment. This all boils down to the question of what's better: Opt-in or Out-out -- I have argued that these kind of things (modes, binding global keys, hook, ...) should always be opt-in. What is ultimately considered good style is up to the users to decide, but I'm not a fan of a configuration where most of everything is just deactivating defaults. =2D-=20 Philip K. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCAAxFiEEbW+YL3e0aNnYosjIGB9bla4wszYFAmAn4gsTHHBoaWxpcGtA cG9zdGVvLm5ldAAKCRAYH1uVrjCzNlJ+DADDAI5Za9+DMhZUt/Y0Q2h9OT5F+gGU XLtAfVZPgHbiOnnA0nNaxWAcsL4ai78522qEsAtbXRqEZEL4lNpAq/JxbyA9lncp OqKdylQovoI4B0IZAHJq4CwX5JJ7yAnQ7S7YdHVVUiEPqQ1BtQEypihluSu/u3At L07M6qS4Br5UxiTW02tTa6IS+M0Ung54l5DYe+LQ7bspc3R+rDrIdE5RnBD/9RMj szXl3N9+sda9kbWV0L3nPPwUiveMiB8JmxSVERFL8zmPi/p8rDX7yShlNPrKOrZW +YCKur9Ak5hxdtHgBDt+j70UJm7ArGq7dfHE+V0OWWdjSV95KUCq6vOSeGq0MX25 jDix0WgLRhwn2/TbyDlR/AAjkkzzgmB+RD9muwGSTKAmwmKksFbVcRYAE1mqyt9s WVIfXi0ymKI23t53VLP0sCgCiLYqUwNNKsQUdTqu4QzcBM4AgluPuEso0etFHgfr EBZPe84fddJOQNQb6WEfdVcyeo4UFxK9dzU= =CuP8 -----END PGP SIGNATURE----- --=-=-=--