changeset 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
files tangle.sh
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tangle.sh	Sat Oct 15 08:16:03 2011 -0700
     1.3 @@ -0,0 +1,23 @@
     1.4 +#!/bin/sh
     1.5 +# -*- mode: shell-script -*-
     1.6 +#
     1.7 +# tangle files with org-mode
     1.8 +#
     1.9 +DIR=`pwd`
    1.10 +FILES=""
    1.11 +ORGINSTALL="/home/r/config/emacs/extend/org-mode/lisp/org-install.el"
    1.12 +
    1.13 +# wrap each argument in the code required to call tangle on it
    1.14 +for i in $@; do
    1.15 +    FILES="$FILES \"$i\""
    1.16 +done
    1.17 +
    1.18 +emacs -Q --batch  \
    1.19 +--eval "(progn
    1.20 +(add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/lisp/\"))
    1.21 +(add-to-list 'load-path (expand-file-name \"/home/r/config/emacs/extend/org-mode/contrib/lisp/\"))
    1.22 +(require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
    1.23 +(mapc (lambda (file)
    1.24 +       (find-file (expand-file-name file \"$DIR\"))
    1.25 +       (org-babel-tangle)
    1.26 +       (kill-buffer)) '($FILES)))" 2>&1 | pcregrep '(Wrote)|(tangled)'