Browse Source

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
Eric Schulte 14 years ago
parent
commit
1e35a5ea37
1 changed files with 9 additions and 5 deletions
  1. 9 5
      lisp/ob.el

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