aboutsummaryrefslogtreecommitdiffhomepage
path: root/tangle
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2015-10-20 18:52:12 -0400
committerRalph Amissah <ralph@amissah.com>2015-10-20 22:13:25 -0400
commit4b0c115b58211dcc063bcd09f8fe122e558b92ce (patch)
treeb60e38935a4f5fbd723c13a5035d952976c851bf /tangle
parentupdate minor (diff)
literate programming introduced, tangle not yet run
Diffstat (limited to 'tangle')
-rwxr-xr-xtangle23
1 files changed, 23 insertions, 0 deletions
diff --git a/tangle b/tangle
new file mode 100755
index 0000000..8e7569d
--- /dev/null
+++ b/tangle
@@ -0,0 +1,23 @@
+#!/bin/sh
+# -*- mode: shell-script -*-
+# tangle files with org-mode
+DIR=`pwd`
+ORGFILES=""
+EMACSLISP=/usr/share/emacs/site-lisp
+EMACSLISP_ORG=~/.emacs.d/elpa/org-20151005
+EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-20151005
+# wrap each argument in the code required to call tangle on it
+for i in $@; do
+ ORGFILES="$ORGFILES \"$i\""
+done
+emacs --batch -Q -q \
+--eval "(progn
+(add-to-list 'load-path (expand-file-name \"$EMACSLISP\"))
+(add-to-list 'load-path (expand-file-name \"$EMACSLISP_ORG\" t))
+(add-to-list 'load-path (expand-file-name \"$EMACSLISP_ORG_CONTRIB\" t))
+(require 'org)(require 'ob)(require 'ob-tangle)
+(mapc (lambda (file)
+ (find-file (expand-file-name file \"$DIR\"))
+ (setq-local org-src-preserve-indentation t)
+ (org-babel-tangle)
+ (kill-buffer)) '($ORGFILES)))" 2>&1 #|grep tangled