Commit aae5bf44 authored by Michael Albinus's avatar Michael Albinus

Tramp requires Emacs 24.4

* doc/misc/tramp.texi (Frequently Asked Questions):
Use `with-eval-after-load'. in example.

* doc/misc/trampver.texi: Set variable emacsver.

* lisp/net/tramp.el (tramp-send-string, tramp-call-process)
(tramp-call-process-region, tramp-process-lines):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-truename)
(tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes)
(tramp-gvfs-handle-file-notify-add-watch)
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-file-notify-add-watch, tramp-find-executable)
(tramp-set-remote-path)
(tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection, tramp-send-command):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
(tramp-smb-handle-set-file-acl)
(tramp-smb-handle-start-file-process)
(tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl):
(tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'.

* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-ftp.el: Use `with-eval-after-load'.

* lisp/net/tramp-cmds.el (tramp-cleanup-connection)
(tramp-cleanup-all-connections): Cancel timer.

* lisp/net/tramp-compat.el (subr-x): Require.
(default-toplevel-value): Don't make it a defalias.

* lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'.  Do
not special handle `split-string'.

* lisp/net/tramp.el: Require Emacs 24.4.
(tramp-password-prompt-regexp): Use `password-word-equivalents'.
(tramp-user-error): Use `user-error'.
(tramp-replace-environment-variables): Use `substitute-env-vars'.
(tramp-wait-for-regexp): Rearrange `with-current-buffer' call.
(tramp-get-local-gid): Use `group-gid'.

* lisp/net/trampver.el: Check for Emacs 24.4.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test03-file-name-host-rules)
(tramp-test03-file-name-method-rules): Don't check for `user-error'.
parent c534a4a3
...@@ -4204,10 +4204,8 @@ directory to the cache: ...@@ -4204,10 +4204,8 @@ directory to the cache:
@lisp @lisp
@group @group
@c `with-eval-after-load' has been introduced with Emacs 24.4. Shall (with-eval-after-load 'filecache
@c be used when appropriate. (file-cache-add-directory
(eval-after-load "filecache"
'(file-cache-add-directory
"@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
@end group @end group
@end lisp @end lisp
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
@c Copyright (C) 2003-2019 Free Software Foundation, Inc. @c Copyright (C) 2003-2019 Free Software Foundation, Inc.
@c See file doclicense.texi for copying conditions. @c See file doclicense.texi for copying conditions.
@c In the Tramp GIT, the version number is auto-frobbed from tramp.el, @c In the Tramp GIT, the version numbers are auto-frobbed from
@c and the bug report address is auto-frobbed from configure.ac. @c tramp.el, and the bug report address is auto-frobbed from
@c configure.ac.
@set trampver 2.4.2-pre @set trampver 2.4.2-pre
@set tramp-bug-report-address tramp-devel@@gnu.org @set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 24.4
@c Other flags from configuration. @c Other flags from configuration.
@set instprefix /usr/local @set instprefix /usr/local
......
...@@ -257,17 +257,15 @@ pass to the OPERATION." ...@@ -257,17 +257,15 @@ pass to the OPERATION."
(setq thisstep (pop steps)) (setq thisstep (pop steps))
(tramp-message (tramp-message
v 5 "Check %s" v 5 "Check %s"
(mapconcat #'identity (string-join
(append '("") (reverse result) (list thisstep)) (append '("") (reverse result) (list thisstep)) "/"))
"/"))
(setq symlink-target (setq symlink-target
(tramp-compat-file-attribute-type (tramp-compat-file-attribute-type
(file-attributes (file-attributes
(tramp-make-tramp-file-name (tramp-make-tramp-file-name
v (mapconcat #'identity v
(append (string-join
'("") (reverse result) (list thisstep)) (append '("") (reverse result) (list thisstep)) "/")))))
"/")))))
(cond ((string= "." thisstep) (cond ((string= "." thisstep)
(tramp-message v 5 "Ignoring step `.'")) (tramp-message v 5 "Ignoring step `.'"))
((string= ".." thisstep) ((string= ".." thisstep)
...@@ -302,9 +300,9 @@ pass to the OPERATION." ...@@ -302,9 +300,9 @@ pass to the OPERATION."
;; Combine list to form string. ;; Combine list to form string.
(setq result (setq result
(if result (if result
(mapconcat #'identity (cons "" result) "/") (string-join (cons "" result) "/")
"/")) "/"))
(when (and is-dir (or (string= "" result) (when (and is-dir (or (string-empty-p result)
(not (string= (substring result -1) "/")))) (not (string= (substring result -1) "/"))))
(setq result (concat result "/")))) (setq result (concat result "/"))))
...@@ -479,7 +477,7 @@ Emacs dired can't find files." ...@@ -479,7 +477,7 @@ Emacs dired can't find files."
#'tramp-adb-ls-output-time-less-p #'tramp-adb-ls-output-time-less-p
#'tramp-adb-ls-output-name-less-p)))) #'tramp-adb-ls-output-name-less-p))))
(delete-region (point-min) (point-max)) (delete-region (point-min) (point-max))
(insert " " (mapconcat #'identity sorted-lines "\n "))) (insert " " (string-join sorted-lines "\n ")))
;; Add final newline. ;; Add final newline.
(goto-char (point-max)) (goto-char (point-max))
(unless (bolp) (insert "\n")))) (unless (bolp) (insert "\n"))))
...@@ -1232,7 +1230,7 @@ connection if a previous connection has died for some reason." ...@@ -1232,7 +1230,7 @@ connection if a previous connection has died for some reason."
(prompt (md5 (concat (prin1-to-string process-environment) (prompt (md5 (concat (prin1-to-string process-environment)
(current-time-string))))) (current-time-string)))))
(tramp-message (tramp-message
vec 6 "%s" (mapconcat #'identity (process-command p) " ")) vec 6 "%s" (string-join (process-command p) " "))
;; Wait for initial prompt. On some devices, it needs an ;; Wait for initial prompt. On some devices, it needs an
;; initial RET, in order to get it. ;; initial RET, in order to get it.
(sleep-for 0.1) (sleep-for 0.1)
...@@ -1300,16 +1298,16 @@ connection if a previous connection has died for some reason." ...@@ -1300,16 +1298,16 @@ connection if a previous connection has died for some reason."
;; `connection-local-set-profile-variables' and ;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1. ;; `connection-local-set-profiles' exists since Emacs 26.1.
(eval-after-load "shell" (with-eval-after-load 'shell
'(progn (progn
(tramp-compat-funcall (tramp-compat-funcall
'connection-local-set-profile-variables 'connection-local-set-profile-variables
'tramp-adb-connection-local-default-profile 'tramp-adb-connection-local-default-profile
tramp-adb-connection-local-default-profile) tramp-adb-connection-local-default-profile)
(tramp-compat-funcall (tramp-compat-funcall
'connection-local-set-profiles 'connection-local-set-profiles
`(:application tramp :protocol ,tramp-adb-method) `(:application tramp :protocol ,tramp-adb-method)
'tramp-adb-connection-local-default-profile))) 'tramp-adb-connection-local-default-profile)))
(add-hook 'tramp-unload-hook (add-hook 'tramp-unload-hook
(lambda () (lambda ()
......
...@@ -372,14 +372,14 @@ pass to the OPERATION." ...@@ -372,14 +372,14 @@ pass to the OPERATION."
;; `tramp-archive-file-name-handler' must be placed before `url-file-handler'. ;; `tramp-archive-file-name-handler' must be placed before `url-file-handler'.
(when url-handler-mode (tramp-register-file-name-handlers)) (when url-handler-mode (tramp-register-file-name-handlers))
(eval-after-load 'url-handler (with-eval-after-load 'url-handler
'(progn (progn
(add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers) (add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers)
(add-hook (add-hook
'tramp-archive-unload-hook 'tramp-archive-unload-hook
(lambda () (lambda ()
(remove-hook (remove-hook
'url-handler-mode-hook #'tramp-register-file-name-handlers))))) 'url-handler-mode-hook #'tramp-register-file-name-handlers)))))
;; File name conversions. ;; File name conversions.
......
...@@ -116,6 +116,12 @@ When called interactively, a Tramp connection has to be selected." ...@@ -116,6 +116,12 @@ When called interactively, a Tramp connection has to be selected."
(delete-process (tramp-get-connection-process vec))) (delete-process (tramp-get-connection-process vec)))
(tramp-flush-connection-properties vec) (tramp-flush-connection-properties vec)
;; Cancel timer.
(dolist (timer timer-list)
(when (and (eq (timer--function timer) 'tramp-timeout-session)
(tramp-file-name-equal-p vec (car (timer--args timer))))
(cancel-timer timer)))
;; Remove buffers. ;; Remove buffers.
(dolist (dolist
(buf (list (get-buffer (tramp-buffer-name vec)) (buf (list (get-buffer (tramp-buffer-name vec))
...@@ -163,9 +169,12 @@ This includes password cache, file cache, connection cache, buffers." ...@@ -163,9 +169,12 @@ This includes password cache, file cache, connection cache, buffers."
(delete (car proxies) tramp-default-proxies-alist) (delete (car proxies) tramp-default-proxies-alist)
proxies tramp-default-proxies-alist) proxies tramp-default-proxies-alist)
(setq proxies (cdr proxies))))) (setq proxies (cdr proxies)))))
(when (and tramp-default-proxies-alist tramp-save-ad-hoc-proxies) (when (and tramp-default-proxies-alist tramp-save-ad-hoc-proxies)
(customize-save-variable (customize-save-variable
'tramp-default-proxies-alist tramp-default-proxies-alist)) 'tramp-default-proxies-alist tramp-default-proxies-alist))
;; Cancel timers.
(cancel-function-timers 'tramp-timeout-session)
;; Remove buffers. ;; Remove buffers.
(dolist (name (tramp-list-tramp-buffers)) (dolist (name (tramp-list-tramp-buffers))
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'. (require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
(require 'parse-time) (require 'parse-time)
(require 'shell) (require 'shell)
(require 'subr-x)
(declare-function tramp-handle-temporary-file-directory "tramp") (declare-function tramp-handle-temporary-file-directory "tramp")
...@@ -81,7 +82,7 @@ Add the extension of F, if existing." ...@@ -81,7 +82,7 @@ Add the extension of F, if existing."
((fboundp 'w32-window-exists-p) ((fboundp 'w32-window-exists-p)
(tramp-compat-funcall 'w32-window-exists-p process-name process-name)) (tramp-compat-funcall 'w32-window-exists-p process-name process-name))
;; GNU Emacs 23. ;; GNU Emacs 23+.
((and (fboundp 'list-system-processes) (fboundp 'process-attributes)) ((and (fboundp 'list-system-processes) (fboundp 'process-attributes))
(let (result) (let (result)
(dolist (pid (tramp-compat-funcall 'list-system-processes) result) (dolist (pid (tramp-compat-funcall 'list-system-processes) result)
...@@ -97,10 +98,6 @@ Add the extension of F, if existing." ...@@ -97,10 +98,6 @@ Add the extension of F, if existing."
process-name)))) process-name))))
(setq result t))))))))) (setq result t)))))))))
;; `default-toplevel-value' has been declared in Emacs 24.4.
(unless (fboundp 'default-toplevel-value)
(defalias 'default-toplevel-value #'symbol-value))
;; `file-attribute-*' are introduced in Emacs 25.1. ;; `file-attribute-*' are introduced in Emacs 25.1.
(defalias 'tramp-compat-file-attribute-type (defalias 'tramp-compat-file-attribute-type
...@@ -306,9 +303,4 @@ A nil value for either argument stands for the current time." ...@@ -306,9 +303,4 @@ A nil value for either argument stands for the current time."
(provide 'tramp-compat) (provide 'tramp-compat)
;;; TODO:
;; * When we get rid of Emacs 24, replace "(mapconcat #'identity" by
;; "(string-join".
;;; tramp-compat.el ends here ;;; tramp-compat.el ends here
...@@ -53,8 +53,8 @@ present for backward compatibility." ...@@ -53,8 +53,8 @@ present for backward compatibility."
(setq file-name-handler-alist (setq file-name-handler-alist
(delete a1 (delete a2 file-name-handler-alist))))) (delete a1 (delete a2 file-name-handler-alist)))))
(eval-after-load "ange-ftp" (with-eval-after-load 'ange-ftp
'(tramp-disable-ange-ftp)) (tramp-disable-ange-ftp))
;;;###tramp-autoload ;;;###tramp-autoload
(defun tramp-ftp-enable-ange-ftp () (defun tramp-ftp-enable-ange-ftp ()
......
...@@ -724,12 +724,7 @@ is no information where to trace the message.") ...@@ -724,12 +724,7 @@ is no information where to trace the message.")
(tramp-message tramp-gvfs-dbus-event-vector 6 "%S" event) (tramp-message tramp-gvfs-dbus-event-vector 6 "%S" event)
(tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))))
;; `dbus-event-error-hooks' has been renamed to (add-hook 'dbus-event-error-functions #'tramp-gvfs-dbus-event-error)
;; `dbus-event-error-functions' in Emacs 24.3.
(add-hook
(if (boundp 'dbus-event-error-functions)
'dbus-event-error-functions 'dbus-event-error-hooks)
#'tramp-gvfs-dbus-event-error)
;; File name primitives. ;; File name primitives.
...@@ -942,7 +937,7 @@ file names." ...@@ -942,7 +937,7 @@ file names."
;; Send command. ;; Send command.
(tramp-gvfs-send-command (tramp-gvfs-send-command
v "gvfs-ls" "-h" "-n" "-a" v "gvfs-ls" "-h" "-n" "-a"
(mapconcat #'identity tramp-gvfs-file-attributes ",") (string-join tramp-gvfs-file-attributes ",")
(tramp-gvfs-url-file-name directory)) (tramp-gvfs-url-file-name directory))
;; Parse output. ;; Parse output.
(with-current-buffer (tramp-get-connection-buffer v) (with-current-buffer (tramp-get-connection-buffer v)
...@@ -1183,7 +1178,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." ...@@ -1183,7 +1178,7 @@ If FILE-SYSTEM is non-nil, return file system attributes."
(tramp-error (tramp-error
v 'file-notify-error "Monitoring not supported for `%s'" file-name) v 'file-notify-error "Monitoring not supported for `%s'" file-name)
(tramp-message (tramp-message
v 6 "Run `%s', %S" (mapconcat #'identity (process-command p) " ") p) v 6 "Run `%s', %S" (string-join (process-command p) " ") p)
(process-put p 'vector v) (process-put p 'vector v)
(process-put p 'events events) (process-put p 'events events)
(process-put p 'watch-name localname) (process-put p 'watch-name localname)
...@@ -1997,15 +1992,12 @@ VEC is used only for traces." ...@@ -1997,15 +1992,12 @@ VEC is used only for traces."
(list user host))) (list user host)))
(zeroconf-list-services service))) (zeroconf-list-services service)))
;; We use the TRIM argument of `split-string', which exist since Emacs
;; 24.4. I mask this for older Emacs versions, there is no harm.
(defun tramp-gvfs-parse-device-names (service) (defun tramp-gvfs-parse-device-names (service)
"Return a list of (user host) tuples allowed to access. "Return a list of (user host) tuples allowed to access.
This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(let ((result (let ((result
(ignore-errors (ignore-errors
(tramp-compat-funcall (split-string
'split-string
(shell-command-to-string (format "avahi-browse -trkp %s" service)) (shell-command-to-string (format "avahi-browse -trkp %s" service))
"[\n\r]+" 'omit "^\\+;.*$")))) "[\n\r]+" 'omit "^\\+;.*$"))))
(delete-dups (delete-dups
...@@ -2013,8 +2005,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." ...@@ -2013,8 +2005,7 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(lambda (x) (lambda (x)
(let* ((list (split-string x ";")) (let* ((list (split-string x ";"))
(host (nth 6 list)) (host (nth 6 list))
(text (tramp-compat-funcall (text (split-string (nth 9 list) "\" \"" 'omit "\""))
'split-string (nth 9 list) "\" \"" 'omit "\""))
user) user)
;; A user is marked in a TXT field like "u=guest". ;; A user is marked in a TXT field like "u=guest".
(while text (while text
......
...@@ -123,18 +123,18 @@ been set up by `rfn-eshadow-setup-minibuffer'." ...@@ -123,18 +123,18 @@ been set up by `rfn-eshadow-setup-minibuffer'."
(mapconcat (mapconcat
#'identity (butlast (tramp-compat-exec-path)) path-separator))) #'identity (butlast (tramp-compat-exec-path)) path-separator)))
(eval-after-load "esh-util" (with-eval-after-load 'esh-util
'(progn (progn
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
#'tramp-eshell-directory-change) #'tramp-eshell-directory-change)
(add-hook 'eshell-directory-change-hook (add-hook 'eshell-directory-change-hook
#'tramp-eshell-directory-change) #'tramp-eshell-directory-change)
(add-hook 'tramp-integration-unload-hook (add-hook 'tramp-integration-unload-hook
(lambda () (lambda ()
(remove-hook 'eshell-mode-hook (remove-hook 'eshell-mode-hook
#'tramp-eshell-directory-change) #'tramp-eshell-directory-change)
(remove-hook 'eshell-directory-change-hook (remove-hook 'eshell-directory-change-hook
#'tramp-eshell-directory-change))))) #'tramp-eshell-directory-change)))))
;;; Integration of recentf.el: ;;; Integration of recentf.el:
...@@ -158,18 +158,18 @@ NAME must be equal to `tramp-current-connection'." ...@@ -158,18 +158,18 @@ NAME must be equal to `tramp-current-connection'."
(let ((recentf-exclude '(file-remote-p))) (let ((recentf-exclude '(file-remote-p)))
(recentf-cleanup)))) (recentf-cleanup))))
(eval-after-load "recentf" (with-eval-after-load 'recentf
'(progn (progn
(add-hook 'tramp-cleanup-connection-hook (add-hook 'tramp-cleanup-connection-hook
#'tramp-recentf-cleanup) #'tramp-recentf-cleanup)
(add-hook 'tramp-cleanup-all-connections-hook (add-hook 'tramp-cleanup-all-connections-hook
#'tramp-recentf-cleanup-all) #'tramp-recentf-cleanup-all)
(add-hook 'tramp-integration-unload-hook (add-hook 'tramp-integration-unload-hook
(lambda () (lambda ()
(remove-hook 'tramp-cleanup-connection-hook (remove-hook 'tramp-cleanup-connection-hook
#'tramp-recentf-cleanup) #'tramp-recentf-cleanup)
(remove-hook 'tramp-cleanup-all-connections-hook (remove-hook 'tramp-cleanup-all-connections-hook
#'tramp-recentf-cleanup-all))))) #'tramp-recentf-cleanup-all)))))
;;; Default connection-local variables for Tramp: ;;; Default connection-local variables for Tramp:
...@@ -180,16 +180,16 @@ NAME must be equal to `tramp-current-connection'." ...@@ -180,16 +180,16 @@ NAME must be equal to `tramp-current-connection'."
;; `connection-local-set-profile-variables' and ;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1. ;; `connection-local-set-profiles' exists since Emacs 26.1.
(eval-after-load "shell" (with-eval-after-load 'shell
'(progn (progn
(tramp-compat-funcall (tramp-compat-funcall
'connection-local-set-profile-variables 'connection-local-set-profile-variables
'tramp-connection-local-default-profile 'tramp-connection-local-default-profile
tramp-connection-local-default-profile) tramp-connection-local-default-profile)
(tramp-compat-funcall (tramp-compat-funcall
'connection-local-set-profiles 'connection-local-set-profiles
`(:application tramp) `(:application tramp)
'tramp-connection-local-default-profile))) 'tramp-connection-local-default-profile)))
(add-hook 'tramp-unload-hook (add-hook 'tramp-unload-hook
(lambda () (unload-feature 'tramp-integration 'force))) (lambda () (unload-feature 'tramp-integration 'force)))
......
...@@ -1135,19 +1135,15 @@ component is used as the target of the symlink." ...@@ -1135,19 +1135,15 @@ component is used as the target of the symlink."
(setq thisstep (pop steps)) (setq thisstep (pop steps))
(tramp-message (tramp-message
v 5 "Check %s" v 5 "Check %s"
(mapconcat #'identity (string-join
(append '("") (reverse result) (list thisstep)) (append '("") (reverse result) (list thisstep)) "/"))
"/"))
(setq symlink-target (setq symlink-target
(tramp-compat-file-attribute-type (tramp-compat-file-attribute-type
(file-attributes (file-attributes
(tramp-make-tramp-file-name (tramp-make-tramp-file-name
v v
(mapconcat #'identity (string-join
(append '("") (append '("") (reverse result) (list thisstep)) "/")
(reverse result)
(list thisstep))
"/")
'nohop)))) 'nohop))))
(cond ((string= "." thisstep) (cond ((string= "." thisstep)
(tramp-message v 5 "Ignoring step `.'")) (tramp-message v 5 "Ignoring step `.'"))
...@@ -1173,12 +1169,8 @@ component is used as the target of the symlink." ...@@ -1173,12 +1169,8 @@ component is used as the target of the symlink."
"Maximum number (%d) of symlinks exceeded" numchase-limit)) "Maximum number (%d) of symlinks exceeded" numchase-limit))
(setq result (reverse result)) (setq result (reverse result))
;; Combine list to form string. ;; Combine list to form string.
(setq result (setq result (if result (string-join (cons "" result) "/") "/"))
(if result (when (string-empty-p result) (setq result "/")))))
(mapconcat #'identity (cons "" result) "/")
"/"))
(when (string= "" result)
(setq result "/")))))
;; Detect cycle. ;; Detect cycle.
(when (and (file-symlink-p filename) (when (and (file-symlink-p filename)
...@@ -1993,7 +1985,6 @@ file names." ...@@ -1993,7 +1985,6 @@ file names."
(t2 (tramp-tramp-file-p newname)) (t2 (tramp-tramp-file-p newname))
(length (tramp-compat-file-attribute-size (length (tramp-compat-file-attribute-size
(file-attributes (file-truename filename)))) (file-attributes (file-truename filename))))
;; `file-extended-attributes' exists since Emacs 24.4.
(attributes (and preserve-extended-attributes (attributes (and preserve-extended-attributes
(apply #'file-extended-attributes (list filename))))) (apply #'file-extended-attributes (list filename)))))
...@@ -2065,7 +2056,6 @@ file names." ...@@ -2065,7 +2056,6 @@ file names."
;; Handle `preserve-extended-attributes'. We ignore possible ;; Handle `preserve-extended-attributes'. We ignore possible
;; errors, because ACL strings could be incompatible. ;; errors, because ACL strings could be incompatible.
;; `set-file-extended-attributes' exists since Emacs 24.4.
(when attributes (when attributes
(ignore-errors (ignore-errors
(apply #'set-file-extended-attributes (list newname attributes)))) (apply #'set-file-extended-attributes (list newname attributes))))
...@@ -2364,7 +2354,7 @@ The method used must be an out-of-band method." ...@@ -2364,7 +2354,7 @@ The method used must be an out-of-band method."
(mapcar (mapcar
(lambda (x) (lambda (x)
(setq x (mapcar (lambda (y) (format-spec y spec)) x)) (setq x (mapcar (lambda (y) (format-spec y spec)) x))
(unless (member "" x) (mapconcat #'identity x " "))) (unless (member "" x) (string-join x " ")))
(tramp-get-method-parameter v 'tramp-copy-env))) (tramp-get-method-parameter v 'tramp-copy-env)))
remote-copy-program remote-copy-program
...@@ -3636,8 +3626,8 @@ Fall back to normal file name handler if no Tramp handler exists." ...@@ -3636,8 +3626,8 @@ Fall back to normal file name handler if no Tramp handler exists."
(tramp-error (tramp-error
v 'file-notify-error v 'file-notify-error
"`%s' failed to start on remote host" "`%s' failed to start on remote host"
(mapconcat #'identity sequence " ")) (string-join sequence " "))
(tramp-message v 6 "Run `%s', %S" (mapconcat #'identity sequence " ") p) (tramp-message v 6 "Run `%s', %S" (string-join sequence " ") p)
(process-put p 'vector v) (process-put p 'vector v)
;; Needed for process filter. ;; Needed for process filter.
(process-put p 'events events) (process-put p 'events events)
...@@ -3928,7 +3918,7 @@ This function expects to be in the right *tramp* buffer." ...@@ -3928,7 +3918,7 @@ This function expects to be in the right *tramp* buffer."
"%s\n%s")) "%s\n%s"))
progname progname progname progname progname progname
tramp-end-of-heredoc tramp-end-of-heredoc
(mapconcat #'identity dirlist "\n") (string-join dirlist "\n")
tramp-end-of-heredoc)) tramp-end-of-heredoc))
(goto-char (point-max)) (goto-char (point-max))
(when (search-backward "tramp_executable " nil t) (when (search-backward "tramp_executable " nil t)
...@@ -3946,8 +3936,8 @@ I.e., for each directory in `tramp-remote-path', it is tested ...@@ -3946,8 +3936,8 @@ I.e., for each directory in `tramp-remote-path', it is tested
whether it exists and if so, it is added to the environment whether it exists and if so, it is added to the environment
variable PATH." variable PATH."
(let ((command (let ((command
(format "PATH=%s; export PATH" (format
(mapconcat #'identity (tramp-get-remote-path vec) ":"))) "PATH=%s; export PATH" (string-join (tramp-get-remote-path vec) ":")))
(pipe-buf (pipe-buf
(or (with-tramp-connection-property vec "pipe-buf" (or (with-tramp-connection-property vec "pipe-buf"
(tramp-send-command-and-read (tramp-send-command-and-read
...@@ -4290,7 +4280,7 @@ process to set up. VEC specifies the connection." ...@@ -4290,7 +4280,7 @@ process to set up. VEC specifies the connection."
(append `(,(tramp-get-remote-locale vec)) (append `(,(tramp-get-remote-locale vec))
(copy-sequence tramp-remote-process-environment)))) (copy-sequence tramp-remote-process-environment))))
(setq item (split-string item "=" 'omit)) (setq item (split-string item "=" 'omit))
(setcdr item (mapconcat #'identity (cdr item) "=")) (setcdr item (string-join (cdr item) "="))
(if (and (stringp (cdr item)) (not (string-equal (cdr item) ""))) (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
(push (format "%s %s" (car item) (cdr item)) vars) (push (format "%s %s" (car item) (cdr item)) vars)
(push (car item) unset))) (push (car item) unset)))
...@@ -4300,12 +4290,12 @@ process to set up. VEC specifies the connection." ...@@ -4300,12 +4290,12 @@ process to set up. VEC specifies the connection."
(format (format
"while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s" "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s"
tramp-end-of-heredoc tramp-end-of-heredoc
(mapconcat #'identity vars "\n") (string-join vars "\n")
tramp-end-of-heredoc) tramp-end-of-heredoc)
t)) t))
(when unset (when unset
(tramp-send-command (tramp-send-command
vec (format "unset %s" (mapconcat #'identity unset " ")) t))))) vec (format "unset %s" (string-join unset " ")) t)))))
;; Old text from documentation of tramp-methods: ;; Old text from documentation of tramp-methods:
;; Using a uuencode/uudecode inline method is discouraged, please use one ;; Using a uuencode/uudecode inline method is discouraged, please use one
...@@ -4873,8 +4863,7 @@ connection if a previous connection has died for some reason." ...@@ -4873,8 +4863,7 @@ connection if a previous connection has died for some reason."
(set-process-query-on-exit-flag p nil) (set-process-query-on-exit-flag p nil)
(setq tramp-current-connection (cons vec (current-time))) (setq tramp-current-connection (cons vec (current-time)))
(tramp-message (tramp-message vec 6 "%s" (string-join (process-command p) " "))