org-babel-jupyter-transform-code (julia): Don't wrap :dir expression in function

Allows top level expressions like `using Plots` to work. Fixes #57.
This commit is contained in:
Nathaniel Nicandro 2019-03-12 14:24:02 -05:00
parent 98e4bd29d2
commit 247a96fb95
No known key found for this signature in database
GPG key ID: C34814B309DD06B8

View file

@ -183,8 +183,16 @@ Make the character after `point' invisible."
(cl-defmethod org-babel-jupyter-transform-code (code changelist &context (jupyter-lang julia))
(when (plist-get changelist :dir)
(setq code (format "cd(\"%s\") do\n %s end"
(plist-get changelist :dir) code)))
(setq code
(format "\
__JUPY_saved_dir = pwd()
cd(\"%s\")
try
%s
finally
cd(__JUPY_saved_dir)
end"
(plist-get changelist :dir) code)))
code)
(provide 'jupyter-julia)