[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The new keymap functions
From: |
Bob Rogers |
Subject: |
Re: The new keymap functions |
Date: |
Wed, 17 Nov 2021 15:57:26 -0500 |
From: Lars Ingebrigtsen <larsi@gnus.org>
Date: Wed, 17 Nov 2021 08:36:23 +0100
Juri Linkov <juri@linkov.net> writes:
> Whereas the name `defvar-keymap' is nice since it's a top-level macro,
> `define-keymap' looks out of place in the same group of functions.
> And indeed, such mismatch looks odd:
>
> (define-keymap "C-c C-c" #'quit-buffer)
> (keymap-set map "C-c C-c" #'quit-buffer)
>
> What about renaming it to `keymap-define'? Then:
>
> (keymap-define "C-c C-c" #'quit-buffer)
> (keymap-set map "C-c C-c" #'quit-buffer)
I like that all the `keymap-*' functions take a map as the first
parameter (except the commands that have the map "in the name", like
`keymap-global-set'). And using `define-*' for a form that defines
something (and has a (potentially) long body) is a very long-standing
tradition in Emacs, so I'd prefer to keep it as is.
The purist in me can't resist pointing out that these are not so much
defining something as making a binding between an existing command and a
given key sequence. But using binding in the naming may be too geeky
even for the average Emacs user, so FWIW I agree "keymap-" is a good
choice, but "define-" is too grand.
-- Bob Rogers
http://www.rgrjr.com/
- Re: The new keymap functions, (continued)
- Re: The new keymap functions, Lars Ingebrigtsen, 2021/11/17
- Re: The new keymap functions, Juri Linkov, 2021/11/17
- Re: The new keymap functions, Robert Pluim, 2021/11/17
- Re: The new keymap functions, Juri Linkov, 2021/11/17
- Re: The new keymap functions, Lars Ingebrigtsen, 2021/11/18
- Re: The new keymap functions, Robert Pluim, 2021/11/18
- Re: The new keymap functions, Lars Ingebrigtsen, 2021/11/18
- Re: The new keymap functions, Lars Ingebrigtsen, 2021/11/18
- Re: The new keymap functions, Robert Pluim, 2021/11/18
- Re: The new keymap functions, Lars Ingebrigtsen, 2021/11/18
- Re: The new keymap functions,
Bob Rogers <=
- Re: The new keymap functions, Richard Stallman, 2021/11/17
Re: The new keymap functions, xenodasein, 2021/11/13
Re: The new keymap functions, xenodasein, 2021/11/14