diff options
author | Rasmus <rasmus@gmx.us> | 2018-01-22 15:57:42 +0100 |
---|---|---|
committer | Rasmus <rasmus@gmx.us> | 2018-01-22 16:02:55 +0100 |
commit | bb396a369c93e57b033844003c7ceab61d61aa08 (patch) | |
tree | 31a9ef7d5792d64bf181b17cb8255386efd5d96d /lisp/org/ob-gnuplot.el | |
parent | fa582153f7a75e1eaaef4bfd2b381916233dc0a7 (diff) | |
download | emacs-bb396a369c93e57b033844003c7ceab61d61aa08.tar.gz emacs-bb396a369c93e57b033844003c7ceab61d61aa08.tar.bz2 emacs-bb396a369c93e57b033844003c7ceab61d61aa08.zip |
Update Org to v9.1.6
Please note this is a bugfix release. See etc/ORG-NEWS for details.
Diffstat (limited to 'lisp/org/ob-gnuplot.el')
-rw-r--r-- | lisp/org/ob-gnuplot.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/org/ob-gnuplot.el b/lisp/org/ob-gnuplot.el index 1acce502475..674627b8fa0 100644 --- a/lisp/org/ob-gnuplot.el +++ b/lisp/org/ob-gnuplot.el @@ -116,6 +116,8 @@ code." (timefmt (cdr (assq :timefmt params))) (time-ind (or (cdr (assq :timeind params)) (when timefmt 1))) + (directory (and (buffer-file-name) + (file-name-directory (buffer-file-name)))) (add-to-body (lambda (text) (setq body (concat text "\n" body))))) ;; append header argument settings to body (when title (funcall add-to-body (format "set title '%s'" title))) @@ -161,7 +163,10 @@ code." (format "\\$%s" (car pair)) (cdr pair) body))) vars) (when prologue (funcall add-to-body prologue)) - (when epilogue (setq body (concat body "\n" epilogue)))) + (when epilogue (setq body (concat body "\n" epilogue))) + ;; Setting the directory needs to be done first so that + ;; subsequent 'output' directive goes to the right place. + (when directory (funcall add-to-body (format "cd '%s'" directory)))) body)) (defun org-babel-execute:gnuplot (body params) |