Kungsgeten / ryo-modal

Roll your own modal mode
MIT License
222 stars 14 forks source link

Allow binding existing keymaps #45

Closed BlankSpruce closed 3 years ago

BlankSpruce commented 3 years ago

Initially I just wanted to bind projectile-command-map in ryo-modal-mode-map but I couldn't do that with ryo-modal-key. For the note, this alternative would suffice:

(ryo-modal-set-key (kbd "SPC i") projectile-command-map)

Then I've started experimenting with other keymaps and it occured to me to it'd be nice to be able to use keywords provided with ryo-modal (especially :exit t or :mc-all t sound interesting). Since it seems keymaps weren't use-case so far for ryo-modal-key I've extended it to the best of my capability. Also I've provided tests for some coverage.

Kungsgeten commented 3 years ago

Hi! I've never used ert so I'll have to study the test file a bit. It is a great idea though! Could you add a docstring to the new function in ryo-modal.el? Maybe the docstring of ryo-modal-key needs to be updated too. Anyway thanks for the contribution! If you don't feel like writing docstrings I can do it myself after I've reviewed and tested the code.

BlankSpruce commented 3 years ago

I've added another commit that extends documentation appropriately.

Kungsgeten commented 3 years ago

Thanks! It is now merged.