Explorar o código

ob-c: no longer ignores the :results vector header argument

* lisp/ob-C.el (org-babel-C-execute): no longer ignores the :results vector
  header argument
Eric Schulte %!s(int64=14) %!d(string=hai) anos
pai
achega
2cd33b94d9
Modificáronse 1 ficheiros con 13 adicións e 9 borrados
  1. 13 9
      lisp/ob-C.el

+ 13 - 9
lisp/ob-C.el

@@ -105,16 +105,20 @@ or `org-babel-execute:c++'."
 		     (mapconcat 'identity
 				(if (listp flags) flags (list flags)) " ")
 		     tmp-src-file) ""))))
-    (org-babel-reassemble-table
-     (org-babel-read
-      (org-babel-trim
+    ((lambda (results)
+       (org-babel-reassemble-table
+	(if (member "vector" (nth 2 processed-params))
+	    (let ((tmp-file (make-temp-file "ob-c")))
+	      (with-temp-file tmp-file (insert results))
+	      (org-babel-import-elisp-from-file tmp-file))
+	  (org-babel-read results))
+	(org-babel-pick-name
+	 (nth 4 processed-params) (cdr (assoc :colnames params)))
+	(org-babel-pick-name
+	 (nth 5 processed-params) (cdr (assoc :rownames params)))))
+     (org-babel-trim
        (org-babel-eval
-	(concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))
-     (org-babel-pick-name
-      (nth 4 processed-params) (cdr (assoc :colnames params)))
-     (org-babel-pick-name
-      (nth 5 processed-params) (cdr (assoc :rownames params))))))
-
+	(concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
 
 (defun org-babel-C-expand (body params &optional processed-params)
   "Expand a block of C or C++ code with org-babel according to