Created
November 15, 2013 01:32
-
-
Save mgalgs/7477685 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
(setq demo-options | |
'("Stuff" | |
"things" | |
("Custom" . (lambda () (read-from-minibuffer "Custom: "))))) | |
(defun demo-select (el) | |
(cond | |
((functionp el) | |
(funcall el)) | |
(t | |
el))) | |
(defun demo-edit (el) | |
el) | |
(setq demo-actions '(("Select" . demo-select) | |
("Edit" . demo-edit))) | |
(setq helm-demo-source | |
'((name . "Demo") | |
(candidates . demo-options) | |
(action . demo-actions))) | |
(defun run-demo () | |
(interactive) | |
(let ((result (helm :sources '(helm-demo-source)))) | |
(if (not result) | |
(error "helm returned nil :(") | |
(message "Got: %s" result)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment