[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-ma
From: |
Adam Porter |
Subject: |
Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map |
Date: |
Mon, 04 Oct 2021 06:29:45 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Doesn't the manual document the syntax of both of these?
I'm sorry, you're right, it does, the key being in these lines:
@defun define-keymap &key options... &rest pairs...
@defmac defvar-keymap name options &rest defs
That's what I get for trying to read the raw texinfo in a diff buffer.
> But I guess it's a bit confusing how the syntaxes are similar but
> different? I went back and forth a number of time on the syntax --
> define-keymap is a function, so it can't do the function-line macro
> syntax that defvar-keymap can (which is better). But having the first
> argument of define-keymap be a list (which would be preferable in most
> ways) just looked awkward.
>
> (define-keymap (list :full t)
> ...)
>
> But I'm open to changing it if it's too confusing the way it is now.
If users see this function and macro as "siblings," I could imagine
their slightly different signatures being confusing. I don't know if
that would justify changing them to be more similar.
To be honest, I was surprised to see defvar-keymap as a separate macro.
I was expecting, e.g. define-keymap to be used inside a defvar,
something like:
(defvar foo-map
(define-keymap ...)
"Docstring for foo-map.")
Not to complain about having the macro, of course. :)
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Lars Ingebrigtsen, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Adam Porter, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Lars Ingebrigtsen, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Juri Linkov, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Lars Ingebrigtsen, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Stefan Monnier, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Lars Ingebrigtsen, 2021/10/04
- Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map, Lars Ingebrigtsen, 2021/10/04