Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

attempt at ob-sage.el for org-mode (emacs)

I am a big fan of Sage and of emacs' org-mode. I use org-mode to outline lectures for my students and often need to include evaluatable code inside my org-mode's BEGIN_SRC/END_SRC environment blocks. No problem, I already do this with some languages, such as python and sh, but I'd really like to do it with Sage. Unfortunately, there is no support yet for Sage, i.e. there's no ob-sage.el file.

So I tried making my own ob-sage.el file with some success. I did this by copying the ob-python.el file that came with my emacs installation, renaming it ob-sage.el, and then just doing a query-replace inside, converting every instance of "python" or "py" or "python-mode" into an instance of "sage" or "sage-mode". This works to an extent, but I am not able to get persistent sessions to work. Has anybody attempted this yet? Would anyone like to share their progress?

I would like to upload the ob-sage.el file I have, but I think it is generally regarded as bad netiquette to upload 300 lines of code to a post on a forum like this. What would be the appropriate/best way to share my ob-sage.el file here on asksage?

click to hide/show revision 2
retagged

attempt at ob-sage.el for org-mode (emacs)

I am a big fan of Sage and of emacs' org-mode. I use org-mode to outline lectures for my students and often need to include evaluatable code inside my org-mode's BEGIN_SRC/END_SRC environment blocks. No problem, I already do this with some languages, such as python and sh, but I'd really like to do it with Sage. Unfortunately, there is no support yet for Sage, i.e. there's no ob-sage.el file.

So I tried making my own ob-sage.el file with some success. I did this by copying the ob-python.el file that came with my emacs installation, renaming it ob-sage.el, and then just doing a query-replace inside, converting every instance of "python" or "py" or "python-mode" into an instance of "sage" or "sage-mode". This works to an extent, but I am not able to get persistent sessions to work. Has anybody attempted this yet? Would anyone like to share their progress?

I would like to upload the ob-sage.el file I have, but I think it is generally regarded as bad netiquette to upload 300 lines of code to a post on a forum like this. What would be the appropriate/best way to share my ob-sage.el file here on asksage?