annotate 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
rev   line source
rlm@0 1 #!/bin/sh
rlm@0 2 # -*- mode: shell-script -*-
rlm@0 3 #
rlm@0 4 # tangle files with org-mode
rlm@0 5 #
rlm@0 6 DIR=`pwd`
rlm@0 7 FILES=""
rlm@0 8 ORGINSTALL="/home/r/config/emacs/extend/org-mode/lisp/org-install.el"
rlm@0 9
rlm@0 10 # wrap each argument in the code required to call tangle on it
rlm@0 11 for i in $@; do
rlm@0 12 FILES="$FILES \"$i\""
rlm@0 13 done
rlm@0 14
rlm@0 15 emacs -Q --batch \
rlm@0 16 --eval "(progn
rlm@0 17 (add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/lisp/\"))
rlm@0 18 (add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/contrib/lisp/\"))
rlm@0 19 (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
rlm@0 20 (mapc (lambda (file)
rlm@0 21 (find-file (expand-file-name file \"$DIR\"))
rlm@0 22 (org-babel-tangle)
rlm@0 23 (kill-buffer)) '($FILES)))" 2>&1 | pcregrep '(Wrote)|(tangled)'