# HG changeset patch # User Robert McIntyre # Date 1318691763 25200 # Node ID 341a5da5f1968a5bceef31dcef7442ed479eb0f5 created tangle, which will extract source code from an org file diff -r 000000000000 -r 341a5da5f196 tangle.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangle.sh Sat Oct 15 08:16:03 2011 -0700 @@ -0,0 +1,23 @@ +#!/bin/sh +# -*- mode: shell-script -*- +# +# tangle files with org-mode +# +DIR=`pwd` +FILES="" +ORGINSTALL="/home/r/config/emacs/extend/org-mode/lisp/org-install.el" + +# wrap each argument in the code required to call tangle on it +for i in $@; do + FILES="$FILES \"$i\"" +done + +emacs -Q --batch \ +--eval "(progn +(add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/lisp/\")) +(add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/contrib/lisp/\")) +(require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle) +(mapc (lambda (file) + (find-file (expand-file-name file \"$DIR\")) + (org-babel-tangle) + (kill-buffer)) '($FILES)))" 2>&1 | pcregrep '(Wrote)|(tangled)'