This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when-compile (require 'cl)) | |
(defun* my/set-keybinds (map &rest key-and-func) | |
(loop with use-keymap = (keymapp map) | |
for i from 0 to (1- (length key-and-func)) by 2 | |
for key = (nth i key-and-func) | |
for formatted-key = (if (vectorp key) key (kbd key)) | |
for func = (nth (1+ i) key-and-func) | |
if use-keymap | |
do (define-key map formatted-key func) |