emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Orgmode and matlab again.
@ 2010-03-16 11:17 Piter_
  2010-03-16 15:01 ` Dan Davison
  0 siblings, 1 reply; 2+ messages in thread
From: Piter_ @ 2010-03-16 11:17 UTC (permalink / raw)
  To: emacs-orgmode

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.
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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Orgmode and matlab again.
  2010-03-16 11:17 Orgmode and matlab again Piter_
@ 2010-03-16 15:01 ` Dan Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Davison @ 2010-03-16 15:01 UTC (permalink / raw)
  To: Piter_; +Cc: emacs-orgmode

Piter_ <x.piter@gmail.com> 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/emacs-orgmode@gnu.org/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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-16 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16 11:17 Orgmode and matlab again Piter_
2010-03-16 15:01 ` Dan Davison

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).