|
@@ -104,7 +104,8 @@ then create. Return the initialized session."
|
|
|
(let ((session (or session (if matlabp "*Inferior Matlab*" "*Inferior Octave*"))))
|
|
|
(if (org-babel-comint-buffer-livep session) session
|
|
|
(save-window-excursion
|
|
|
- (if matlabp (matlab-shell) (run-octave))
|
|
|
+ (if matlabp (unless org-babel-matlab-with-emacs-link (matlab-shell))
|
|
|
+ (run-octave))
|
|
|
(rename-buffer (if (bufferp session) (buffer-name session)
|
|
|
(if (stringp session) session (buffer-name)))) (current-buffer))))))
|
|
|
|
|
@@ -164,9 +165,18 @@ value of the last statement in BODY, as elisp."
|
|
|
(mapconcat
|
|
|
#'org-babel-chomp
|
|
|
(list (format org-babel-octave-wrapper-method body tmp-file tmp-file) org-babel-octave-eoe-indicator) "\n"))))
|
|
|
- (raw (org-babel-comint-with-output session
|
|
|
- (if matlabp org-babel-octave-eoe-indicator org-babel-octave-eoe-output) t
|
|
|
- (insert full-body) (comint-send-input nil t))) results)
|
|
|
+ (raw (if (and matlabp org-babel-matlab-with-emacs-link)
|
|
|
+ (save-window-excursion
|
|
|
+ (with-temp-buffer
|
|
|
+ (insert full-body)
|
|
|
+ (matlab-shell-run-region (point-min) (point-max))
|
|
|
+ "")) ;; matlab-shell-run-region doesn't seem to
|
|
|
+ ;; make *matlab* buffer contents easily
|
|
|
+ ;; available, so :results output currently
|
|
|
+ ;; won't work
|
|
|
+ (org-babel-comint-with-output session
|
|
|
+ (if matlabp org-babel-octave-eoe-indicator org-babel-octave-eoe-output) t
|
|
|
+ (insert full-body) (comint-send-input nil t)))) results)
|
|
|
(case result-type
|
|
|
(value
|
|
|
(org-babel-octave-import-elisp-from-file (org-babel-maybe-remote-file tmp-file)))
|