From c12003708f691862086aac30c675868cd69d6bb3 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 6 Apr 2013 10:18:35 -0600 Subject: [PATCH] raw org and drawer imply verbatim results This unifies the results handling across a number of different languages. It is still possible to force tabular output by adding the ":results table" argument. The following example demonstrates the results in shell python and perl. ** drawer and table #+begin_src sh :results drawer table echo -e "1\n2\n3" #+end_src #+RESULTS: :RESULTS: | 1 | | 2 | | 3 | :END: #+begin_src perl :results drawer table "1\n2\n3" #+end_src #+RESULTS: :RESULTS: | 1 | | 2 | | 3 | :END: #+begin_src python :results drawer table return "1\n2\n3" #+end_src #+RESULTS: :RESULTS: | 1\n2\n3 | :END: ** drawer #+begin_src sh :results drawer echo -e "1\n2\n3" #+end_src #+RESULTS: :RESULTS: 1 2 3 :END: #+begin_src perl :results drawer "1\n2\n3" #+end_src #+RESULTS: :RESULTS: 1 2 3 :END: #+begin_src python :results drawer return "1\n2\n3" #+end_src #+RESULTS: :RESULTS: 1 2 3 :END: ** raw #+begin_src sh :results raw echo -e "1\n2\n3" #+end_src #+RESULTS: 1 2 3 #+begin_src perl :results raw "1\n2\n3" #+end_src #+RESULTS: 1 2 3 #+begin_src python :results raw return "1\n2\n3" #+end_src #+RESULTS: 1 2 3 * lisp/ob-core.el (org-babel-result-cond): The "raw", "org" and "drawer" :results header argument values preclude table processing unless the "table" argument is given as well. --- lisp/ob-core.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index bba2dfe..b8f863f 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2637,10 +2637,14 @@ Emacs shutdown.")) (member "html" ,result-params) (member "code" ,result-params) (member "pp" ,result-params) - (and (member "output" ,result-params) + (and (or (member "output" ,result-params) + (member "raw" ,result-params) + (member "org" ,result-params) + (member "drawer" ,result-params)) (not (member "table" ,result-params)))) ,scalar-form ,@table-forms))) +(def-edebug-spec org-babel-result-cond (form form body)) (defun org-babel-temp-file (prefix &optional suffix) "Create a temporary file in the `org-babel-temporary-directory'. -- 1.8.2