summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-01-09 16:25:01 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2011-02-18 12:45:10 +0100
commitb219690f0554adfe5fa2d2aebf8c0b08b1d04859 (patch)
treebe4e8ab74b075773ce2df4c4ee7ed42af6a99a46
parentc82805fc5751415b49409171188eb4be6a6cf3e0 (diff)
downloadorg-mode-b219690f0554adfe5fa2d2aebf8c0b08b1d04859.tar.gz
ob: compute correct end position when results are a list
* lisp/ob.el (org-babel-result-end): end position is end of current sublist instead of bottom point, as results might be inserted in a list themselves.
-rw-r--r--lisp/ob.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index f52fb6b..e0949fc 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -77,7 +77,8 @@
(declare-function org-list-parse-list "org-list" (&optional delete))
(declare-function org-list-to-generic "org-list" (LIST PARAMS))
(declare-function org-list-struct "org-list" ())
-(declare-function org-list-get-bottom-point "org-list" (struct))
+(declare-function org-list-struct-prev-alist "org-list" (struct))
+(declare-function org-list-get-list-end "org-list" (item struct prevs))
(defgroup org-babel nil
"Code block evaluation and management in `org-mode' documents."
@@ -1583,9 +1584,9 @@ code ---- the results are extracted in the syntax of the source
(save-excursion
(cond
((org-at-table-p) (progn (goto-char (org-table-end)) (point)))
- ((org-at-item-p) (save-excursion
- (org-beginning-of-item)
- (1- (org-list-get-bottom-point (org-list-struct)))))
+ ((org-at-item-p) (let* ((struct (org-list-struct))
+ (prevs (org-list-struct-prev-alist struct)))
+ (org-list-get-list-end (point-at-bol) struct prevs)))
(t
(let ((case-fold-search t)
(blocks-re (regexp-opt