I use evil and I want to execute a function by using Emacs macro system.
Let's say I have the following macro.
(evil-set-register ?f [?i ?f ?o ?o ?b ?a ?r escape])
I can run the macro by using @f
. But this system is not easy to read and maintain.
Question
How to execute an interactive function by using @f
shortcut?
Example
Here's function insert-foobar
which inserts string foobar
:
(defun insert-foobar nil
"Insert foobar."
(interactive)
(call-interactively 'evil-append)
(insert "foobar")
(evil-normal-state))
(evil-set-register ?f (call-interactively 'insert-foobar)) ;; This does not work
(evil-set-register ?f (insert-foobar)) ;; This does not work too