(list "-s" device "shell")
(list "shell")))
(p (let ((default-directory
- (tramp-compat-temporary-file-directory)))
+ tramp-compat-temporary-file-directory))
(apply #'start-process (tramp-get-connection-name vec) buf
tramp-adb-program args)))
(prompt (md5 (concat (prin1-to-string process-environment)
;; mounted directory, it is returned as it. Not what we want.
(with-parsed-tramp-archive-file-name default-directory nil
(let ((default-directory (file-name-directory archive)))
- (tramp-compat-temporary-file-directory))))
+ (tramp-compat-temporary-file-directory-function))))
(defun tramp-archive-handle-not-implemented (operation &rest args)
"Generic handler for operations not implemented for file archives."
`(when (functionp ,function)
(with-no-warnings (funcall ,function ,@arguments))))
-(defsubst tramp-compat-temporary-file-directory ()
- "Return name of directory for temporary files.
-It is the default value of `temporary-file-directory'."
- ;; We must return a local directory. If it is remote, we could run
- ;; into an infloop.
- (eval (car (get 'temporary-file-directory 'standard-value)) t))
+;; We must use a local directory. If it is remote, we could run into
+;; an infloop.
+(defconst tramp-compat-temporary-file-directory
+ (eval (car (get 'temporary-file-directory 'standard-value)) t)
+ "The default value of `temporary-file-directory'.")
(defsubst tramp-compat-make-temp-name ()
"Generate a local temporary file name (compat function)."
(make-temp-name
(expand-file-name
- tramp-temp-name-prefix (tramp-compat-temporary-file-directory))))
+ tramp-temp-name-prefix tramp-compat-temporary-file-directory)))
(defsubst tramp-compat-make-temp-file (f &optional dir-flag)
"Create a local temporary file (compat function).
Add the extension of F, if existing."
(make-temp-file
(expand-file-name
- tramp-temp-name-prefix (tramp-compat-temporary-file-directory))
+ tramp-temp-name-prefix tramp-compat-temporary-file-directory)
dir-flag (file-name-extension f t)))
;; `temporary-file-directory' as function is introduced with Emacs 26.1.
(unless (tramp-crypt-file-name-p tfnfo)
(setq tfnfo (apply
#'tramp-file-name-for-operation operation
- (cons (tramp-compat-temporary-file-directory) (cdr args)))))
+ (cons tramp-compat-temporary-file-directory (cdr args)))))
tfnfo))
(defun tramp-crypt-run-real-handler (operation args)
(copy-file remote-config local-config 'ok 'keep)
;; Create local encfs6 config file otherwise.
- (let* ((default-directory (tramp-compat-temporary-file-directory))
+ (let* ((default-directory tramp-compat-temporary-file-directory)
(tmpdir1 (file-name-as-directory
(tramp-compat-make-temp-file " .crypt" 'dir-flag)))
(tmpdir2 (file-name-as-directory
(with-temp-buffer
(let* (;; Don't check for a proper method.
(non-essential t)
- (default-directory (tramp-compat-temporary-file-directory))
+ (default-directory tramp-compat-temporary-file-directory)
;; We cannot add it to `process-environment', because
;; `tramp-call-process-region' doesn't use it.
(encfs-config
crypt-vec localname (concat (symbol-name op) "-file-name")
(unless (tramp-crypt-send-command
crypt-vec (if (eq op 'encrypt) "encode" "decode")
- (tramp-compat-temporary-file-directory) localname)
+ tramp-compat-temporary-file-directory localname)
(tramp-error
crypt-vec 'file-error "%s of file name %s failed."
(if (eq op 'encrypt) "Encoding" "Decoding") name))
(when (tramp-file-name-user vec)
(concat (tramp-file-name-user-domain vec) "@"))
(tramp-file-name-host-port vec))
- (tramp-compat-temporary-file-directory))))
+ tramp-compat-temporary-file-directory)))
(defun tramp-fuse-mounted-p (vec)
"Check, whether fuse volume determined by VEC is mounted."
;; to cache a nil result.
(or (tramp-get-connection-property
(tramp-get-connection-process vec) "mounted" nil)
- (let* ((default-directory (tramp-compat-temporary-file-directory))
+ (let* ((default-directory tramp-compat-temporary-file-directory)
(command (format "mount -t fuse.%s" (tramp-file-name-method vec)))
(mount (shell-command-to-string command)))
(tramp-message vec 6 "%s\n%s" command mount)
(defun tramp-fuse-unmount (vec)
"Unmount fuse volume determined by VEC."
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(command (format "fusermount3 -u %s" (tramp-fuse-mount-point vec))))
(tramp-message vec 6 "%s\n%s" command (shell-command-to-string command))
(tramp-flush-connection-property
;; can be handled. We don't set a timeout, because
;; the copying of large files can last longer than 60
;; secs.
- p (let ((default-directory (tramp-compat-temporary-file-directory)))
+ p (let ((default-directory tramp-compat-temporary-file-directory))
(apply
#'start-process
(tramp-get-connection-name v)
;; `expand-file-name' (this does "/./" and "/../").
;; `default-directory' is bound, because on Windows there
;; would be problems with UNC shares or Cygwin mounts.
- (let ((default-directory (tramp-compat-temporary-file-directory)))
+ (let ((default-directory tramp-compat-temporary-file-directory))
(tramp-make-tramp-file-name
v (tramp-drop-volume-letter
(tramp-run-real-handler
(let (file-name-handler-alist
(coding-system-for-write 'binary)
(default-directory
- (tramp-compat-temporary-file-directory)))
+ tramp-compat-temporary-file-directory))
(with-temp-file tmpfile
(set-buffer-multibyte nil)
(insert-buffer-substring (tramp-get-buffer v))
;; we use it always because this makes the logic
;; simpler. We must also set `temporary-file-directory',
;; because it could point to a remote directory.
- (temporary-file-directory
- (tramp-compat-temporary-file-directory))
+ (temporary-file-directory tramp-compat-temporary-file-directory)
(tmpfile (or tramp-temp-buffer-file-name
(tramp-compat-make-temp-file filename))))
;; question is a tmp file anyway.
(let ((coding-system-for-read 'binary)
(default-directory
- (tramp-compat-temporary-file-directory)))
+ tramp-compat-temporary-file-directory))
(insert-file-contents-literally tmpfile)
(funcall loc-enc (point-min) (point-max)))
;; This must be done in order to avoid our file
;; name handler.
(p (let ((default-directory
- (tramp-compat-temporary-file-directory)))
+ tramp-compat-temporary-file-directory))
(apply
#'start-process
(tramp-get-connection-name vec)
;; Otherwise, we must delete the connection cache, because
;; capabilities might have changed.
(unless (or argument (processp p))
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(command (concat tramp-smb-program " -V")))
(unless tramp-smb-version
(let* ((coding-system-for-read nil)
(process-connection-type tramp-process-connection-type)
(p (let ((default-directory
- (tramp-compat-temporary-file-directory))
+ tramp-compat-temporary-file-directory)
(process-environment
(cons (concat "TERM=" tramp-terminal-type)
process-environment)))
;; `(custom-declare-variable outline-minor-mode-prefix ...)'
;; raises on error in `(outline-mode)', we don't want to see it
;; in the traces.
- (let ((default-directory (tramp-compat-temporary-file-directory)))
+ (let ((default-directory tramp-compat-temporary-file-directory))
(outline-mode))
(setq-local outline-level 'tramp-debug-outline-level)
(setq-local font-lock-keywords
"Get the debug file name for VEC."
(expand-file-name
(tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec))
- (tramp-compat-temporary-file-directory)))
+ tramp-compat-temporary-file-directory))
(put #'tramp-get-debug-file-name 'tramp-suppress-trace t)
(dolist
(elt
(append
- (mapcar #'intern (all-completions "tramp-" obarray 'functionp))
+ (mapcar
+ #'intern (all-completions "tramp-" obarray #'functionp))
tramp-trace-functions))
(unless (get elt 'tramp-suppress-trace)
(trace-function-background elt))))
;; the bug#9114 for which it was added doesn't
;; clarify the core of the problem.
(let ((default-directory
- (tramp-compat-temporary-file-directory))
+ tramp-compat-temporary-file-directory)
file-name-handler-alist)
(autoload-do-load sf foreign)))
;; (tramp-message
User is always nil."
;; On Windows, there are problems in completion when
;; `default-directory' is remote.
- (let ((default-directory (tramp-compat-temporary-file-directory)))
+ (let ((default-directory tramp-compat-temporary-file-directory))
(when (file-readable-p filename)
(with-temp-buffer
(insert-file-contents-literally filename)
User is always nil."
;; On Windows, there are problems in completion when
;; `default-directory' is remote.
- (let* ((default-directory (tramp-compat-temporary-file-directory))
+ (let* ((default-directory tramp-compat-temporary-file-directory)
(files (and (file-directory-p dirname) (directory-files dirname))))
(cl-loop
for f in files
;; Do normal `expand-file-name' (this does "/./" and "/../").
;; `default-directory' is bound, because on Windows there would
;; be problems with UNC shares or Cygwin mounts.
- (let ((default-directory (tramp-compat-temporary-file-directory)))
+ (let ((default-directory tramp-compat-temporary-file-directory))
(tramp-make-tramp-file-name
v (tramp-drop-volume-letter
(tramp-run-real-handler #'expand-file-name (list localname))))))))
"An alternative `make-process' implementation for Tramp files."
(when args
(with-parsed-tramp-file-name (expand-file-name default-directory) nil
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(name (plist-get args :name))
(buffer (plist-get args :buffer))
(command (plist-get args :command))
;; The local temp directory must be writable for the other user.
(file-writable-p
(tramp-make-tramp-file-name
- vec (tramp-compat-temporary-file-directory) 'nohop))
+ vec tramp-compat-temporary-file-directory 'nohop))
;; On some systems, chown runs only for root.
(or (zerop (user-uid))
(zerop (tramp-get-remote-uid vec 'integer))))))
It always returns a return code. The Lisp error raised when
PROGRAM is nil is trapped also, returning 1. Furthermore, traces
are written with verbosity of 6."
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(process-environment (default-toplevel-value 'process-environment))
(destination (if (eq destination t) (current-buffer) destination))
(vec (or vec (car tramp-current-connection)))
It always returns a return code. The Lisp error raised when
PROGRAM is nil is trapped also, returning 1. Furthermore, traces
are written with verbosity of 6."
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(process-environment (default-toplevel-value 'process-environment))
(buffer (if (eq buffer t) (current-buffer) buffer))
result)
"Call `process-lines' on the local host.
If an error occurs, it returns nil. Traces are written with
verbosity of 6."
- (let ((default-directory (tramp-compat-temporary-file-directory))
+ (let ((default-directory tramp-compat-temporary-file-directory)
(process-environment (default-toplevel-value 'process-environment))
(vec (or vec (car tramp-current-connection)))
result)
;; `exec-path' contains a relative file name like ".", it
;; could happen that the "gpg" command is not found. So we
;; adapt `default-directory'. (Bug#39389, Bug#39489)
- (default-directory (tramp-compat-temporary-file-directory))
+ (default-directory tramp-compat-temporary-file-directory)
(case-fold-search t)
(key (tramp-make-tramp-file-name
;; In tramp-sh.el, we must use "password-vector" due to