summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp-compat.el6
-rw-r--r--lisp/net/tramp.el3
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 348f9b8468c..b2f91016585 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -118,6 +118,12 @@ Add the extension of F, if existing."
(extension (file-name-extension f t)))
(make-temp-file prefix dir-flag extension)))
+;; `temporary-file-directory' as function is introduced with Emacs 25.2.
+(defalias 'tramp-compat-temporary-file-directory-function
+ (if (fboundp 'temporary-file-directory)
+ 'temporary-file-directory
+ 'tramp-handle-temporary-file-directory))
+
;; PRESERVE-EXTENDED-ATTRIBUTES has been introduced with Emacs 24.1
;; (as PRESERVE-SELINUX-CONTEXT), and renamed in Emacs 24.3.
(defun tramp-compat-copy-file
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 29dd7038c09..429cd3646dc 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3996,7 +3996,8 @@ ALIST is of the form ((FROM . TO) ...)."
(defun tramp-handle-make-nearby-temp-file (prefix &optional dir-flag suffix)
"Like `make-nearby-temp-file' for Tramp files."
- (let ((temporary-file-directory (temporary-file-directory)))
+ (let ((temporary-file-directory
+ (tramp-compat-temporary-file-directory-function)))
(make-temp-file prefix dir-flag suffix)))
;;; Compatibility functions section: