| ID | f8a4d7ff-9b0e-4217-abca-bdf37f9fd2ca |
|---|---|
| DeertopiaVisibility | public |
Lazy-loading Org-babel
Typically, Babel's languages are loaded all at once during initialisation. Example:
(org-babel-do-load-languages
'org-babel-load-languages
;; Enable R
'((R . t)
;; Disable Elisp
(emacs-lisp . nil)))
Doom's lazy-loading incrementally adds to the org-babel-load-languages variable as demanded.
Notes on Doom's code
digraph {
"+org-init-babel-lazy-loader-h"
}
+org-init-babel-lazy-loader-h
Ran as a hook after org.el is loaded via org-load-hook (it's probably best to use with-eval-after-load).
When called, several procedures are defined, most being injected into Babel via advice-add:
+org--babel-lazy-load
| ID | c964d9e1-759c-40f4-b892-4579a90bfc73 |
|---|---|
| DeertopiaVisibility | public |
| ROAM_EXCLUDE | t |
(+org--babel-lazy-load LANG &optional ASYNC)
If LANG is not loaded (i.e. not present and enabled in org-babel-load-languages), try
Running each of
+org-babel-load-functions.Importing
ob-LANG.Importing
LANG.
When any attempt succeeds, run with the result and mark the language as enabled in org-babel-load-languages.
If ASYNC is non-nil, load ob-async.