Modify repeat keys?

Vegard Øye vegard_oye at hotmail.com
Thu Aug 11 15:35:31 CEST 2011


On 2011-08-11 14:42 +0200, Frank Fischer wrote:

> Alternatively one would have to modify the functions
> `evil-put-property' and `evil-get-property' so they can handle
> lambda-expressions as well.

Actually, it is possible to assign command properties to lambda
functions already. I added this some time ago because I wanted
to be able to define throwaway commands for testing purposes.

There are two ways to set command properties for lambda functions:

(1) Define the lambda function first and then pass it to
    `evil-add-command-properties'.

(2) Use the macro `evil-define-command', specify the properties
    as keyword arguments, and pass nil for the command's name.
    The return value is a lambda function. (This behavior also
    extends to other definition macros, like `evil-define-motion'
    and `evil-define-operator'.)

Command properties are stored in the association list
`evil-command-properties', which accepts lambda functions for keys
just as well as function symbols. (That is, the list contains
a pointer to your lambda function.)

-- 
Vegard



More information about the implementations-list mailing list