aboutsummaryrefslogtreecommitdiff
path: root/Doom/.doom.d/org/literate.org
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-04 05:15:49 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-05 02:59:45 +0100
commitfbc6a4427c5e3d2cf282d235a3a41c3f85c587e2 (patch)
treeb333c42ba971cd86472384f9c8c9b4063c5e2e3e /Doom/.doom.d/org/literate.org
parentcfc7859884d4ad62a1a3c8cee8433e59c8732dcc (diff)
downloaddotfiles-fbc6a4427c5e3d2cf282d235a3a41c3f85c587e2.tar.gz
dotfiles-fbc6a4427c5e3d2cf282d235a3a41c3f85c587e2.tar.bz2
dotfiles-fbc6a4427c5e3d2cf282d235a3a41c3f85c587e2.zip
~call-process -> async-shell-command
Async shell command gives me a buffer for my output, is faster as it's async rather than blocking my Emacs, and all around better to use.
Diffstat (limited to 'Doom/.doom.d/org/literate.org')
-rw-r--r--Doom/.doom.d/org/literate.org20
1 files changed, 9 insertions, 11 deletions
diff --git a/Doom/.doom.d/org/literate.org b/Doom/.doom.d/org/literate.org
index f10f7de..0bacd7e 100644
--- a/Doom/.doom.d/org/literate.org
+++ b/Doom/.doom.d/org/literate.org
@@ -39,6 +39,7 @@ multiple /differing/ outputs easily if it isn't specified a destination.
(expand-file-name (concat dx:literate/bin-dir "\\1.el")) SRC))
#+END_SRC
* Parser
+** Tangle function
First we need to get some sort of parser which can, given a source org file and
a destination, parse and produce an Emacs lisp file. We'll copy this from the
literate module of doom.
@@ -49,17 +50,14 @@ literate module of doom.
(when (file-newer-than-file-p SRC DEST)
(let ((output (get-buffer-create "*org-tangle*")))
(unwind-protect
- (or (and (zerop (call-process
- "emacs" nil output nil
- "-q" "--batch"
- "-l" "ob-tangle"
- "--eval" (format "(org-babel-tangle-file %S %S)"
- SRC DEST)))
- (with-current-buffer output
- (message "%s" (buffer-string))
- t))
- (warn (format "Problem with tanging %S to %S" SRC DEST)))
- (kill-buffer output))))))
+ (async-shell-command
+ (concat "emacs "
+ "-q " "--batch "
+ "-l " "ob-tangle "
+ "--eval "
+ (format "'(org-babel-tangle-file %S %S)'" SRC DEST))
+ "*org-tangle-messages*"
+ "*org-tangle-errors*"))))))
#+END_SRC
* Hook on save
Now we need to make a hook function that, when the current buffer is an org file