From 11afb81cb0160d21452fd32f575b4468536c9689 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Nov 2020 13:47:45 -0600 Subject: Asyncify tangling --- config.org | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/config.org b/config.org index 9060061..f396166 100644 --- a/config.org +++ b/config.org @@ -69,10 +69,20 @@ After the first run, the above ~init.el~ will be replaced by the tangled stuff h and the tangled file is compiled and loaded." (interactive) (when (equal (buffer-file-name) - (expand-file-name (concat user-emacs-directory "config.org"))) - ;; Avoid running hooks when tangling. - (let ((prog-mode-hook nil)) - (org-babel-tangle)))) + (expand-file-name + (concat user-emacs-directory "config.org"))) + ;; Now with async! + (require 'async) + (async-start + `(lambda () + ;; Avoid running hooks when tangling. + (let ((prog-mode-hook nil)) + (require 'org) + (org-babel-tangle-file + (expand-file-name + (concat user-emacs-directory "config.org"))))) + (lambda (_) + (message "Tangle complete."))))) (add-hook 'after-save-hook #'acdw/tangle-init) #+END_SRC -- cgit 1.4.1-21-gabe81