Created
March 2, 2012 15:00
-
-
Save ubolonton/1958949 to your computer and use it in GitHub Desktop.
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
(defun ublt/define-keys (key-map &rest ps) | |
"Define key binding pairs for KEY-MAP." | |
(let ((i 0)) | |
(while (< i (length ps)) | |
(if (= (mod i 2) 0) | |
(let ((src (elt ps i)) | |
(dst (elt ps (1+ i)))) | |
(define-key key-map | |
(read-kbd-macro src) (if (stringp dst) | |
(read-kbd-macro dst) | |
dst)))) | |
(setq i (+ i 2))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment