Subject: bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints"

From: Juri Linkov <[email-masked]>
Date: Fri, 26 Apr 2024 09:06:29 +0300

> Example usage:
>
> (defvar-keymap expreg-repeat-map
>     :doc "Repeat map for `expreg' actions."
>     :repeat t
>     :name "expreg"
>     "\\" (cons "expand" 'expreg-expand)
>     "|"  (cons "contract"  'expreg-contract))

I feel uneasy about reusing the form (STRING . DEFN)
that has another meaning:

 a cons (STRING . DEFN), meaning that DEFN is the definition
    (DEFN should be a valid definition in its own right) and
    STRING is the menu item name (which is used only if the containing
    keymap has been created with a menu name, see make-keymap),

Can the same instead be achieved by using symbol properties?
For example:

(defvar-keymap expreg-repeat-map
    :doc "Repeat map for `expreg' actions."
    :repeat t
    :name "expreg"
    "\\" 'expreg-expand
    "|"  'expreg-contract)

(put 'expreg-expand 'repeat-hint "expand")
(put 'expreg-contract 'repeat-hint "contract")