summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-01-11 10:41:35 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-01-11 10:41:35 -0700
commit1c3ef40f2491b118965cbdbbe5bd35a00dbc8b62 (patch)
tree32aad9c897b011925af28c62758f04f1d343fe12
parent9318030ba36866f00f7330480a0930ea992aa398 (diff)
downloadorg-mode-1c3ef40f2491b118965cbdbbe5bd35a00dbc8b62.tar.gz
ob: fixed bug in org-babel-read-result
Thanks to Leo Alekseyev for bringing this bug to my attention * lisp/ob.el (org-babel-open-src-block-result): Must collect result *before* jumping to the result buffer.
-rw-r--r--lisp/ob.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 2fd776f..d6326c7 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -592,10 +592,11 @@ results already exist."
(if (looking-at org-bracket-link-regexp)
;; file results
(org-open-at-point)
- (pop-to-buffer (get-buffer-create "*Org-Babel Results*"))
- (delete-region (point-min) (point-max))
- (insert (org-babel-format-result (org-babel-read-result)
- (cdr (assoc :sep (nth 2 info))))))
+ (let ((r (org-babel-format-result
+ (org-babel-read-result) (cdr (assoc :sep (nth 2 info))))))
+ (pop-to-buffer (get-buffer-create "*Org-Babel Results*"))
+ (delete-region (point-min) (point-max))
+ (insert r)))
t))))
;;;###autoload