view tangle.sh @ 0:341a5da5f196

created tangle, which will extract source code from an org file
author Robert McIntyre <rlm@mit.edu>
date Sat, 15 Oct 2011 08:16:03 -0700
parents
children fd36f08d32c5
line wrap: on
line source
1 #!/bin/sh
2 # -*- mode: shell-script -*-
3 #
4 # tangle files with org-mode
5 #
6 DIR=`pwd`
7 FILES=""
8 ORGINSTALL="/home/r/config/emacs/extend/org-mode/lisp/org-install.el"
10 # wrap each argument in the code required to call tangle on it
11 for i in $@; do
12 FILES="$FILES \"$i\""
13 done
15 emacs -Q --batch \
16 --eval "(progn
17 (add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/lisp/\"))
18 (add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/contrib/lisp/\"))
19 (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
20 (mapc (lambda (file)
21 (find-file (expand-file-name file \"$DIR\"))
22 (org-babel-tangle)
23 (kill-buffer)) '($FILES)))" 2>&1 | pcregrep '(Wrote)|(tangled)'