From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: The new keymap functions Date: Sun, 14 Nov 2021 04:17:30 +0100 Message-ID: <87ee7jcto5.fsf@gnus.org> References: <87zgq8sfw3.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33211"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 14 04:18:28 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 1mm62F-0008Rw-Ve for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 04:18:28 +0100 Original-Received: from localhost ([::1]:43360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mm62E-0006wk-ET for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Nov 2021 22:18:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mm61Z-0006Hz-17 for emacs-devel@gnu.org; Sat, 13 Nov 2021 22:17:45 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=45230 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mm61S-0003lp-6M for emacs-devel@gnu.org; Sat, 13 Nov 2021 22:17:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wy2NPdw5etIbGHVo0UlQS09sJXtnQHdSTTotrYW/3Uo=; b=cdxqkxwM6JxQ6A27Qmfe74ixsl sIbQ8Od+hs/cyjEsS9djcqYGtCvGGiBTmr3ThTfIjwRWQijuOYH3XMohO3aTcn9PkHTT8c0KaYZfI Jp9T2Sd47QhinRVee6cWueDiETLQaa45XPypvywVFjQgeR1gsDTUqYxpgVKqOnkNXLxY=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mm61M-0008Tq-V6 for emacs-devel@gnu.org; Sun, 14 Nov 2021 04:17:35 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAXNSR0IArs4c6QAAAAJiS0dE AP+Hj8y/AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH5QsOAicLU8HZMAAAAJhJREFUSMft k9ENgCAMRIGwkqPclF3KUfzBQC3aw/ihwX4R0tdryxHXMBZpMH9OIAeUk3BAXOqZQlqgIXBaQQF7 BjolyKFhLrRCCGKSRPNDa0WnJSgBsV2lXpWrgZyWrETml4R+Sx7Gb6lgiTEQGo3jw7nxwh9344tS UU3MKTSmJxXqQzw/tGgBFzDOcRUwChxjSvP9wEeBDeQcFNLrTcmuAAAAJXRFWHRkYXRlOmNyZWF0 ZQAyMDIxLTExLTE0VDAyOjM5OjExKzAwOjAwldDNQgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0x MS0xNFQwMjozOToxMSswMDowMOSNdf4AAAA4dEVYdGljYzpjb3B5cmlnaHQAQ29weXJpZ2h0IChj KSAxOTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55+Vd5NwAAACF0RVh0aWNjOmRlc2NyaXB0aW9u AHNSR0IgSUVDNjE5NjYtMi4xV63aRwAAACZ0RVh0aWNjOm1hbnVmYWN0dXJlcgBJRUMgaHR0cDov L3d3dy5pZWMuY2gcfwBMAAAAN3RFWHRpY2M6bW9kZWwASUVDIDYxOTY2LTIuMSBEZWZhdWx0IFJH QiBjb2xvdXIgc3BhY2UgLSBzUkdCRFNIqQAAAABJRU5ErkJggg== X-Now-Playing: Lost Girls's _Menneskekollektivet_: "Love, Lovers" In-Reply-To: <87zgq8sfw3.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 13 Nov 2021 07:56:12 +0100") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RDNS_NONE=0.793, 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.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" Xref: news.gmane.io gmane.emacs.devel:279370 Archived-At: Lars Ingebrigtsen writes: > I've added the functions and converted the few define-keymap instances > that are in-tree to the new syntax, but wanted to give all y'all a > chance to discuss this further for a couple of days before I push these > changes. I've been going through the Emacs and lispref manuals, adjusting them to the new functions. I've moved the documentation of the central functions like `define-keymap' and the description of all the different syntaxes to a new node that documents these "legacy" functions, but the manuals otherwise only talk about the new functions. The good news is that this makes all of these bits go away: For example, =20 @smallexample -(global-set-key (kbd "C-x C-\\") 'next-line) -@end smallexample - -@noindent -or - -@smallexample -(global-set-key [?\C-x ?\C-\\] 'next-line) -@end smallexample - -@noindent -or - -@smallexample -(global-set-key [(control ?x) (control ?\\)] 'next-line) +(keymap-global-set "C-x C-\\" 'next-line) @end smallexample as well as all the stuff that patiently describe the non-intuitive difference/similarity between (global-set-key "=C3=A1") and (global-set-key "\M-a"), which is mostly irrelevant with the new functions. The bad news is that during this work, I've discovered a few more functions that need to have keymap-* equivalents, like keymap-substitute keymap-binding keymap-local-binding keymap-global-binding so it's a bit... er... more than originally planned. But it's not bad bad -- we get a more consistent naming scheme here. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no