Ver Fonte

ob-calc: unquote quoted vectors returned from calc-eval

* lisp/ob-calc.el (org-babel-execute:calc): Unquote quoted vectors
  returned from calc-eval.
Eric Schulte há 14 anos atrás
pai
commit
907bf0a4cb
1 ficheiros alterados com 10 adições e 8 exclusões
  1. 10 8
      lisp/ob-calc.el

+ 10 - 8
lisp/ob-calc.el

@@ -69,14 +69,16 @@
 		      ((math-read-number res) (math-read-number res))
 		      ((listp res) (error "calc error \"%s\" on input \"%s\""
 					  (cadr res) line))
-		      (t (calc-eval
-			  (math-evaluate-expr
-			   ;; resolve user variables, calc built in
-			   ;; variables are handled automatically
-			   ;; upstream by calc
-			   (mapcar #'ob-calc-maybe-resolve-var
-				   ;; parse line into calc objects
-				   (car (math-read-exprs line))))))))
+		      (t (replace-regexp-in-string
+			  "'\\[" "["
+			  (calc-eval
+			   (math-evaluate-expr
+			    ;; resolve user variables, calc built in
+			    ;; variables are handled automatically
+			    ;; upstream by calc
+			    (mapcar #'ob-calc-maybe-resolve-var
+				    ;; parse line into calc objects
+				    (car (math-read-exprs line)))))))))
 		   (calc-eval line))))))))
      (mapcar #'org-babel-trim
 	     (split-string (org-babel-expand-body:calc body params) "[\n\r]"))))