Created
February 25, 2015 05:43
-
-
Save mpontus/962ee0ab527460064c59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 transient-map (keymap &optional pred onexit) | |
(defalias (-> ((user-error "It's an active map!") | |
(-contains? (current-active-maps)) | |
(-compose 'symbol-value 'eq keymap) | |
(-andfn 'mapatoms 'boundp 'keymapp) | |
(-orfn (catch 'found) (cl-gens)))) | |
(lambda (interactive "p") (keymap pred onexit) | |
(set-transient-map keymap pred onexit)))) | |
(defun keymap-symbol (keymap) | |
(->> ((s-format "Keymap: %s" symbol-name) | |
(-compose 'symbol-value 'eq keymap) | |
(-andfn 'mapatoms 'boundp 'keymapp) | |
(-andfn (catch 'found) (message))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment