Skip to content

Instantly share code, notes, and snippets.

@ubolonton
Created March 2, 2012 15:00
Show Gist options
  • Save ubolonton/1958949 to your computer and use it in GitHub Desktop.
Save ubolonton/1958949 to your computer and use it in GitHub Desktop.
(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