From 1e35a5ea37194d686f432d384f4e264498ca6294 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Mon, 21 Feb 2011 12:40:49 -0700 Subject: [PATCH] ob: updates related to list changes * lisp/ob.el (org-babel-read-list): Reading the value of a list has been updated to reflect the new structure of org-mode lists in elisp. (org-babel-insert-result): Writing code block results to lists has been updated to reflect the new list structure. (org-babel-result-end): Remove a previous change to end-of-list marker detection --- lisp/ob.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 970ebd9d7..4d00cc563 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -1391,7 +1391,7 @@ following the source block." (defun org-babel-read-list () "Read the list at `point' into emacs-lisp." - (mapcar #'org-babel-read (cdr (org-list-parse-list)))) + (mapcar #'org-babel-read (mapcar #'cadr (cdr (org-list-parse-list))))) (defvar org-link-types-re) (defun org-babel-read-link () @@ -1519,9 +1519,13 @@ code ---- the results are extracted in the syntax of the source ((member "list" result-params) (insert (org-babel-trim - (org-list-to-generic (cons 'unordered - (if (listp result) result (list result))) - '(:splicep nil :istart "- " :iend "\n"))))) + (org-list-to-generic + (cons 'unordered + (mapcar + (lambda (el) (list nil (if (stringp el) el (format "%S" el)))) + (if (listp result) result (list result)))) + '(:splicep nil :istart "- " :iend "\n"))) + "\n")) ;; assume the result is a table if it's not a string ((not (stringp result)) (goto-char beg) @@ -1589,7 +1593,7 @@ code ---- the results are extracted in the syntax of the source ((org-at-table-p) (progn (goto-char (org-table-end)) (point))) ((org-at-item-p) (let* ((struct (org-list-struct)) (prvs (org-list-prevs-alist struct))) - (1- (org-list-get-list-end (point-at-bol) struct prvs)))) + (org-list-get-list-end (point-at-bol) struct prvs))) (t (let ((case-fold-search t) (blocks-re (regexp-opt