瀏覽代碼

Merge branch 'ded-babel'

Dan Davison 14 年之前
父節點
當前提交
f318bdb19b
共有 3 個文件被更改,包括 5 次插入8 次删除
  1. 2 2
      lisp/ob-R.el
  2. 1 4
      lisp/ob-python.el
  3. 2 2
      lisp/ob.el

+ 2 - 2
lisp/ob-R.el

@@ -230,7 +230,7 @@ return the value of the last statement in BODY, as elisp."
 				     "FALSE")))
 	   (org-babel-R-process-value-result
 	    (org-babel-import-elisp-from-file
-	     (org-babel-maybe-remote-file tmp-file)) column-names-p))))
+	     (org-babel-maybe-remote-file tmp-file) '(16)) column-names-p))))
     ;; comint session evaluation
     (case result-type
       (value
@@ -251,7 +251,7 @@ return the value of the last statement in BODY, as elisp."
 	   (inferior-ess-send-input))
 	 (org-babel-R-process-value-result
 	  (org-babel-import-elisp-from-file
-	   (org-babel-maybe-remote-file tmp-file))  column-names-p)))
+	   (org-babel-maybe-remote-file tmp-file) '(16))  column-names-p)))
       (output
        (mapconcat
 	#'org-babel-chomp

+ 1 - 4
lisp/ob-python.el

@@ -125,10 +125,7 @@ Emacs-lisp table, otherwise return the results as a string."
 	 (mapcar (lambda (el) (if (equal el 'None) 'hline el)) res)
        res))
    (org-babel-read
-    (if (or (and (equal (substring results 0 1) "[")
-		 (equal (substring results -2 -1) "]"))
-	    (and (equal (substring results 0 1) "(")
-		 (equal (substring results -2 -1) ")")))
+    (if (and (stringp results) (string-match "^[([].+[])]$" results))
        (org-babel-read
         (concat "'"
                 (replace-regexp-in-string

+ 2 - 2
lisp/ob.el

@@ -1508,7 +1508,7 @@ This is taken almost directly from `org-read-prop'."
 	      (length string)))
       (string-to-number string)))
 
-(defun org-babel-import-elisp-from-file (file-name)
+(defun org-babel-import-elisp-from-file (file-name &optional separator)
   "Read the results located at FILE-NAME into an elisp table.
 If the table is trivial, then return it as a scalar."
   (let (result)
@@ -1516,7 +1516,7 @@ If the table is trivial, then return it as a scalar."
       (with-temp-buffer
 	(condition-case nil
 	    (progn
-	      (org-table-import file-name nil)
+	      (org-table-import file-name separator)
 	      (delete-file file-name)
 	      (setq result (mapcar (lambda (row)
 				     (mapcar #'org-babel-string-read row))