Browse Source

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.
Eric Schulte 9 years ago
parent
commit
1c3ef40f24
1 changed files with 5 additions and 4 deletions
  1. 5 4
      lisp/ob.el

+ 5 - 4
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