bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Juri Linkov
Subject: bug#70576: [PATCH] `repeat-echo-message-string': support repeat keymap "hints"
Date: Fri, 26 Apr 2024 09:06:29 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

> 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")





reply via email to

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