mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
fix(org): check :async on already loaded languages
Running a regular/`:sync` source block would prevent successive invocations of blocks of that same language with `:async` from loading `ob-async`.
This commit is contained in:
parent
bf62193238
commit
4b7431cba3
1 changed files with 4 additions and 4 deletions
|
|
@ -298,11 +298,11 @@ Also adds support for a `:sync' parameter to override `:async'."
|
||||||
"Load babel libraries lazily when babel blocks are executed."
|
"Load babel libraries lazily when babel blocks are executed."
|
||||||
(defun +org--babel-lazy-load (lang &optional async)
|
(defun +org--babel-lazy-load (lang &optional async)
|
||||||
(cl-check-type lang (or symbol null))
|
(cl-check-type lang (or symbol null))
|
||||||
(unless (cdr (assq lang org-babel-load-languages))
|
|
||||||
(when async
|
|
||||||
;; ob-async has its own agenda for lazy loading packages (in the child
|
;; ob-async has its own agenda for lazy loading packages (in the child
|
||||||
;; process), so we only need to make sure it's loaded.
|
;; process), so we only need to make sure it's loaded.
|
||||||
|
(when async
|
||||||
(require 'ob-async nil t))
|
(require 'ob-async nil t))
|
||||||
|
(unless (cdr (assq lang org-babel-load-languages))
|
||||||
(prog1 (or (run-hook-with-args-until-success '+org-babel-load-functions lang)
|
(prog1 (or (run-hook-with-args-until-success '+org-babel-load-functions lang)
|
||||||
(require (intern (format "ob-%s" lang)) nil t)
|
(require (intern (format "ob-%s" lang)) nil t)
|
||||||
(require lang nil t))
|
(require lang nil t))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue