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 10:09:07 +0100 Message-ID: <87mtw8fi6k.fsf@posteo.net> References: <7ef75c33936136eb3a20@heytings.org> <87lfbubthl.fsf@posteo.net> <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> 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="36900"; 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 10:09:40 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 1lAqvs-0009WO-LZ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 10:09:40 +0100 Original-Received: from localhost ([::1]:53550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAqvr-0005qh-M8 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 04:09:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAqvU-0005qT-ES for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 04:09:16 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:40289) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAqvR-0003Sl-1J for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 04:09:16 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 7C3D42400FF for ; Sat, 13 Feb 2021 10:09:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613207349; bh=BZMkRrKj1I11NHQ3Bbrjo4chzxSzj1qVzU3YARGmwVg=; h=From:To:Cc:Subject:Date:From; b=h7td3WI4LQOUNTYbXQvC4BZX87sr3Nwt04yALpH+6U7KgPzghCbsuZQbU7M9620gd 0XcR8rGwOeXhL8RbYhgtlbu4w2GJTFg6+at0YiXCeVSSZPFu5Ns4NPxo1dI38JKBuU xtaw6PG3F3e10hys/tkcs6jw3Rq3VI7Brqf1S7B57lEVydSlvUE5tZJ5d11PosBFhP aeIz4U2pEYwK/sWrs0Ck81tte4uCRkeP4al2RXoOEkDnmmfXrh4OXK9frJbD0mZuHi Vw0ZOumqVGVBIL32fdzSEkZZ2pk2dUpuCoAfiurgZrkSOxUDAbCRBDDm563m5mEO3v v+cgZ8Hf846rQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dd4LD3Lzgz6tnb; Sat, 13 Feb 2021 10:09:08 +0100 (CET) In-Reply-To: (Gregory Heytings's message of "Sat, 13 Feb 2021 08:33:39 +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:127921 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Gregory Heytings writes: >>> To me what you propose looks pretty close to using customize to set >>> a foobar-set-global-binding variable that would be used in a call >>> to global-set-key. >> >> Yes, that could also be done, the precise code that is generated is >> an open question >> > > 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. > (defcustom foobar-global-key "" "Foobar global key in C-c") > ... > (if (length foobar-global-key) > (global-set-key (kbd (concat "C-c " foobar-global-key) 'foobar-foo-comm= and))) This would be defined unconditionally too, I assume you wanted to set the default value of foobar-global-key to nil and check if it is non-nil. And even then, the binding should be done in the defcustom's :set procedure, to make it reversible -- but that's not important here. > If that's allowed, then why not this? > > (defcustom foobar-global-key "z" "Foobar global key in C-c") > ... > (if (length foobar-global-key) > (global-set-key (kbd (concat "C-c " foobar-global-key) 'foobar-foo-comm= and))) > > This is not very different from the first one, and does what the > guideline forbids, but it could be argued that it does not because it > does so only conditionally... Conditionally, yes, but also by *default*, which I think is the problem. The default execution of this code would override whatever was bound on C-c z, without asking the user -- and I see this as a violation of guideline's "spirit". =2D-=20 Philip K. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCAAxFiEEbW+YL3e0aNnYosjIGB9bla4wszYFAmAnlzMTHHBoaWxpcGtA cG9zdGVvLm5ldAAKCRAYH1uVrjCzNm5TDAC0augZHxCQC7JOQdHU+47HTA7YSgDA IqIZHmMUU+9Z26tUZP8GFAZYWDCq05kQFaR2LwuSYan+2YVQeJhYDBnBb9I7ynk+ rjfI3tt2R4WqWhjeAd4AMz/q1QPkQt9OLrE/p4JCdfyPprt2wPq2OHVmhjhu+pd8 FKM4Us7s38GQYui32kCjXvPpea0SO6yRoYD6VdWRBC5E52pWmz/zqBA/g0iz0QEu I4dclCJg+TWwFdkUQ1qbTOPxbHy8SNMKOGwyDUeO1En5pkzWd8t0nwmkdf2PR0eb 8moPMWobLQOMXMc2mDL9PCee8xtQN0rVQ/E8KFXURgRr6oc15K07CklmdwrAjzJN uaaiyqDE66y6ScYSoY2GqHwi3e+mFtOb0bUxqHXPX8b0gX5yqYsu1zUXL8gJ2PPo Mwjo60OqXaUOuV3mdRYT01Bl3L5zY73G7vAN6Q7bvauh6Pyk90CDuWE5to8mDjPz Pc1Uk4mCcWgAf68OTEAFcL11907Of8OPKPg= =rJ65 -----END PGP SIGNATURE----- --=-=-=--