Half-revert 92e604d0
+ Fixes config.org buffer being killed when tangled + Tangle files in same session if ob-tangle is loaded (and in noninteractive sessions). i.e. only tangle quietly when starting up interactive Emacs.
This commit is contained in:
parent
ece7b8fdcd
commit
132ad7d391
1 changed files with 17 additions and 11 deletions
|
@ -18,21 +18,27 @@ byte-compiled from.")
|
||||||
(when (or force-p (file-newer-than-file-p org +literate-config-cache-file))
|
(when (or force-p (file-newer-than-file-p org +literate-config-cache-file))
|
||||||
(message "Compiling your literate config...")
|
(message "Compiling your literate config...")
|
||||||
|
|
||||||
;; We tangle in a separate, blank process because loading it here would
|
(setq org (file-truename +literate-config-file))
|
||||||
;; load all of :lang org (very expensive!).
|
(or (and (if (fboundp 'org-babel-tangle-file)
|
||||||
(or (and (zerop (call-process
|
(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
|
"emacs" nil nil nil
|
||||||
"-q" "--batch" "-l" "ob-tangle" "--eval"
|
"-q" "--batch" "-l" "ob-tangle" "--eval"
|
||||||
(format "(org-babel-tangle-file %S nil \"emacs-lisp\")"
|
(format "(org-babel-tangle-file %S nil \"emacs-lisp\")"
|
||||||
org)))
|
org))))
|
||||||
;; Write the cache file to serve as our mtime cache
|
;; Write the cache file to serve as our mtime cache
|
||||||
(with-temp-file +literate-config-cache-file t))
|
(with-temp-file +literate-config-cache-file
|
||||||
(warn "There was a problem tangling your literate config!"))
|
(message "Done!")))
|
||||||
|
(warn "There was a problem tangling your literate config!")))))
|
||||||
|
|
||||||
(message "Done!"))))
|
|
||||||
|
|
||||||
;; Let 'er rip!
|
;; 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
|
;; No need to load the resulting file. Doom will do this for us after all
|
||||||
;; modules have finished loading.
|
;; modules have finished loading.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue