1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-25 10:47:12 +00:00

babel: wrapped org-babel-make-remote-file-name' in conditional as org-babel-maybe-remote-file'

This commit is contained in:
Eric Schulte 2010-02-23 09:10:11 -07:00 committed by Dan Davison
parent 24cdeea122
commit a705bf5925
4 changed files with 11 additions and 12 deletions

View File

@ -155,8 +155,7 @@ last statement in BODY, as elisp."
body tmp-file (if column-names-p "TRUE" "FALSE")))
(shell-command-on-region (point-min) (point-max) "R --no-save" 'replace))
(org-babel-R-process-value-result
(org-babel-import-elisp-from-file
(if (file-remote-p default-directory) (org-babel-make-remote-file-name tmp-file) tmp-file))
(org-babel-import-elisp-from-file (org-babel-maybe-remote-file tmp-file))
column-names-p))))
;; comint session evaluation
(org-babel-comint-in-buffer session
@ -181,7 +180,7 @@ last statement in BODY, as elisp."
(case result-type
(value (org-babel-R-process-value-result
(org-babel-import-elisp-from-file
(if (file-remote-p default-directory) (org-babel-make-remote-file-name tmp-file) tmp-file))
(org-babel-maybe-remote-file tmp-file))
column-names-p))
(output
(flet ((extractor

View File

@ -179,8 +179,7 @@ last statement in BODY, as elisp."
;; (message "buffer=%s" (buffer-string)) ;; debugging
(shell-command-on-region (point-min) (point-max) "python"))
(let ((raw (with-temp-buffer
(insert-file-contents
(if (file-remote-p default-directory) (org-babel-make-remote-file-name tmp-file) tmp-file))
(insert-file-contents (org-babel-maybe-remote-file tmp-file))
(buffer-string))))
(if (or (member "code" result-params) (member "pp" result-params))
raw

View File

@ -176,8 +176,7 @@ last statement in BODY, as elisp."
;; (message "buffer=%s" (buffer-string)) ;; debugging
(shell-command-on-region (point-min) (point-max) "ruby"))
(let ((raw (with-temp-buffer
(insert-file-contents
(if (file-remote-p default-directory) (org-babel-make-remote-file-name tmp-file) tmp-file))
(insert-file-contents (org-babel-maybe-remote-file tmp-file))
(buffer-string))))
(if (or (member "code" result-params) (member "pp" result-params))
raw

View File

@ -1103,11 +1103,13 @@ Fixes a bug in `tramp-handle-call-process-region'."
;; is in scope from the let binding in org-babel-execute-src-block
(apply call-process-region-original start end program delete buffer display args)))
(defun org-babel-make-remote-file-name (file)
(let* ((vec (tramp-dissect-file-name default-directory))
(user (tramp-file-name-user vec))
(host (tramp-file-name-host vec)))
(concat "/" user (when user "@") host ":" file)))
(defun org-babel-maybe-remote-file (file)
(if (file-remote-p default-directory)
(let* ((vec (tramp-dissect-file-name default-directory))
(user (tramp-file-name-user vec))
(host (tramp-file-name-host vec)))
(concat "/" user (when user "@") host ":" file))
file))
(provide 'org-babel)
;;; org-babel.el ends here