Created
September 27, 2015 23:28
-
-
Save jsscclr/2b3f468bf25dc6960072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tangle-init () | |
"If the current buffer is 'init.org' the code-blocks are | |
tangled, and the tangled file is compiled." | |
(when (equal (buffer-file-name) | |
(expand-file-name (concat user-emacs-directory "init.org"))) | |
;; Avoid running hooks when tangling. | |
(let ((prog-mode-hook nil)) | |
(org-babel-tangle) | |
(byte-compile-file (concat user-emacs-directory "init.el"))))) | |
(add-hook 'after-save-hook 'tangle-init) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment