Skip to content

Instantly share code, notes, and snippets.

@mgalgs
Created November 15, 2013 01:32
Show Gist options
  • Save mgalgs/7477685 to your computer and use it in GitHub Desktop.
Save mgalgs/7477685 to your computer and use it in GitHub Desktop.
(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