Piter_ <x.pi...@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 _______________________________________________ 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