From ab76b8f29eac87c36ef881f4ecaa78e8a3740f16 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Mon, 26 Mar 2012 07:45:40 -0400 Subject: [PATCH] The maxima command used should be configurable--defaults to maxima-command if defined * lisp/ob-maxima.el (org-babel-maxima-command): The maxima command used should be configurable (defaults to maxima-command if defined). (org-babel-execute:maxima): The maxima command used should be configurable (defaults to maxima-command if defined). --- lisp/ob-maxima.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el index 74bcb0694..63f1e3247 100644 --- a/lisp/ob-maxima.el +++ b/lisp/ob-maxima.el @@ -40,6 +40,10 @@ (defvar org-babel-default-header-args:maxima '()) +(defcustom org-babel-maxima-command + (if (boundp 'maxima-command) maxima-command "maxima") + "Command used to call maxima on the shell.") + (defun org-babel-maxima-expand (body params) "Expand a block of Maxima code according to its header arguments." (let ((vars (mapcar #'cdr (org-babel-get-header params :var)))) @@ -67,8 +71,8 @@ called by `org-babel-execute-src-block'." (result (let* ((cmdline (cdr (assoc :cmdline params))) (in-file (org-babel-temp-file "maxima-" ".max")) - (cmd (format "maxima --very-quiet -r 'batchload(%S)$' %s" - in-file cmdline))) + (cmd (format "%s --very-quiet -r 'batchload(%S)$' %s" + org-babel-maxima-command in-file cmdline))) (with-temp-file in-file (insert (org-babel-maxima-expand body params))) (message cmd) ((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "