diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 98d919ea9..88241662f 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -1,23 +1,5 @@ ;;; lang/org/autoload/org.el -*- lexical-binding: t; -*- -;; HACK A necessary hack because org requires a compilation step after being -;; cloned, and during that compilation a org-version.el is generated with these -;; two functions, which return the output of a 'git describe ...' call in the -;; repo's root. Of course, this command won't work in a sparse clone, and more -;; than that, initiating these compilation step is a hassle, so... -;;;###autoload (defun +org--release-a () "9.3") -;;;###autoload (fset 'org-release #'+org--release-a) -;;;###autoload (fset 'org-git-version #'ignore) - -;; Org itself may override the above if it's loaded too early by packages that -;; depend on it, so we have to advise it once again: -;;;###autoload (advice-add #'org-release :override #'+org--release-a) -;;;###autoload (advice-add #'org-git-version :override #'ignore) -;;;###autoload (add-to-list 'load-path (dir!)) - -;;;###autoload (provide 'org-version) - - ;; ;;; Helpers diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index ceabd3a41..a52611d85 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -207,19 +207,7 @@ background (and foreground) match the current theme." ;; Fix 'require(...).print is not a function' error from `ob-js' when ;; executing JS src blocks - (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)))) + (setq org-babel-js-function-wrapper "console.log(require('util').inspect(function(){\n%s\n}()));")) (defun +org-init-babel-lazy-loader-h () diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 15ef59d61..5f4a7f17e 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -6,7 +6,23 @@ (when-let (orglib (locate-library "org" nil doom--initial-load-path)) (setq load-path (delete (substring (file-name-directory orglib) 0 -1) load-path))) -(package! org-plus-contrib) ; install cutting-edge version of org-mode + +;; HACK A necessary hack because org requires a compilation step after being +;; cloned, and during that compilation a org-version.el is generated with +;; these two functions, which return the output of a 'git describe ...' +;; call in the repo's root. Of course, this command won't work in a sparse +;; clone, and more than that, initiating these compilation step is a +;; hassle, so... +(setq straight-fix-org nil) +(add-hook! 'straight-use-package-pre-build-functions + (defun +org-fix-package-h (package &rest _) + (when (member package '("org" "org-plus-contrib")) + (with-temp-file (expand-file-name "org-version.el" (straight--repos-dir "org")) + (insert "(fset 'org-release (lambda () \"9.3\"))\n" + "(fset 'org-git-version #'ignore)\n" + "(provide 'org-version)\n"))))) + +(package! org-plus-contrib) ; install cutting-edge version of org-mode (package! htmlize) (package! org-bullets :recipe (:host github :repo "Kaligule/org-bullets"))