added more tests, still not there

This commit is contained in:
Eric Schulte 2009-07-24 22:12:52 -06:00
parent f4f626e3e1
commit 97d8e85a92
2 changed files with 24 additions and 4 deletions

View File

@ -460,14 +460,16 @@ silent -- no results are inserted"
(org-cycle))))
(message "finished"))))
(defun org-babel-open-src-block-result ()
(defun org-babel-open-src-block-result (&optional re-run)
(interactive)
"If `point' is on a src block then open the results of the
source code block, otherwise return nil."
source code block, otherwise return nil. With optional prefix
argument RE-RUN the source-code block is evaluated even if
results already exist."
(when (org-babel-get-src-block-info)
(save-excursion
;; go to the results, if there aren't any then run the block
(goto-char (or (org-babel-where-is-src-block-result)
(goto-char (or (and (not re-run) (org-babel-where-is-src-block-result))
(progn (org-babel-execute-src-block)
(org-babel-where-is-src-block-result))))
(move-end-of-line 1) (forward-char 1)
@ -479,7 +481,7 @@ source code block, otherwise return nil."
(pop-to-buffer (get-buffer-create "org-babel-results"))
(delete-region (point-min) (point-max))
(if (listp results)
(insert (orgtbl-to-tsv results))
(insert (orgtbl-to-tsv (list results) nil))
(insert results)))))))
(defun org-babel-result-to-org-string (result)

View File

@ -479,6 +479,24 @@ This could also act reasonably with other results types...
#+resname:
[[file:blue.png][blue.png]]
#+srcname: task-open-vector
#+begin_src emacs-lisp
'((1 2) (3 4))
#+end_src
#+resname:
| 1 | 2 |
| 3 | 4 |
#+srcname: task-open-scalar
#+begin_src emacs-lisp
3
#+end_src
#+resname:
: 3
** TODO Finalise behaviour regarding vector/scalar output