;; The fitness.org file calls this function to eval the configuration source ;; block. This is the only function that needs to be defined outside of ;; fitness.org. (defun ap/org-call-src-block (name) ;; Based on ;; This works better than the org-sbe (aka sbe) macro, because it ;; calls the block upon expansion, making it difficult to bind to ;; a command to run later ;; TODO: Use `org-babel-goto-named-src-block'! I guess it's new...or not, it's from 2010! (org-with-wide-buffer (-when-let (src (org-element-map (org-element-parse-buffer) 'src-block (lambda (element) (when (string= name (org-element-property :name element)) element)) nil ;info t )) (goto-char (org-element-property :begin src)) (let ((org-confirm-babel-evaluate nil)) (org-babel-execute-src-block)))))