From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Orgmode and matlab again. Date: Tue, 16 Mar 2010 11:01:43 -0400 Message-ID: <87ljdspay0.fsf@stats.ox.ac.uk> References: <6f4f96031003160417p3cc3b7b7n7ad182967f6f97f6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrYHJ-0003VN-VE for emacs-orgmode@gnu.org; Tue, 16 Mar 2010 11:01:54 -0400 Received: from [140.186.70.92] (port=41440 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrYHH-0003SW-Bv for emacs-orgmode@gnu.org; Tue, 16 Mar 2010 11:01:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NrYHF-00059c-7X for emacs-orgmode@gnu.org; Tue, 16 Mar 2010 11:01:51 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:41247) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NrYHE-00059H-Lh for emacs-orgmode@gnu.org; Tue, 16 Mar 2010 11:01:49 -0400 In-Reply-To: <6f4f96031003160417p3cc3b7b7n7ad182967f6f97f6@mail.gmail.com> (Piter's message of "Tue, 16 Mar 2010 12:17:11 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Piter_ Cc: emacs-orgmode@gnu.org Piter_ 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