diff --git a/modules/config/literate/init.el b/modules/config/literate/init.el index 1062c0f61..ed551e0e3 100644 --- a/modules/config/literate/init.el +++ b/modules/config/literate/init.el @@ -18,21 +18,27 @@ byte-compiled from.") (when (or force-p (file-newer-than-file-p org +literate-config-cache-file)) (message "Compiling your literate config...") - ;; We tangle in a separate, blank process because loading it here would - ;; load all of :lang org (very expensive!). - (or (and (zerop (call-process - "emacs" nil nil nil - "-q" "--batch" "-l" "ob-tangle" "--eval" - (format "(org-babel-tangle-file %S nil \"emacs-lisp\")" - org))) + (setq org (file-truename +literate-config-file)) + (or (and (if (fboundp 'org-babel-tangle-file) + (org-babel-tangle-file org nil "emacs-lisp") + ;; We tangle in a separate, blank process because loading it + ;; here would load all of :lang org (very expensive!). + (zerop (call-process + "emacs" nil nil nil + "-q" "--batch" "-l" "ob-tangle" "--eval" + (format "(org-babel-tangle-file %S nil \"emacs-lisp\")" + org)))) ;; Write the cache file to serve as our mtime cache - (with-temp-file +literate-config-cache-file t)) - (warn "There was a problem tangling your literate config!")) + (with-temp-file +literate-config-cache-file + (message "Done!"))) + (warn "There was a problem tangling your literate config!"))))) - (message "Done!")))) ;; Let 'er rip! -(+literate-tangle doom-reloading-p) +(when noninteractive + (require 'ob-tangle nil t)) + +(+literate-tangle (or doom-reloading-p noninteractive)) ;; No need to load the resulting file. Doom will do this for us after all ;; modules have finished loading.