diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-01-09 16:25:01 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-02-18 12:45:10 +0100 |
commit | b219690f0554adfe5fa2d2aebf8c0b08b1d04859 (patch) | |
tree | be4e8ab74b075773ce2df4c4ee7ed42af6a99a46 | |
parent | c82805fc5751415b49409171188eb4be6a6cf3e0 (diff) | |
download | org-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.el | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |