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: Sat, 13 Feb 2021 13:05:50 +0300 Message-ID: References: <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: 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="18106"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Philip Kaludercic , 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 11:12:58 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 1lArv7-0004a1-HF for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 11:12:57 +0100 Original-Received: from localhost ([::1]:54212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lArv6-0005gM-GA for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 05:12:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lArqZ-0004oo-Ba for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 05:08:15 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:35781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lArqV-0003Ai-JK for help-gnu-emacs@gnu.org; Sat, 13 Feb 2021 05:08:14 -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 000000000001E089.000000006027A506.000066D0; Sat, 13 Feb 2021 03:08:06 -0700 Mail-Followup-To: Gregory Heytings , Philip Kaludercic , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: 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:127924 Archived-At: * Gregory Heytings [2021-02-13 11:34]: > > > > 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? I think not, as that would not be automated global setting by the package. User have got the control, user decided, not the package. > (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))) I would rather keep that without C-c and just let user decide on the prefix key which could be any. By inspecting already bound key, user could by trial and error in the wizard choose other rater by user unused key as prefix for the package. Like this: 1. This program uses key bindings. 2. You will be asked to assign a prefix key for key bindings in this package. 3. We recommend that you assign C-c ANY-LETTER as a prefix key, but you may as well choose Super in combination with ANY-LETTER or M (Alternative) and so on. Please press the key that you think it could be prefix to this package's commands. 4. You have pressed C-x ; that is bound to `comment-set-column'. If you now accept C-x ; as prefix for package X, that command will not be available on that key any more. Are you sure? Yes or no? If not sure, we may recommend that you use C-c ; as prefix for this package, would that be fine? Continue the loop. 5. Thank you. Your prefix has been set on Super key and letter p. You may change "s-p" at any time in future to other prefix by invoking function M-x key-wizard-of-oz-for-package-X or by customizing the variable `package-X-prefix-key' The function to assign the prefix key for a package could become Emacs function so that any new package uses that function to assign the prefix key for the package or to assign some keys for commands that are not prefix keys. > > But even considering that, what do you think that the long-term issue > > is? Do you think that with time, people will be using more and more > > packages that need global keys? > > I do not think, I see. Just have a look at the starter kits, or at the init > files of those who make them public. You'll see that there are many > packages that need global keys. Let us have some names of packages to look at it. Jean