Browse Source

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.
Nicolas Goaziou 14 years ago
parent
commit
b219690f05
1 changed files with 5 additions and 4 deletions
  1. 5 4
      lisp/ob.el

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