aboutsummaryrefslogtreecommitdiffhomepage
path: root/tangle
blob: 79b884b38fc392d2fdea19ae3b2a4a9cbdf75133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# -*- mode: shell-script -*-
# tangle files with org-mode
DIR=`pwd`
ORGFILES=""
EMACSLISP=/usr/share/emacs/site-lisp
ORG_VERSION=20160725
EMACSLISP_ORG=~/.emacs.d/elpa/org-$($(shell echo $(ORG_VERSION)))
EMACSLISP_ORG_CONTRIB=~/.emacs.d/elpa/org-plus-contrib-$($(shell echo $(ORG_VERSION)))
# 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