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: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages Date: Sat, 13 Feb 2021 13:06:55 +0000 Message-ID: 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> <87mtw8fi6k.fsf@posteo.net> 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="22916"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Philip Kaludercic Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 13 14:11:44 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 1lAui8-0005oN-Bj for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 14:11:44 +0100 Original-Received: from localhost ([::1]:35010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAui7-0007De-Cu for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 08:11:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAudY-0004ln-0m for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 08:07:00 -0500 Original-Received: from heytings.org ([95.142.160.155]:49726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAudW-0007Lu-4j for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 08:06:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1613221615; bh=15IS7uUXTZ8i+ZPk/s/7u0/00Dmhz2AJ1gmWL6j8HaU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=ItOkgD0l1b4rZnR4UtPUJKlurwS0s2RFu8lKp6dH432VGmGAqcvxJXOnGIIIzSPpm srEuZR/4i2+u+X9O+W716gdLreHgWH8cZSVhgi3pDhKLaaoNh2W+gEo7g7C+3rGZZU SfDR5SbirFyxrn/AuZF7+6tPJecXU7apnLqrR4AgCzjEm/CKPemnvCOqAUAL608xGm L3Xp/pdOjg0n1PWQ7lBvL+nfJk0hs/XFQeNuHkpgp7+aAj44agnDgskbwTXKZ4vNPa 16O2ECDI577iBequYuaVL6cF/+x8L8gHIZtXnp3pzOvUbpVvwVIZTLyDt0ZNYgQVgO 1ymGK+qW/ZBMg== In-Reply-To: <87mtw8fi6k.fsf@posteo.net> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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:127930 Archived-At: >> 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, conditionally or not, and that these keys are strictly reserved for users, who have to explicitly bind them in their init file. 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. Anyway, that question is, as I said, unrelated to the proposal itself. >> (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-command))) > > This would be defined unconditionally too > Whoops, I wrote too fast indeed, of course it should have been (if (> (length foobar-global-key) 0)..., or perhaps (unless (string-empty-p foobar-global-key)...