From 0ec4d6ee436cd8ae3ee16642ab1d2821114bef0f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 8 Jun 2018 16:23:13 +0200 Subject: [PATCH] config/literate: earlier check & no byte-compile Making the compile check happen earlier fixes an edge case where the resulting files from a literate config being tangled into multiple files aren't recognized by Doom's package management or autoload generation systems. Disabling byte-compiling fixes an all too common issue where packages and macros are undefined at compile time, causing a plethora of invalid function errors. Leave byte-compilation to `bin/doom compile`! --- .../config/literate/{config.el => init.el} | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename modules/config/literate/{config.el => init.el} (68%) diff --git a/modules/config/literate/config.el b/modules/config/literate/init.el similarity index 68% rename from modules/config/literate/config.el rename to modules/config/literate/init.el index 05e2a870e..a7a7c19e7 100644 --- a/modules/config/literate/config.el +++ b/modules/config/literate/init.el @@ -1,3 +1,5 @@ +;;; config/literate/init.el -*- lexical-binding: t; -*- + ;;; config/literate/config.el -*- lexical-binding: t; -*- (defvar +literate-config-file @@ -15,21 +17,19 @@ byte-compiled from.") "Tangles & compiles `+literate-config-file' if it has changed. If LOAD is non-nil, load it too!" (let ((org +literate-config-file) - (elc (concat +literate-config-dest-file "c"))) - ;; If config is pre-compiled, then load that - (when (file-newer-than-file-p org elc) + (el +literate-config-dest-file)) + (when (file-newer-than-file-p org el) (message "Compiling your literate config...") - ;; We tangle in a separate, blank process because loading it here would load - ;; all of :lang org, which will be more expensive than it needs to be. + + ;; We tangle in a separate, blank process because loading it here would + ;; load all of :lang org (very expensive!). We only need ob-tangle. (or (zerop (call-process "emacs" nil nil nil "-q" "--batch" "-l" "ob-tangle" "--eval" (format "(org-babel-tangle-file \"%s\" \"%s\" \"emacs-lisp\")" - org +literate-config-dest-file))) - (error "There was a problem tangling your literate config!")) - ;; Then byte-compile it! - (require 'bytecomp) - (byte-compile-file +literate-config-dest-file load) + org el))) + (warn "There was a problem tangling your literate config!")) + (message "Done!")))) ;; Let 'er rip!