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.devel Subject: Clarifying the C-c letter guideline Date: Sun, 14 Feb 2021 13:12:52 +0100 Message-ID: <87ft1y4zln.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="27069"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 13:14:49 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 1lBGIb-0006wN-Nn for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 13:14:49 +0100 Original-Received: from localhost ([::1]:50620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBGIa-0005Mz-Q3 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 07:14:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBGGp-0004kv-0o for emacs-devel@gnu.org; Sun, 14 Feb 2021 07:12:59 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:57934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBGGm-0001zT-Lq for emacs-devel@gnu.org; Sun, 14 Feb 2021 07:12:58 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 25885160062 for ; Sun, 14 Feb 2021 13:12:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613304774; bh=/2W+RktqX9JkAXG550bAbhKNYHOkOsD+cK/EdZodVys=; h=From:To:Subject:Date:From; b=KSE1lqPe8lULzK4aiGZa0aq2IGzvnu5qKohQZmlXIyoiSViBTkg0zJ+Lci/2Hed3F DS3GBtjCGQg4OVQYKddRvCIKjxiO/M2mpH0h8HLYmyhkouZtyNkXQPsvAo+l+bcz7h BlNP6k9mftYIriPLDkjXKZQWWlWWTSAPqcC/JFca+ii2tH1tfJgoUIfLoR1ItfViHN G93Ph7KE+5YfvQscrVW6MnmzUUyJMAixV0+fOejzffWgXpH9FKElxEyqox6plHow9v OC5lP/JMW7w/GLIUxwVLdcWcvDcQbQgLcUIQZYgqzh7RdiEyM6+v8c97orGTFAVWDz BlWfT7x0XqL/A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DdmMn3lC3z9rxV for ; Sun, 14 Feb 2021 13:12:53 +0100 (CET) Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.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_H4=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: 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:264690 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, a few days ago, there was a discussion on help-gnu-emacs[0], specifically on this one paragraph from (elisp) Key Binding Conventions: > =E2=80=A2 Don=E2=80=99t define =E2=80=98C-c LETTER=E2=80=99 as a key in L= isp programs. Sequences > consisting of =E2=80=98C-c=E2=80=99 and a letter (either upper or lower= case) are > reserved for users; they are the *only* sequences reserved for > users, so do not block them. There seems to be some uncertainty in how this should be interpreted. Does this mean that... =2D No package/library/third-party code may ever bind a command or map to C-c LETTER, under any circumstances (in the letter of the law). =2D A package/library/third-party code may bind a command or a map to C-c LETTER, if the user is explicitly asked and he or she gives permission (in the spirit of the law). I lean towards the second interpretation, which would allow something like (defcustom foobar-bind-to nil "Bind command `foobar' to C-c LETTER." :set (lambda (sym val) (cond (val (global-set-key (format "%c" val) #'foobar)) ((where-is-internal #'foobar) (global-set-key (car (where-is-internal #'foobar)) nil))) (set-default sym val)) :type '(choice (const :tag "Don't bind" nil) (character :tag "Bind to"))) (even though I don't think code like this is necessary in the first place, but this is just an example). The background of this discussion is to settle the question, whether/how packages might suggest binding a global command, if their interface is not a major or minor mode, but a specific command (e.g. magit-status). Using defcustom is probably not the best idea, but something I think that something along these lines might be interesting to have. So I'd be interested in what the mailing list has to say on this question. Should this section be rephrased to clarify the guideline? [0] https://lists.gnu.org/archive/html/help-gnu-emacs/2021-02/msg00426.html --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCAAxFiEEbW+YL3e0aNnYosjIGB9bla4wszYFAmApE8QTHHBoaWxpcGtA cG9zdGVvLm5ldAAKCRAYH1uVrjCzNhpRDADHExSksFT8IIpYCPoRwO6QPUNc1KNt icCZvSSIxSj4F2Myx3B99p/kNXn29zUMl8parBKHpGXZou89SoXdsVNu5WzEdJ3P 4O6n6APv/9MaDQjY77aBRLMlQDXMinzMzL6nqOMDB/p1EPn4JQ8kxoq+3GZK3IlY TEMZwVKso2oc6HhH+fndGRnk8KnHZQQwpIdXrjwtJiN6wp3mHmfchNxh1dKd9CaQ n6JNFIGO3hhQsPCNMajDaDjRJ1y9aG1ONmRWr5u+H5JYk4NiDYqbqgIPhSVzYYPp tzhjvdNy9LaVqxmi4u0tnSEYIOxhjuFLTozkYaiuQ/0II47YJdAMghLgwPUZ0VIE SLhn/eu3MTxePqEUGeuxeWhnChzwEoKLw6eSoV/Yys5sDtlBKG/zZN3INWzu+eJs g4sYNrdYBDP+w7iVdEuXbxn8G9rUXFzXl1pIPa8vGDYm+h5Eb80wPL2q46Yo7x5s NwBJ6SSoD3kLfDmexkjIvt8itg3CnqPSVBc= =Dhmd -----END PGP SIGNATURE----- --=-=-=--