From 2a78b9bb830bf5048097f753424e70a45b7f43ec Mon Sep 17 00:00:00 2001 From: Samuel Tschiedel Date: Tue, 21 Oct 2025 21:20:49 -0300 Subject: [PATCH] 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`. --- modules/lang/org/config.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 9a3e7ef21..cf34a2675 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -298,11 +298,11 @@ Also adds support for a `:sync' parameter to override `:async'." "Load babel libraries lazily when babel blocks are executed." (defun +org--babel-lazy-load (lang &optional async) (cl-check-type lang (or symbol null)) + ;; ob-async has its own agenda for lazy loading packages (in the child + ;; process), so we only need to make sure it's loaded. + (when async + (require 'ob-async nil t)) (unless (cdr (assq lang org-babel-load-languages)) - (when async - ;; ob-async has its own agenda for lazy loading packages (in the child - ;; process), so we only need to make sure it's loaded. - (require 'ob-async nil t)) (prog1 (or (run-hook-with-args-until-success '+org-babel-load-functions lang) (require (intern (format "ob-%s" lang)) nil t) (require lang nil t))