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
This commit is contained in:
Eric Schulte 2011-02-21 12:40:49 -07:00
parent 99aa57fb20
commit 1e35a5ea37
1 changed files with 9 additions and 5 deletions

View File

@ -1391,7 +1391,7 @@ following the source block."
(defun org-babel-read-list () (defun org-babel-read-list ()
"Read the list at `point' into emacs-lisp." "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) (defvar org-link-types-re)
(defun org-babel-read-link () (defun org-babel-read-link ()
@ -1519,9 +1519,13 @@ code ---- the results are extracted in the syntax of the source
((member "list" result-params) ((member "list" result-params)
(insert (insert
(org-babel-trim (org-babel-trim
(org-list-to-generic (cons 'unordered (org-list-to-generic
(if (listp result) result (list result))) (cons 'unordered
'(:splicep nil :istart "- " :iend "\n"))))) (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 ;; assume the result is a table if it's not a string
((not (stringp result)) ((not (stringp result))
(goto-char beg) (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-table-p) (progn (goto-char (org-table-end)) (point)))
((org-at-item-p) (let* ((struct (org-list-struct)) ((org-at-item-p) (let* ((struct (org-list-struct))
(prvs (org-list-prevs-alist 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 (t
(let ((case-fold-search t) (let ((case-fold-search t)
(blocks-re (regexp-opt (blocks-re (regexp-opt