From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: [babel] maxima support? Date: Tue, 15 Mar 2011 10:47:00 +0000 Message-ID: <871v28slsr.fsf@ucl.ac.uk> References: <5rbp23p04b.fsf@kana.aer.mw.tum.de> <87bp21ohkt.fsf@pinto.chemeng.ucl.ac.uk> <8762s7ipr7.fsf@gmail.com> <87y6503zkk.fsf@ucl.ac.uk> <874o75wfzf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=38165 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzRmV-0006N5-UY for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 06:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzRmU-0005Hf-DX for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 06:47:15 -0400 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:44862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzRmU-0005Gw-9d for emacs-orgmode@gnu.org; Tue, 15 Mar 2011 06:47:14 -0400 In-Reply-To: <874o75wfzf.fsf@gmail.com> (Eric Schulte's message of "Mon, 14 Mar 2011 15:26:30 -0600") 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: Eric Schulte Cc: Litvinov Sergey , emacs-orgmode@gnu.org "Eric Schulte" writes: > Hi Eric, > > I've gone through your ob-maxima.el, and tried to re-work it to the > point where it can be included into Org-mode -- mainly just switching to > a couple of Babel "best practices", and replacing some shell script > munging with elisp munging. > > Please try out the attached version (packaged as a patch against the > current Org-mode head) and let me know if it works --- i.e., If I > haven't broken it too badly. If it works I think we can fold it into > Org-mode immediately. > > Cheers -- Eric I've tried this but cannot get it to execute my maxima code: --8<---------------cut here---------------start------------->8--- #+begin_src maxima programmode: false; eq: x**2-1 = 0; solution: solve(eq, x); print(solution); #+end_src --8<---------------cut here---------------end--------------->8--- I get the following error: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (void-variable in-file) (format "maxima --very-quiet -r 'batchload(%S)$' %s" in-file cmdline) (let ((result-params (split-string (or (cdr (assoc :results params)) ""))) (cmdline (cdr (assoc :cmdline params))) (in-file (org-babel-temp-file "maxima-")) (cmd (format "maxima --very-quiet -r 'batchload(%S)$' %s" in-file cmdline))) (with-temp-file in-file (insert body)) (message cmd) ((lambda (raw) (delq nil (mapcar (lambda (line) (unless (or ... ... ...) line)) (split-string raw)))) (org-babel-eval cmd ""))) org-babel-execute:maxima("programmode: false;\neq: x**2-1 = 0;\nsolution: solve(eq, x);\nprint(solution);\n" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:hlines . "no") (:session . "none"))) org-babel-execute-src-block(nil ("maxima" "programmode: false;\neq: x**2-1 = 0;\nsolution: solve(eq, x);\nprint(solution);\n" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:hlines . "no") (:session . "none")) "" nil 4)) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil) --8<---------------cut here---------------end--------------->8--- This was with a freshly invoked emacs (with my own ob-maxima.el moved out of the way). Any suggestions? thanks, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.38.gf8c6.dirty)