diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2014-05-15 23:26:30 -0400 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2014-05-15 23:26:30 -0400 |
commit | 1be3c409c24bca707f47d308870abe78cde28f91 (patch) | |
tree | 03d84d3485cf8cb72fb854a1663be987abe043ea | |
parent | 6cdf1b6d3f1d04ab22e71500275a0853577976cc (diff) | |
download | org-mode-1be3c409c24bca707f47d308870abe78cde28f91.tar.gz |
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'.
-rw-r--r-- | lisp/ob-core.el | 4 | ||||
-rw-r--r-- | lisp/ob-maxima.el | 4 | ||||
-rw-r--r-- | lisp/ob-octave.el | 7 |
3 files changed, 8 insertions, 7 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 16e8b95..1b08465 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -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)))) diff --git a/lisp/ob-maxima.el b/lisp/ob-maxima.el index e78e626..4e559d1 100644 --- a/lisp/ob-maxima.el +++ b/lisp/ob-maxima.el @@ -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 diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el index 1e6102c..14b55d2 100644 --- a/lisp/ob-octave.el +++ b/lisp/ob-octave.el @@ -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 |