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: Moving kbd to subr.el Date: Wed, 13 Oct 2021 15:31:07 +0300 Message-ID: <831r4pp0ms.fsf@gnu.org> References: <20211004081724.6281.11798@vcs0.savannah.gnu.org> <20211004081727.4F24921048@vcs0.savannah.gnu.org> <871r4qcs8s.fsf@gnus.org> <87o87ubcnl.fsf@gnus.org> <87h7dm9en7.fsf@gnus.org> <87czoa9e7p.fsf@gnus.org> <878ryxakv9.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7784"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 13 14:33:13 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 1madRZ-0001pt-3i for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Oct 2021 14:33:13 +0200 Original-Received: from localhost ([::1]:44102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1madRY-0000Yz-3Q for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Oct 2021 08:33:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1madPe-0006w9-BA for emacs-devel@gnu.org; Wed, 13 Oct 2021 08:31:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56952) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1madPd-0003w5-UE; Wed, 13 Oct 2021 08:31:13 -0400 Original-Received: from [87.69.77.57] (port=3470 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 1madPd-000673-Ch; Wed, 13 Oct 2021 08:31:13 -0400 In-Reply-To: (message from Stefan Kangas on Tue, 12 Oct 2021 20:18:20 -0700) 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:276877 Archived-At: > From: Stefan Kangas > Date: Tue, 12 Oct 2021 20:18:20 -0700 > Cc: emacs-devel@gnu.org > > I've attached a quick proof-of-concept of moving the kbd implementation > to subr.el. With this, all the tests I have assembled so far pass and > this bootstraps. It was mostly just a case of ripping out the calls to > cl-lib functions. > > If this is something we want to do, I can finish this patch up. Can we agree that if and when this lands, we will NOT start a deluge of converting all the key bindings in core to the kbd format? Let's agree that, at least as a rule, this is only for new additions to key bindings, okay? > - (should (equal (kbd "C-x a") "\C-xa")) > + > + ;; Modifiers. > + (should (equal (kbd "C-x a") "\^Xa")) > + (should (equal (kbd "M-x a") [134217848 97])) > + (should (equal (kbd "H-x a") [16777336 97])) > + (should (equal (kbd "s-x a") [8388728 97])) > + (should (equal (kbd "S-x a") [33554552 97])) Isn't this a bit ad-hoc? E.g., why did you change the "C-x a" result? Also, for easier readability and (no less important) write-ability, how about using this format instead: (should (equal (kbd "S-x a") (vector (+ #x2000000 ?x) ?a))) Thanks.