Created
January 5, 2016 19:07
-
-
Save mskorzhinskiy/d71d4fe7a0817a609880 to your computer and use it in GitHub Desktop.
Weird thing
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
;; Common use of third-party function looks like that: | |
(evilified-state-evilify-map | |
:mode some-emacs-mode | |
:bindings | |
(kdb "C-c a") 'function1 | |
(kdb "C-c b") 'function2) | |
;; I want to declare function or macro that will produce such bindings | |
(defun producer (binding function) | |
(list (kdb (concat "C-c" binding)) 'function | |
(kdb (concat "C-x" binding)) 'function)) | |
;; And then call it like that: | |
(evilified-state-evilify-map | |
:mode some-emacs-mode | |
:bindings | |
(producer "c" 'function)) | |
;; To produce code like that | |
(evilified-state-evilify-map | |
:mode some-emacs-mode | |
:bindings | |
(kdb "C-c c") 'function | |
(kdb "C-x c") 'function) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment