master
nixo 2019-10-29 16:45:36 +01:00
parent a71756d1e7
commit e86200172c
9 changed files with 9 additions and 245 deletions

View File

@ -436,52 +436,6 @@ Returns t, nil or the output format."
nil))
nil)))
;; (defun org-babel-execute:julia (body params)
;; "Execute a block of julia code.
;; This function is called by `org-babel-execute-src-block'.
;; BODY is the content of the src block
;; PARAMS are the parameter passed to the block"
;; ;; org-babel-current-src-block-location ; this variable does not work >.<
;; (save-excursion
;; (let* ((buffer (buffer-name))
;; (session (org-babel-julia-get-session-name params))
;; (async (org-babel-julia-async-p params))
;; (file (cdr (assoc :file params)))
;; (inlined (org-babel-julia-get-inline-type params))
;; (outfile (org-babel-process-file-name
;; (if file (concat default-directory file)
;; (org-babel-temp-file
;; "julia-" (if inlined (format ".%s" inlined) "")))))
;; (src (make-temp-file "ob-julia" nil ".jl" body))
;; (block (org-babel-julia-block-expand params src outfile)))
;; (when org-babel-julia-debug (message block))
;; (if session
;; (progn
;; ;; TODO: check if session exists, if it does, make it like
;; ;; *session:$N* (where N is the first number available)
;; (setq session (org-babel-julia-with-earmuffs session))
;; (when (not (org-babel-comint-buffer-livep session))
;; (org-babel-prep-session:julia session params))
;; (if (and async
;; (org-babel-julia-really-async-p))
;; (progn
;; (when org-babel-julia-debug (message "async export"))
;; (org-babel-julia-process-results
;; (org-babel-execute:julia-async buffer session body
;; block outfile params)
;; params))
;; (progn
;; (when org-babel-julia-debug (message "sync export"))
;; (org-babel-julia-process-results
;; (org-babel-execute:julia-sync session body block outfile
;; params)
;; params))))
;; (let ((res (org-babel-julia-evaluate-external-process
;; block outfile params buffer)))
;; (if (and async (org-babel-julia-really-async-p))
;; res
;; (org-babel-julia-process-results res params)))))))
(defun org-babel-execute:julia (body params)
"Execute a block of julia code.
This function is called by `org-babel-execute-src-block'.

View File

@ -91,17 +91,11 @@ sleep(1)
"It works!"
#+end_src
#+RESULTS:
: It works!
#+begin_src julia :async :session
sleep(1)
"It works!"
#+end_src
#+RESULTS:
: It works!
Asynchronous evaluation is automatically disabled on export, or when a
code block depends on one (=:var=)
@ -321,10 +315,6 @@ x
1 + "ciao"
#+end_src
#+RESULTS:
| ERROR | MethodError(+ | (1 | ciao) | 0x0000000000006420) |
|-------+---------------+----+-------+---------------------|
It works in async
#+begin_src julia :session julia-error-handling :async
x
@ -431,7 +421,8 @@ zeros(3,3)
zeros(3,3)
#+end_src
#+begin_src julia :session :file readme/output.csv :async
#+begin_src julia :session :file readme/output_dict.csv :async
sleep(1)
Dict(10 => 10)
#+end_src
@ -516,13 +507,19 @@ Plots default to inline png
plot(matrix)
#+end_src
But you can also force svg (Since it's multiline, :wrap it with =:wrap html=)
#+begin_src julia :session :inline svg :results raw :async
plot(matrix)
#+end_src
#+begin_src julia :file deleteme.csv :async
sleep(10)
rand(100,100)
#+end_src
#+RESULTS:
[[file:deleteme.csv]]
* Issues and Missing features

View File

@ -1,153 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="400" viewBox="0 0 2400 1600">
<defs>
<clipPath id="clip0100">
<rect x="0" y="0" width="2400" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip0100)" d="
M0 1600 L2400 1600 L2400 0 L0 0 Z
" fill="#ffffff" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip0101">
<rect x="480" y="0" width="1681" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip0100)" d="
M84.3733 1470.71 L2352.76 1470.71 L2352.76 47.2441 L84.3733 47.2441 Z
" fill="#ffffff" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip0102">
<rect x="84" y="47" width="2269" height="1424"/>
</clipPath>
</defs>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
148.573,1470.71 148.573,47.2441
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
683.569,1470.71 683.569,47.2441
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1218.56,1470.71 1218.56,47.2441
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1753.56,1470.71 1753.56,47.2441
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
2288.56,1470.71 2288.56,47.2441
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
84.3733,1430.42 2352.76,1430.42
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
84.3733,982.791 2352.76,982.791
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
84.3733,535.161 2352.76,535.161
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
84.3733,87.5308 2352.76,87.5308
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,1470.71 2352.76,1470.71
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,1470.71 84.3733,47.2441
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
148.573,1470.71 148.573,1449.36
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
683.569,1470.71 683.569,1449.36
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1218.56,1470.71 1218.56,1449.36
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1753.56,1470.71 1753.56,1449.36
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
2288.56,1470.71 2288.56,1449.36
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,1430.42 118.399,1430.42
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,982.791 118.399,982.791
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,535.161 118.399,535.161
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
84.3733,87.5308 118.399,87.5308
"/>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;" transform="rotate(0, 148.573, 1524.71)" x="148.573" y="1524.71">1.00</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;" transform="rotate(0, 683.569, 1524.71)" x="683.569" y="1524.71">1.25</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;" transform="rotate(0, 1218.56, 1524.71)" x="1218.56" y="1524.71">1.50</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;" transform="rotate(0, 1753.56, 1524.71)" x="1753.56" y="1524.71">1.75</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;" transform="rotate(0, 2288.56, 1524.71)" x="2288.56" y="1524.71">2.00</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;" transform="rotate(0, 60.3733, 1447.92)" x="60.3733" y="1447.92">1</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;" transform="rotate(0, 60.3733, 1000.29)" x="60.3733" y="1000.29">2</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;" transform="rotate(0, 60.3733, 552.661)" x="60.3733" y="552.661">3</text>
</g>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;" transform="rotate(0, 60.3733, 105.031)" x="60.3733" y="105.031">4</text>
</g>
<polyline clip-path="url(#clip0102)" style="stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none" points="
148.573,1430.42 2288.56,1430.42
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none" points="
148.573,982.791 2288.56,982.791
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#3da44d; stroke-width:4; stroke-opacity:1; fill:none" points="
148.573,535.161 2288.56,535.161
"/>
<polyline clip-path="url(#clip0102)" style="stroke:#c271d2; stroke-width:4; stroke-opacity:1; fill:none" points="
148.573,87.5308 2288.56,87.5308
"/>
<path clip-path="url(#clip0100)" d="
M1989.93 433.164 L2280.76 433.164 L2280.76 130.764 L1989.93 130.764 Z
" fill="#ffffff" fill-rule="evenodd" fill-opacity="1"/>
<polyline clip-path="url(#clip0100)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1989.93,433.164 2280.76,433.164 2280.76,130.764 1989.93,130.764 1989.93,433.164
"/>
<polyline clip-path="url(#clip0100)" style="stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none" points="
2013.93,191.244 2157.93,191.244
"/>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;" transform="rotate(0, 2181.93, 208.744)" x="2181.93" y="208.744">y1</text>
</g>
<polyline clip-path="url(#clip0100)" style="stroke:#e26f46; stroke-width:4; stroke-opacity:1; fill:none" points="
2013.93,251.724 2157.93,251.724
"/>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;" transform="rotate(0, 2181.93, 269.224)" x="2181.93" y="269.224">y2</text>
</g>
<polyline clip-path="url(#clip0100)" style="stroke:#3da44d; stroke-width:4; stroke-opacity:1; fill:none" points="
2013.93,312.204 2157.93,312.204
"/>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;" transform="rotate(0, 2181.93, 329.704)" x="2181.93" y="329.704">y3</text>
</g>
<polyline clip-path="url(#clip0100)" style="stroke:#c271d2; stroke-width:4; stroke-opacity:1; fill:none" points="
2013.93,372.684 2157.93,372.684
"/>
<g clip-path="url(#clip0100)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;" transform="rotate(0, 2181.93, 390.184)" x="2181.93" y="390.184">y4</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,5 +0,0 @@
a,b
1,1
2,2
,
4,4
1 a b
2 1 1
3 2 2
4
5 4 4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="400" viewBox="0 0 2400 1600">
<defs>
<clipPath id="clip0400">
<rect x="0" y="0" width="2400" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip0400)" d="
M0 1600 L2400 1600 L2400 0 L0 0 Z
" fill="#ffff00" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip0401">
<rect x="480" y="0" width="1681" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip0400)" d="
M153.898 1487.47 L2352.76 1487.47 L2352.76 47.2441 L153.898 47.2441 Z
" fill="#ffff00" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip0402">
<rect x="153" y="47" width="2200" height="1441"/>
</clipPath>
</defs>
<g clip-path="url(#clip0400)">
<text style="fill:#ffffff; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:84px; text-anchor:middle;" transform="rotate(0, 1253.33, 797.859)" x="1253.33" y="797.859">ERROR: UndefVarError(:this_is_undefined)</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +0,0 @@
Dict(10=>10)
1 Dict(10=>10)

View File

@ -1 +0,0 @@
<table style="width:100%"><tr><th>0.0</th><th>0.0</th><th>0.0</tr><tr><th>0.0</th><th>0.0</th><th>0.0</tr><tr><th>0.0</th><th>0.0</th><th>0.0</table>