diff --git a/ob-asymptote.el b/ob-asymptote.el index de99ca3..a088fab 100644 --- a/ob-asymptote.el +++ b/ob-asymptote.el @@ -61,20 +61,19 @@ This function is called by `org-babel-execute-src-block'." "pdf")) (cmdline (cdr (assq :cmdline params))) (in-file (org-babel-temp-file "asymptote-")) - (cmd - (concat "asy " - (if out-file - (concat - "-globalwrite -f " format - " -o " (org-babel-process-file-name out-file)) - "-V") - " " cmdline - " " (org-babel-process-file-name in-file)))) + (cmd `("asy" + ,@(if out-file + `("-globalwrite" "-f" format + "-o" (org-babel-process-file-name out-file)) + "-V") + cmdline + (org-babel-process-file-name in-file)))) (with-temp-file in-file (insert (org-babel-expand-body:generic - body params - (org-babel-variable-assignments:asymptote params)))) - (message cmd) (shell-command cmd) + body params + (org-babel-variable-assignments:asymptote params)))) + (message (mapconcat #'shell-quote-argument cmd " ")) + (apply #'call-process "asy" nil nil cmd) ;should "asy" be a user option? nil)) ;; signal that output has already been written to file (defun org-babel-prep-session:asymptote (_session _params)