Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created February 4, 2018 03:45
Show Gist options
  • Save dustinlacewell-wk/3e2f5138916d4e3734fe7b0f5c4fe98c to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/3e2f5138916d4e3734fe7b0f5c4fe98c to your computer and use it in GitHub Desktop.
(defun org-life-do (name &rest args)
(with-temp-buffer
(insert-file-contents org-life-support-file-name)
(org-babel-goto-named-src-block name)
(let ((info (org-babel-get-src-block-info)))
(dotimes (i (length args))
(let* ((params (third info))
(vars (org-life-get-val-props params))
(arg (elt args i))
(index (make-symbol (format "%s" i))))
(--when-let (elt vars i)
(setcdr it (list index arg)))))
(message "INFO: %s" info)
(org-babel-execute-src-block-maybe nil info))))
(org-life-do "chrome-open" "http://reddit.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment