[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-ma
From: |
Philip Kaludercic |
Subject: |
Re: Suggestion for improving ergonomics of repeat-maps: define-repeat-map |
Date: |
Wed, 08 Sep 2021 14:54:23 +0000 |
acdw <acdw@acdw.net> writes:
> I wrote the macro `define-repeat-map' to alleviate this large amount
> of configuration. Using this macro, the above turns into this:
>
> ~~~
> (define-repeat-map case
> ("c" capitalize-word
> "u" upcase-word
> "l" downcase-word)
> (:continue "f" forward-word
> "b" backward-word)
> (:enter downcase-dwim
> upcase-dwim
> capitalize-dwim))
> ~~~
I haven't taken a detailed look at the source, but I have two
superficial questions:
1. Why is the name argument required? Shouldn't the macro be able to
gensym a new symbol to use for the map?
2. Could the argument structure be flattened, so that you could write
something like
(define-repeat-map
"c" capitalize-word
"u" upcase-word
"l" downcase-word
:continue
"f" forward-word
"b" backward-word
:enter
downcase-dwim
upcase-dwim
capitalize-dwim)
?
--
Philip Kaludercic