From d07c2f3b5c1f25637a12569697044cecf8008773 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 14 Aug 2009 15:33:49 -0600 Subject: [PATCH] [BUG FIX] DONE problem with newlines in output when :results value --- lisp/org-babel.el | 3 ++- org-babel.org | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lisp/org-babel.el b/lisp/org-babel.el index d0c5d40ed..e67c8cd5e 100644 --- a/lisp/org-babel.el +++ b/lisp/org-babel.el @@ -668,7 +668,8 @@ This is taken almost directly from `org-read-prop'." (defun org-babel-number-p (string) "Return t if STRING represents a number" - (if (string-match "^[[:digit:]]*\\.?[[:digit:]]*$" string) + (if (and (string-match "^[[:digit:]]*\\.?[[:digit:]]*$" string) + (= (match-end 0) (length string))) (string-to-number string))) (defun org-babel-import-elisp-from-file (file-name) diff --git a/org-babel.org b/org-babel.org index f9e4e311c..1dc28d3fc 100644 --- a/org-babel.org +++ b/org-babel.org @@ -2819,7 +2819,7 @@ dot("$(2a,0)$",(2,0),N+E); *** DONE sh -* Bugs [34/41] +* Bugs [35/41] ** TODO Python session evaluation bug The following block evaluates correctly with :session none (set :results to output), but fails with session-based evaluation @@ -2915,7 +2915,7 @@ I have this error showing up: executing Ruby source code block apply: Searching for program: no such file or directory, irb -** TODO problem with newlines in output when :results value +** DONE problem with newlines in output when :results value #+begin_src python :results value '\n'.join(map(str, range(4))) @@ -2923,7 +2923,9 @@ apply: Searching for program: no such file or directory, irb #+resname: : 0 - +: 1 +: 2 +: 3 Whereas I was hoping for @@ -2932,6 +2934,20 @@ Whereas I was hoping for | 2 | | 3 | +This is now working, it doesn't return as a table because the value +returned is technically a string. To return the table mentioned above +try something like the following. + +#+begin_src python +[[0], [1], [2], [3]] +#+end_src + +#+resname: +| 0 | +| 1 | +| 2 | +| 3 | + This is some sort of non-printing char / quoting issue I think. Note that