babel: fixes for commit 08e2596

* lisp/ob-core.el (org-babel-graphical-output-file): Use `user-error'
instead of `error'.

* lisp/ob-maxima.el (org-babel-execute:maxima, org-babel-maxima-expand):
* lisp/ob-octave.el (org-babel-execute:octave): Guard
`org-babel-graphical-output-file' with `ignore-errors'.
This commit is contained in:
Aaron Ecay 2014-05-15 23:26:30 -04:00
parent 6cdf1b6d3f
commit 1be3c409c2
3 changed files with 8 additions and 7 deletions

View File

@ -2942,8 +2942,8 @@ plus the parameter value."
"File where a babel block should send graphical output, per PARAMS."
(unless (assq :file params)
(if (assq :file-ext params)
(error ":file-ext given but no :file generated; did you forget to give a block a #+NAME?")
(error "No :file header argument given; cannot create graphical result.")))
(user-error ":file-ext given but no :file generated; did you forget to give a block a #+NAME?")
(user-error "No :file header argument given; cannot create graphical result.")))
(and (member "graphics" (cdr (assq :result-params params)))
(cdr (assq :file params))))

View File

@ -52,7 +52,7 @@
(mapconcat 'identity
(list
;; graphic output
(let ((graphic-file (org-babel-graphical-output-file params)))
(let ((graphic-file (ignore-errors (org-babel-graphical-output-file params))))
(if graphic-file
(format
"set_plot_option ([gnuplot_term, png]); set_plot_option ([gnuplot_out_file, %S]);"
@ -89,7 +89,7 @@ This function is called by `org-babel-execute-src-block'."
(= 0 (length line)))
line))
(split-string raw "[\r\n]"))) "\n")))))
(if (org-babel-graphical-output-file params)
(if (ignore-errors (org-babel-graphical-output-file params))
nil
(org-babel-result-cond result-params
result

View File

@ -82,18 +82,19 @@ end")
(full-body
(org-babel-expand-body:generic
body params (org-babel-variable-assignments:octave params)))
(gfx-file (ignore-errors (org-babel-graphical-output-file params)))
(result (org-babel-octave-evaluate
session
(if (org-babel-graphical-output-file params)
(if gfx-file
(mapconcat 'identity
(list
"set (0, \"defaultfigurevisible\", \"off\");"
full-body
(format "print -dpng %s" (org-babel-graphical-output-file params)))
(format "print -dpng %s" gfx-file))
"\n")
full-body)
result-type matlabp)))
(if (org-babel-graphical-output-file params)
(if gfx-file
nil
(org-babel-reassemble-table
result