Initialize Doom in ob-async session #2010
This commit is contained in:
parent
4703992002
commit
6cc4c71872
1 changed files with 13 additions and 1 deletions
|
@ -207,7 +207,19 @@ background (and foreground) match the current theme."
|
||||||
|
|
||||||
;; Fix 'require(...).print is not a function' error from `ob-js' when
|
;; Fix 'require(...).print is not a function' error from `ob-js' when
|
||||||
;; executing JS src blocks
|
;; executing JS src blocks
|
||||||
(setq org-babel-js-function-wrapper "console.log(require('util').inspect(function(){\n%s\n}()));"))
|
(setq org-babel-js-function-wrapper "console.log(require('util').inspect(function(){\n%s\n}()));")
|
||||||
|
|
||||||
|
;; Fix #2010: ob-async needs to initialize Doom Emacs at least minimally for
|
||||||
|
;; its async babel sessions to run correctly. This cannot be a named function
|
||||||
|
;; because it is interpolated directly into a closure to be evaluated on the
|
||||||
|
;; async session.
|
||||||
|
(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
|
||||||
|
:around #'ob-async-org-babel-execute-src-block
|
||||||
|
(let ((ob-async-pre-execute-src-block-hook
|
||||||
|
;; Ensure our hook is always first
|
||||||
|
(cons `(lambda () (load ,(concat doom-emacs-dir "init.el")))
|
||||||
|
ob-async-pre-execute-src-block-hook)))
|
||||||
|
(apply orig-fn args))))
|
||||||
|
|
||||||
|
|
||||||
(defun +org-init-babel-lazy-loader-h ()
|
(defun +org-init-babel-lazy-loader-h ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue