summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-08-08 22:01:17 -0600
committerEric Schulte <schulte.eric@gmail.com>2010-08-08 22:01:17 -0600
commit693cea9bb95f4eac41d9f1c97192c70cb0bd1263 (patch)
tree357dc101ba05733d7d41d80ccad10fe71bf6a5d6
parent043f08875340159bb5a959aef8c408b107ccd1dc (diff)
downloadorg-mode-693cea9bb95f4eac41d9f1c97192c70cb0bd1263.tar.gz
ob.el fixed bug when inserting into empty buffer
* lisp/ob.el (org-babel-insert-result): ensures `beg' is set, even if no previous result exists
-rw-r--r--lisp/ob.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index b185f18..b5b9d8f 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1187,7 +1187,8 @@ code ---- the results are extracted in the syntax of the source
(results-switches
(cdr (assoc :results_switches (nth 2 info))))
beg end)
- (when existing-result
+ (if (not existing-result)
+ (setq beg (point))
(goto-char existing-result)
(save-excursion
(re-search-forward "#" nil t)