summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-03-17 10:39:59 +0100
committerAlan Pearce2017-03-17 10:39:59 +0100
commite23229baf851e14630889b21d956e23f13aae870 (patch)
tree8bd04206f643e5e8a8d5e3ac291048650854c62b /emacs
parent9595844538a4bcf53bec628874605f8c49d589c5 (diff)
downloadnixfiles-e23229baf851e14630889b21d956e23f13aae870.tar.lz
nixfiles-e23229baf851e14630889b21d956e23f13aae870.tar.zst
nixfiles-e23229baf851e14630889b21d956e23f13aae870.zip
Replace emacs hook with makefile
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/emacs/.emacs.d/Makefile b/emacs/.emacs.d/Makefile
new file mode 100644
index 00000000..fd51e397
--- /dev/null
+++ b/emacs/.emacs.d/Makefile
@@ -0,0 +1,19 @@
+define EMACS_TANGLE
+(progn\
+  (setq vc-follow-symlinks nil)\
+  (find-file \"init.org\")\
+  (require 'ob-tangle)\
+  (org-babel-tangle nil \"init.el\"))
+endef
+
+all: init.elc
+.PHONY: all
+
+init.el:
+	@emacs --batch --no-init-file --eval "$(EMACS_TANGLE)" --kill
+
+init.elc: init.el
+	@emacs --batch --no-init-file --funcall batch-byte-compile init.el
+
+clean:
+	rm init.el init.elc