[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Orgmode and matlab again.
From: |
Dan Davison |
Subject: |
Re: [Orgmode] Orgmode and matlab again. |
Date: |
Tue, 16 Mar 2010 11:01:43 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Piter_ <address@hidden> writes:
> Hi all.
> Can some one point me out part of code from babel-org and python-babel
> which is responsible for opening python code in python mode and
> putting it back in orgmode.
Hi Piter,
It's actually org-mode that does that, not org-babel.
So to get org-mode to open a block of matlab code in matlab mode, you
shouldn't need to do anything, apart from download matlab-mode
http://sourceforge.net/projects/matlab-emacs/
and (require 'matlab). At this stage, C-c ' on a #+begin_src matlab
block should open it for you in matlab mode.
We can also easily get the *tangling* functionality of org-babel with
(org-babel-add-interpreter "matlab")
(add-to-list 'org-babel-tangle-langs '("matlab" "m"))
That means that you can extract matlab blocks to files of pure matlab
code using org-babel-tangle.
Similarly, octave-mode comes bundled with emacs so begin_src octave
blocks should open in octave-mode already, and you can get babel
tangling functionality with
(org-babel-add-interpreter "octave")
(add-to-list 'org-babel-tangle-langs '("octave" "m"))
However, you will not yet be able to execute any matlab/octave code
blocks. That requires someone to do a bit of work, but it looks to me
that it might be possible to get both octave and matlab evaluation
working, both as external processes and as sessions. See
http://www.gnu.org/software/octave/doc/interpreter/Running-Octave-From-Within-Emacs.html#Running-Octave-From-Within-Emacs
http://sourceforge.net/projects/matlab-emacs/
http://www.mail-archive.com/address@hidden/msg22268.html
Dan
> I've tried to read files in lang directory of babel, but my knowledge
> of lisp did not let me to figure it out. I wanted to connect emacs
> matlab mode and hope it will help me to do it.
> Thanks.
> Petro.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode