diff options
author | fpi | 2018-04-13 22:38:02 +0200 |
---|---|---|
committer | fpi | 2018-04-13 22:38:02 +0200 |
commit | e46cc9367a6f5631031382679b81a3bb8e37fd97 (patch) | |
tree | 2424d7fd9c1a57416a6c223e7b99102cffe32f66 | |
parent | Added cd into proper working dir & support for :dir flag (diff) | |
parent | Add prologue to circuit; epilogue to control body parts (diff) |
Merge branch 'dev'
-rw-r--r-- | ob-spice.org | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ob-spice.org b/ob-spice.org index fecfba4..f3722a0 100644 --- a/ob-spice.org +++ b/ob-spice.org @@ -182,8 +182,7 @@ Access with ~$x[0]~ or ~$x[2-len]~. (let ((vars (org-babel--get-vars params)) (prologue (cdr (assq :prologue params))) (epilogue (cdr (assq :epilogue params))) - (file (cdr (assq :file params))) - (old-body "")) + (file (cdr (assq :file params)))) (setq body (org-babel-spice-replace-vars body vars)) ;; TODO :file stuff .... @@ -219,16 +218,16 @@ Access with ~$x[0]~ or ~$x[2-len]~. (no-source (cdr (assq :no-source params))) (break-index (if (string-match "^ *\.end *$" body) (match-end 0) 0)) - ;;todo: add prologue - (circuit-body (org-babel-spice-replace-vars + ;;vars need to be replaced as they don't work when using source + (circuit-body (org-babel-expand-body:spice (substring body 0 break-index) - vars));vars need to be replaced as they don't work when using source + (assq-delete-all :epilogue (copy-alist params)))) ;; todo: replace vars. :-( → set vars break when doing something like $file.txt - ;; todo: add only epilogue, not prologue (control-body (org-babel-spice-trim-body (substring body break-index))) (full-control-body (if control-body (org-babel-expand-body:generic - control-body params + control-body + (assq-delete-all :prologue (copy-alist params)) (org-babel-variable-assignments:spice params)))) (circuit-file (if circuit-body (org-babel-temp-file "spice-body-" ".cir"))) (result)) |