From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Delegating user-reserved key binding space definition to users Date: Mon, 28 Nov 2022 20:37:14 +0200 Message-ID: <83sfi3lycl.fsf@gnu.org> References: <57b69c22e167d429d21bb969feb22887@webmail.orcon.net.nz> <877czikyfa.fsf@localhost> <87o7sthrwx.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11553"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, psionik@positron.solutions, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 28 19:37:32 2022 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 1ozj0T-0002gJ-3j for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Nov 2022 19:37:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozizm-0007GQ-8c; Mon, 28 Nov 2022 13:36:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozizk-0007GF-VF for emacs-devel@gnu.org; Mon, 28 Nov 2022 13:36:44 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozizj-0000Yb-LC; Mon, 28 Nov 2022 13:36:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NydJiEqLBAt7MWBlidNLCbioaDv6apiIRZ3sE2U4bHc=; b=YMPSY6TbvbLO rmXN973M2hB7uYPgaKIMUA8NLrjvcOi98NZ5G4X3yVcesp2foUIXs4G10ugspgfgBoICmbhTF7wJZ 3FuOT7m07NfnbSNvKk2eMDPDKwHHarbHT17jtcEOWZ13XBYWDaKrZzXIE6h6YHfuOh8QtSjnqBgrd Fzd1wuf00MWE7erRpPyGK4OZti+z/bOFG6PGR7KO+TUILCdRUedFPHXMJForG5lnXyMuPaX4eL43A JGglS4z00uRdLi5FAWK77PTMd0qY39fxYf0wuh7ZwimTHvEIOF0/sbf085R+iD0mOetshVWB6TF7H F7TQCpmVvMWNOchNNZ0QOA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozizj-0004Vf-3O; Mon, 28 Nov 2022 13:36:43 -0500 In-Reply-To: (message from Stefan Monnier on Mon, 28 Nov 2022 13:15:26 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300680 Archived-At: > From: Stefan Monnier > Cc: Psionic K , Emacs developers > > Date: Mon, 28 Nov 2022 13:15:26 -0500 > > > Currently, the commands in major mods are bound to specific key > > bindings. The bindings are chosen either arbitrarily, according to major > > mode author preferences, or according to semi-established default key > > binding scheme (like C-f/C-M-f/C-n/C-v/etc). Either way, trying to > > re-bind commands in multiple major modes is not easy. > > Yup. I fully agree that it's a real problem. > > I'd welcome a solution to it. Even an "unrealistic" one would be good. > Currently, I don't even know what a good solution could look like. > > To me a solution should allow packages to declare that command FOO > should be bound to some key based on SOME-INFO, such that it will be > bound to one key in "normal Emacs mode", and to another in `evil-mode` > and to yet another in `god-mode`, etc... > > Some SOME-INFO needs to provide not a specific key, but some information > from which we can compute the "natural key" that fits the keybinding > style that the user selected. > > Then there are also the issues of overloading several operations on > a single key (like TAB). So far we've solved this along the lines you > suggest (a "generalized command", such as `indent-for-tab-command`), and > maybe that's good enough for this, tho it prevents changing this > overloading according to the keybinding style. > > [ BTW, another way to look at it is not "how can we compute which key to > bind FOO to" but rather "how can we compute which command to run when > KEY is hit". IOW, we could make keymaps more dynamic such that when > you hit KEY, Emacs passes that to a "procedural keymap" which will > *compute* (rather than lookup) which command to run, according to the > current keybinding style. > Not sure it would be better: I just mention it as one of the many > things that we may want to consider in order to find a good solution > to the problem. ] How about adding this (and more) to etc/TODO?