emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The new keymap functions


From: Lars Ingebrigtsen
Subject: Re: The new keymap functions
Date: Sun, 14 Nov 2021 04:17:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> 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,
 
 @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 "á") 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]