Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ess-julia-mode, julia-mode and org-mode configuration #19

Open
fkgruber opened this issue Oct 12, 2020 · 3 comments
Open

ess-julia-mode, julia-mode and org-mode configuration #19

fkgruber opened this issue Oct 12, 2020 · 3 comments

Comments

@fkgruber
Copy link

Hi
I'm running into a strange issue when using julia with orgmode. I loaded ob-julia
(load-file "~/elisp/ob-julia.el")
and included julia in the load-language

(org-babel-do-load-languages
 'org-babel-load-languages
 '((julia . t)))

I'm able to create a source block and execute it with C-c C-c

#+begin_src julia
x="foo2"
y=[1,2,3,4,5]
y
#+end_src

However, when I try to edit the code (C-c ') julia-mode is activated and none of the ESS specific commands work.

On the other hand if I use ess-julia instead of julia on the source block:

#+begin_src ess-julia
x="foo2"
y=[1,2,3,4,5]
y
#+end_src

and I type C-c ' then ess-julia-mode gets activated and the ess keybindinds work fine.

The problem is that with ess-julia-mode I'm unable to use C-c C-c to execute the block. I get:
org-babel-execute-src-block: No org-babel-execute function for ess-julia!

How can I set org-edit-src-code to set julia blocks to ess-julia-mode instead of julia-mode? Or alternatively use ess-julia as an alias to julia so that I can execute julia blocks in orgmode.

Could this be related to issue:
emacs-ess/ESS#645
?

What am I missing?
thanks
FKG

@frederic-santos
Copy link

frederic-santos commented Oct 12, 2020

Hi,

This package is not maintained anymore, so it is not useful to post here.
Several forks are available: https://git.nixo.xyz/nixo/ob-julia or https://github.com/frederic-santos/ob-ess-julia

Actually, your problem is the expected behavior. I suppose that you use polymode. Polymode has an automatic matcher: if the src block begins with begin src python, then its inner content is matched to python-mode; if the src block begins with begin src julia, then it is matched to julia-mode by default, etc. And indeed, you have no access to ESS features with julia-mode (especially, no auto-completion).

Your idea was good: if your src block begins with begin src ess-julia, then it is matched to ess-julia-mode, which is want you want. But also, still by default, org-babel searches for an executable which has the same name, ess-julia, and obviously does not find one. Thus, everything works as expected. 😉

For the fork I'm maintaining, I'm currently struggling with this same question. There are several difficult choices to make, and I'm still not sure which one is the best. Currently, I use only julia-mode as the innermode of code chunks, but it might change for ess-julia-mode soon (thus offering what you want).

Cheers,
F.

@fkgruber
Copy link
Author

Hi F.
I will try your fork. I'm glad to know that there are other people taking over this...

I was not using polymode. I simply want to be able to use org-edit-src-code (C-c ' ) to get into ess-julia-mode so I can edit stuff. But for some reason it is using julia-mode instead. weird.

I do most of my work on R and would love to have the exact same workflow with Julia.

Hi,

This package is not maintained anymore, so it is not useful to post here.
Several forks are available: https://git.nixo.xyz/nixo/ob-julia or https://github.com/frederic-santos/ob-julia

Actually, your problem is the expected behavior. I suppose that you use polymode. Polymode has an automatic matcher: if the src block begins with begin src python, then its inner content is matched to python-mode; if the src block begins with begin src julia, then it is matched to julia-mode by default, etc. And indeed, you have no access to ESS features with julia-mode (especially, no auto-completion).

Your idea was good: if your src block begins with begin src ess-julia, then it is matched to ess-julia-mode, which is want you want. But also, still by default, org-babel searches for an executable which has the same name, ess-julia, and obviously does not find one. Thus, everything works as expected. 😉

For the fork I'm maintaining, I'm currently struggling with this same question. There are several difficult choices to make, and I'm still not sure which one is the best. Currently, I use only julia-mode as the innermode of code chunks, but it might change for ess-julia-mode soon (thus offering what you want).

Cheers,
F.

@frederic-santos
Copy link

I do most of my work on R and would love to have the exact same workflow with Julia.

Actually I'm in the same situation and that's why I'm trying to develop a fork of ob-julia 😉
My fork might change heavily within the next few days (even its name should change...). Partly due to the issue you raised here, the package will probably be renamed ob-ess-julia. It might be better to wait a few more days before trying it.
But thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants