Skip to content

Instantly share code, notes, and snippets.

@mpontus
Created March 17, 2015 04:13
Show Gist options
  • Select an option

  • Save mpontus/29bc11c5fd253850579f to your computer and use it in GitHub Desktop.

Select an option

Save mpontus/29bc11c5fd253850579f to your computer and use it in GitHub Desktop.
(cl-defun transient-map (command &rest bindings &key keep-pred
on-exit &allow-other-keys)
(unless (commandp command) (push command bindings)
(setq command nil))
(let* ((keymap (-map (-applify 'cons) (-partition 2 bindings))))
(set-transient-map (easy-mmode-define-keymap keymap) keep-pred on-exit))
(when command (call-interactively command)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment