Kungsgeten / ryo-modal

Roll your own modal mode
MIT License
224 stars 16 forks source link

Make ryo-modal-key be able to use lambdas #55

Open cheerio-pixel opened 2 years ago

cheerio-pixel commented 2 years ago

I found out that defun returns the name of the function, making this change unnecessary:

(ryo-modal-key "Syb" (defun do-something () (interactive)
                            (message (number-to-string (emacs-init-time)))))
(ryo-modal-keys
`("Syb" ,(defun do-something () (interactive)
                (message (number-to-string (emacs-init-time))))))
cheerio-pixel commented 2 years ago

I found out that my example only works in the case of the function and not on the macro, so I think this patch would be useful.