Function: org-babel-maxima-expand

org-babel-maxima-expand is a byte-compiled function defined in ob-maxima.el.gz.

Signature

(org-babel-maxima-expand BODY PARAMS)

Documentation

Expand Maxima BODY according to its header arguments from PARAMS.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-maxima.el.gz
(defun org-babel-maxima-expand (body params)
  "Expand Maxima BODY according to its header arguments from PARAMS."
  (let* ((vars (org-babel--get-vars params))
         (graphic-file (ignore-errors (org-babel-graphical-output-file params)))
	 (epilogue (cdr (assq :epilogue params)))
	 (prologue (cdr (assq :prologue params))))
    (mapconcat 'identity
               (delq nil
                     (list
		      ;; Any code from the specified prologue at the start.
		      prologue
		      ;; graphic output
		      (if graphic-file
                          (let* ((graphics-pkg (intern (or (cdr (assq :graphics-pkg params)) "plot")))
                                 (graphic-format-string (cdr (assq graphics-pkg org-babel-maxima--graphic-package-options)))
                                 (graphic-terminal (file-name-extension graphic-file))
                                 (graphic-file (if (eq graphics-pkg 'plot) graphic-file (file-name-sans-extension graphic-file))))
                            (format graphic-format-string graphic-terminal graphic-file)))
		      ;; variables
		      (mapconcat 'org-babel-maxima-var-to-maxima vars "\n")
		      ;; body
		      body
		      ;; Any code from the specified epilogue at the end.
		      epilogue
		      (if graphic-file
                          (cdr (assq :graphical-output org-babel-maxima--default-epilogue))
                        (cdr (assq :non-graphical-output org-babel-maxima--default-epilogue)))))
	       "\n")))