0

After I start imaxima and get a prompt, I try typing 1 + 1 or any other expression and evaluate. Then I get the error:

  enter code hereDebugger entered--Lisp error: (error "Not enough arguments for format string")
  format("\\color[rgb]{%f,%f,%f}")
  apply(format "\\color[rgb]{%f,%f,%f}" nil)
  (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n"))
  (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n")) (concat (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) "\\begin{math} \\displaystyle " str (format " \\end{math}\n")))
  (insert (format "\\documentclass[%dpt,leqno]{article}\n" imaxima-pt-size) "\n% mylatex\n" (format "\\setlength{\\textwidth}{%dmm}\n" (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat "\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}" "\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}" "\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}" "\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}" "\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}" "\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n") "") "\\begin{document}\n" (apply (quote format) "\\pagecolor[rgb]{%f,%f,%f}" (imaxima-color-to-rgb (imaxima-get-bg-color))) "\\pagestyle{empty}\n" (format "\\begin{%s}\n" imaxima-fnt-size) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-label-color)) "\\tt" (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n")) (concat (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) "\\begin{math} \\displaystyle " str (format " \\end{math}\n"))) (format "\\end{%s}\n" imaxima-fnt-size) "\\end{document}")
  (save-current-buffer (set-buffer temp-buffer) (insert (format "\\documentclass[%dpt,leqno]{article}\n" imaxima-pt-size) "\n% mylatex\n" (format "\\setlength{\\textwidth}{%dmm}\n" (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat "\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}" "\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}" "\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}" "\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}" "\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}" "\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n") "") "\\begin{document}\n" (apply (quote format) "\\pagecolor[rgb]{%f,%f,%f}" (imaxima-color-to-rgb (imaxima-get-bg-color))) "\\pagestyle{empty}\n" (format "\\begin{%s}\n" imaxima-fnt-size) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-label-color)) "\\tt" (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n")) (concat (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) "\\begin{math} \\displaystyle " str (format " \\end{math}\n"))) (format "\\end{%s}\n" imaxima-fnt-size) "\\end{document}"))
  (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format "\\documentclass[%dpt,leqno]{article}\n" imaxima-pt-size) "\n% mylatex\n" (format "\\setlength{\\textwidth}{%dmm}\n" (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat "\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}" "\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}" "\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}" "\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}" "\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}" "\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n") "") "\\begin{document}\n" (apply (quote format) "\\pagecolor[rgb]{%f,%f,%f}" (imaxima-color-to-rgb (imaxima-get-bg-color))) "\\pagestyle{empty}\n" (format "\\begin{%s}\n" imaxima-fnt-size) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-label-color)) "\\tt" (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n")) (concat (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) "\\begin{math} \\displaystyle " str (format " \\end{math}\n"))) (format "\\end{%s}\n" imaxima-fnt-size) "\\end{document}")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0)))
  (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format "\\documentclass[%dpt,leqno]{article}\n" imaxima-pt-size) "\n% mylatex\n" (format "\\setlength{\\textwidth}{%dmm}\n" (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat "\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}" "\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}" "\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}" "\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}" "\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}" "\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n") "") "\\begin{document}\n" (apply (quote format) "\\pagecolor[rgb]{%f,%f,%f}" (imaxima-color-to-rgb (imaxima-get-bg-color))) "\\pagestyle{empty}\n" (format "\\begin{%s}\n" imaxima-fnt-size) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-label-color)) "\\tt" (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) str (format "\\end{dmath}\n")) (concat (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-equation-color)) "\\begin{math} \\displaystyle " str (format " \\end{math}\n"))) (format "\\end{%s}\n" imaxima-fnt-size) "\\end{document}")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (let ((temp-file filename) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp file*")))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format "\\documentclass[%dpt,leqno]{article}\n" imaxima-pt-size) "\n% mylatex\n" (format "\\setlength{\\textwidth}{%dmm}\n" (round (/ ... imaxima-scale-factor))) (if linear (concat "\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}" "\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}" "\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}" "\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}" "\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}" "\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n") "") "\\begin{document}\n" (apply (quote format) "\\pagecolor[rgb]{%f,%f,%f}" (imaxima-color-to-rgb (imaxima-get-bg-color))) "\\pagestyle{empty}\n" (format "\\begin{%s}\n" imaxima-fnt-size) (apply (quote format) "\\color[rgb]{%f,%f,%f}" (imaxima-color-to-rgb imaxima-label-color)) "\\tt" (if label (concat (format "\\begin{dmath}[number={%s}]\n" label) (apply ... "\\color[rgb]{%f,%f,%f}" ...) str (format "\\end{dmath}\n")) (concat (apply ... "\\color[rgb]{%f,%f,%f}" ...) "\\begin{math} \\displaystyle " str (format " \\end{math}\n"))) (format "\\end{%s}\n" imaxima-fnt-size) "\\end{document}")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  imaxima-tex-to-dvi("2" "\\%o1" "/tmp/imaxima14593VaH/1.tex")
  (cond ((eql eps-or-latex (quote latex)) (if (string-match "\\(\\([^]*\\)\\)" str) (progn (setq label (match-string 2 str)) (setq str (replace-match "" t t str 1)))) (if no-label-p (setq label nil)) (imaxima-tex-to-dvi str label (concat filename ".tex")) (imaxima-dvi-to-ps filename)) ((eql eps-or-latex (quote eps)) (copy-file str psfilename) (setq label nil)))
  (let* ((filename (expand-file-name (number-to-string (setq imaxima-file-counter (1+ imaxima-file-counter))) imaxima-tmp-subdir)) (psfilename (concat filename ".ps")) (label "*")) (cond ((eql eps-or-latex (quote latex)) (if (string-match "\\(\\([^]*\\)\\)" str) (progn (setq label (match-string 2 str)) (setq str (replace-match "" t t str 1)))) (if no-label-p (setq label nil)) (imaxima-tex-to-dvi str label (concat filename ".tex")) (imaxima-dvi-to-ps filename)) ((eql eps-or-latex (quote eps)) (copy-file str psfilename) (setq label nil))) (if (not (file-exists-p psfilename)) (imaxima-latex-error str filename) (let* ((--cl-var-- (imaxima-extract-bb psfilename)) (bb (nth 0 --cl-var--)) (width (nth 1 --cl-var--)) (height (nth 2 --cl-var--))) (let ((ratio (/ (imaxima-get-window-width) (imaxima-bp-to-mm width)))) (if (< ratio 1.0) (progn (if (or ... ...) (let ... ...) (if imaxima-linearize-flag ...))))) (if (eq imaxima-image-type (quote postscript)) nil (imaxima-ps-to-image psfilename filename bb width height)) (cond (nil (if (eq system-type (quote windows-nt)) (progn (kill-process imaxima-gs-process) (imaxima-start-gs))) (xemacs-set-imagefile-properties filename imaxima-image-type str)) (t (propertize (concat "(" label ") " str) (quote display) (if (eq imaxima-image-type ...) (create-image psfilename ... nil :pt-width width :pt-height height :bounding-box bb :ascent ... :mask ...) (create-image filename imaxima-image-type nil :ascent ... :mask ...))))))))
  imaxima-make-image("\\%o12" latex)
  (setq image (imaxima-make-image match (quote latex)))
  (concat output (setq image (imaxima-make-image match (quote latex))))
  (setq output (concat output (setq image (imaxima-make-image match (quote latex)))))
  (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match (quote latex))))) (if (null main-output) (setq main-output image)))
  (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match (quote latex))))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))
  (cond ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((iprompt (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond ((and continuation main-output) (funcall (car continuation) main-output)) ((and continuation (null main-output)) (funcall (car continuation) "")))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match ...)))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output (imaxima-make-image match (quote latex))))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output match))) (message "Unexpected error encountered in imaxima-filter"))))
  (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((iprompt (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond ((and continuation main-output) (funcall ... main-output)) ((and continuation ...) (funcall ... "")))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image ...))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output (imaxima-make-image match ...)))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output match))) (message "Unexpected error encountered in imaxima-filter")))))
  (while (not (string= imaxima-output "")) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((iprompt ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond (... ...) (... ...))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match ...) (rest ...) image) (setq imaxima-output rest) (setq output (concat output ...)) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output ...))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ((match ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output match))) (message "Unexpected error encountered in imaxima-filter"))))))
  (let ((lastchar (aref str (1- len))) (output "")) (if (and (char-equal lastchar 10) (> len 1)) (progn (setq lastchar (aref str (- len 2))))) (message "Processing Maxima output...") (while (not (string= imaxima-output "")) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...) (cond ... ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let (... ... image) (setq imaxima-output rest) (setq output ...) (if ... ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...)) (message "Unexpected error encountered in imaxima-filter")))))) (message "Processing Maxima output...done") (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))
  (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) "")) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output "")) (if (and (char-equal lastchar 10) (> len 1)) (progn (setq lastchar (aref str (- len 2))))) (message "Processing Maxima output...") (while (not (string= imaxima-output "")) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ... ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ... ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) ((string= 1stchar "") (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) (t (if (string-match "\\([^]*\\)\\(\\(.\\|\n\\)*\\)" imaxima-output) (let ... ... ...) (message "Unexpected error encountered in imaxima-filter")))))) (message "Processing Maxima output...done") (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output)))
  (let* ((len (length str)) main-output) (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) "")) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output "")) (if (and (char-equal lastchar 10) (> len 1)) (progn (setq lastchar (aref str (- len 2))))) (message "Processing Maxima output...") (while (not (string= imaxima-output "")) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar "") (if ... ... ... ...)) ((string= 1stchar "") (if ... ... ... ...)) ((string= 1stchar "") (if ... ... ... ...)) (t (if ... ... ...))))) (message "Processing Maxima output...done") (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))))
  (catch (quote --cl-block-imaxima-filter--) (if imaxima-filter-running (progn (setq imaxima-output (concat imaxima-output str)) (debug-imaxima-filter "reenter") (throw (quote --cl-block-imaxima-filter--) ""))) (setq imaxima-filter-running t) (debug-imaxima-filter str) (let* ((len (length str)) main-output) (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) "")) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output "")) (if (and (char-equal lastchar 10) (> len 1)) (progn (setq lastchar (aref str ...)))) (message "Processing Maxima output...") (while (not (string= imaxima-output "")) (let ((1stchar ...)) (cond (... ...) (... ...) (... ...) (t ...)))) (message "Processing Maxima output...done") (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output)))))
  imaxima-filter("\n\\%o12\n(%i2) ")
  comint-output-filter(#<process imaxima> "\n\\%o12\n(%i2) ")

When I kill the buffer I see:

Process imaxima hangup

It was working in the past, but I do remember encountering this error before. How might I resolve it?

2
  • 1
    According to the stacktrace, (imaxima-color-to-rgb imaxima-equation-color) is returning nil instead of a list of 3 floats. Maybe because imaxima-equation-color is nil?
    – npostavs
    Sep 19, 2015 at 14:06
  • apparently imaxima-equation-color was set as #333333 but then got redefined somehow to undefined-fg.
    – wdkrnls
    Sep 19, 2015 at 16:49

1 Answer 1

2

format is being called with only one argument, the format string. But the format-string argument has three % constructs, meaning that format expects three additional arguments, whose values are to be used by those % constructs.

The offending code, which calls format incorrectly, is apparently in function imaxima-tex-to-dvi or in some function that it calls. Check the source code.

You can also use M-x debug-on-entry imaxima-tex-to-dvi and then step through the debugger using d, to see exactly where the problem is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.