summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2018-12-24 18:17:32 -0500
committerAmin Bandali <bandali@gnu.org>2018-12-24 18:17:32 -0500
commitc31b1ac02d0c0b4c375384dc72cc26073ecb526c (patch)
tree1ffcbd019148336a642c631e12331b01726d5d46
parent19740fc021b8c4b169ce14e1e66e1d2094b40d65 (diff)
downloadconfigs-c31b1ac02d0c0b4c375384dc72cc26073ecb526c.tar.gz
configs-c31b1ac02d0c0b4c375384dc72cc26073ecb526c.tar.xz
configs-c31b1ac02d0c0b4c375384dc72cc26073ecb526c.zip
[emacs][wip] a/async-babel-tangle: add option to byte-recompile-file
-rw-r--r--init.org14
1 files changed, 10 insertions, 4 deletions
diff --git a/init.org b/init.org
index 3d29991..3cf7343 100644
--- a/init.org
+++ b/init.org
@@ -897,9 +897,12 @@ file.
(defvar a/show-async-tangle-time nil
"Show the time spent tangling the file.")
- (defvar a/async-tangle-post-compile "make ti"
+ (defvar a/async-tangle-post-compile nil
"If non-nil, pass to `compile' after successful tangle.")
+ (defvar a/async-tangle-byte-recompile t
+ "If non-nil, byte-recompile the file on successful tangle.")
+
(defun a/async-babel-tangle ()
"Tangle org file asynchronously."
(interactive)
@@ -907,7 +910,7 @@ file.
(file (buffer-file-name))
(file-nodir (file-name-nondirectory file))
;; (async-quiet-switch "-q")
- )
+ (file-noext (file-name-sans-extension file)))
(async-start
`(lambda ()
(require 'org)
@@ -916,6 +919,7 @@ file.
`(lambda (result)
(if result
(progn
+ (setq byte-compile-warnings '(not noruntime unresolved))
(message "Tangled %s%s"
,file-nodir
(if a/show-async-tangle-time
@@ -924,7 +928,9 @@ file.
',file-tangle-start-time)))
""))
(when a/async-tangle-post-compile
- (compile a/async-tangle-post-compile)))
+ (compile a/async-tangle-post-compile))
+ (when a/async-tangle-byte-recompile
+ (byte-recompile-file (concat ,file-noext ".el"))))
(message "Tangling %s failed" ,file-nodir))))))))
(add-to-list
@@ -2432,6 +2438,6 @@ Display how long it took to load the init file.
* COMMENT Local Variables :ARCHIVE:
# Local Variables:
-# eval: ;; (add-hook 'after-save-hook #'a/async-babel-tangle 'append 'local)
+# eval: (add-hook 'after-save-hook #'a/async-babel-tangle 'append 'local)
# eval: (typo-mode -1)
# End: