emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: ob-asymptote.el


From: Philip Kaludercic
Subject: Re: [ELPA] New package: ob-asymptote.el
Date: Wed, 06 Sep 2023 22:08:56 +0000

Stefan Kangas <stefankangas@gmail.com> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>>> Is there anything blocking this package from going in?
>>>
>>> I don't think so, I am just confused why I appear to not find any
>>> previous discussion on this in the archives.
>>
>> It was discussed previously here:
>> https://lists.gnu.org/r/emacs-devel/2023-07/msg00339.html
>
> Do you think we could add it now?

The requirements section mentioned that "asy-mode" is necessary, but
there is no package for that.  I guess that is a blocker, unless the
information is outdated.

Otherwise, I think a change like this would be nice to have:

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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]