From: Dan Davison <davison@stats.ox.ac.uk>
To: Piter_ <x.piter@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Orgmode and matlab again.
Date: Tue, 16 Mar 2010 11:01:43 -0400 [thread overview]
Message-ID: <87ljdspay0.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <6f4f96031003160417p3cc3b7b7n7ad182967f6f97f6@mail.gmail.com> (Piter's message of "Tue, 16 Mar 2010 12:17:11 +0100")
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
prev parent reply other threads:[~2010-03-16 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-16 11:17 Orgmode and matlab again Piter_
2010-03-16 15:01 ` Dan Davison [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ljdspay0.fsf@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=emacs-orgmode@gnu.org \
--cc=x.piter@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.