Backport commit 2c05061 from Emacs

* lisp/ob-core.el (org-babel-local-file-name): Use `file-remote-p'.

Add `make-nearby-temp-file' and `temporary-file-directory'
2c0506173d92dd9d6de409a045668c6b5cf1fcef
Michael Albinus
Sun Aug 7 13:57:23 2016 +0200
This commit is contained in:
Michael Albinus 2016-08-07 13:57:23 +02:00 committed by Kyle Meyer
parent 5977aa7fc2
commit f46b92df92

View file

@ -48,11 +48,6 @@
(declare-function org-mark-ring-push "org" (&optional pos buffer))
(declare-function tramp-compat-make-temp-file "tramp-compat"
(filename &optional dir-flag))
(declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
(declare-function tramp-file-name-user "tramp" (vec))
(declare-function tramp-file-name-host "tramp" (vec))
(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body)
t)
(declare-function org-icompleting-read "org" (&rest args))
(declare-function org-edit-src-code "org-src" (&optional code edit-buffer-name))
(declare-function org-edit-src-exit "org-src" ())
@ -2965,7 +2960,7 @@ character of the string."
(start end program &optional delete buffer display &rest args)
"Use Tramp to handle `call-process-region'.
Fixes a bug in `tramp-handle-call-process-region'."
(if (and (featurep 'tramp) (file-remote-p default-directory))
(if (file-remote-p default-directory)
(let ((tmpfile (tramp-compat-make-temp-file "")))
(write-region start end tmpfile)
(when delete (delete-region start end))