diff options
author | fpi | 2018-04-13 23:31:32 +0200 |
---|---|---|
committer | fpi | 2018-04-13 23:47:14 +0200 |
commit | 5358840c6c2c560df84cc915e8f075e8be7e8927 (patch) | |
tree | 68cbb6bb5df08c85ac0c3c0b03aea96f360424eb | |
parent | Added use cases & examples (diff) |
Chomp result value string before returning
-rw-r--r-- | ob-spice.org | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ob-spice.org b/ob-spice.org index dfbe621..514c55b 100644 --- a/ob-spice.org +++ b/ob-spice.org @@ -350,8 +350,7 @@ Access with ~$x[0]~ or ~$x[2-len]~. ;; TODO gnuplot options (if (string= "yes" gnuplot) - nil ;return content(!) of gnuplot.plt for :post processing or - ;nowebbing spice into gnuplot + nil ;return content(!) of gnuplot.plt for :post processing with gnuplot block? nil ;return normal spice output ) result @@ -402,13 +401,16 @@ Access with ~$x[0]~ or ~$x[2-len]~. ))) (comint-send-input nil t)) ;; split result to output multiple comma separated vars as table - (split-string (org-babel-eval-read-file tmp-file) ",") - )) + (let ((result (split-string (org-babel-chomp (org-babel-eval-read-file tmp-file)) ","))) + (if (cdr result) + result + (car result)) + ))) ;;todo: add "smart" result type to display measurements (or echos?) & plot filenames ))) (provide 'ob-spice) - ;;; ob-spice.el ends here + ;;; ob-spice.el ends here #+END_SRC * Tests |