aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/tramp-adb.el54
-rw-r--r--lisp/net/tramp-archive.el43
-rw-r--r--lisp/net/tramp-cache.el16
-rw-r--r--lisp/net/tramp-cmds.el14
-rw-r--r--lisp/net/tramp-compat.el42
-rw-r--r--lisp/net/tramp-ftp.el6
-rw-r--r--lisp/net/tramp-gvfs.el54
-rw-r--r--lisp/net/tramp-integration.el26
-rw-r--r--lisp/net/tramp-rclone.el14
-rw-r--r--lisp/net/tramp-sh.el153
-rw-r--r--lisp/net/tramp-smb.el48
-rw-r--r--lisp/net/tramp-sudoedit.el6
-rw-r--r--lisp/net/tramp.el106
-rw-r--r--test/lisp/net/tramp-archive-tests.el18
-rw-r--r--test/lisp/net/tramp-tests.el103
15 files changed, 354 insertions, 349 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 1ba8d6274e5..eb3295ee352 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -232,7 +232,7 @@ pass to the OPERATION."
232 ;; Preserve trailing "/". 232 ;; Preserve trailing "/".
233 (funcall 233 (funcall
234 (if (string-equal (file-name-nondirectory filename) "") 234 (if (string-equal (file-name-nondirectory filename) "")
235 'file-name-as-directory 'identity) 235 #'file-name-as-directory #'identity)
236 (with-parsed-tramp-file-name (expand-file-name filename) nil 236 (with-parsed-tramp-file-name (expand-file-name filename) nil
237 (tramp-make-tramp-file-name 237 (tramp-make-tramp-file-name
238 v 238 v
@@ -257,14 +257,14 @@ pass to the OPERATION."
257 (setq thisstep (pop steps)) 257 (setq thisstep (pop steps))
258 (tramp-message 258 (tramp-message
259 v 5 "Check %s" 259 v 5 "Check %s"
260 (mapconcat 'identity 260 (mapconcat #'identity
261 (append '("") (reverse result) (list thisstep)) 261 (append '("") (reverse result) (list thisstep))
262 "/")) 262 "/"))
263 (setq symlink-target 263 (setq symlink-target
264 (tramp-compat-file-attribute-type 264 (tramp-compat-file-attribute-type
265 (file-attributes 265 (file-attributes
266 (tramp-make-tramp-file-name 266 (tramp-make-tramp-file-name
267 v (mapconcat 'identity 267 v (mapconcat #'identity
268 (append 268 (append
269 '("") (reverse result) (list thisstep)) 269 '("") (reverse result) (list thisstep))
270 "/"))))) 270 "/")))))
@@ -302,7 +302,7 @@ pass to the OPERATION."
302 ;; Combine list to form string. 302 ;; Combine list to form string.
303 (setq result 303 (setq result
304 (if result 304 (if result
305 (mapconcat 'identity (cons "" result) "/") 305 (mapconcat #'identity (cons "" result) "/")
306 "/")) 306 "/"))
307 (when (and is-dir (or (string= "" result) 307 (when (and is-dir (or (string= "" result)
308 (not (string= (substring result -1) "/")))) 308 (not (string= (substring result -1) "/"))))
@@ -444,7 +444,7 @@ pass to the OPERATION."
444 "Almquist shell can't handle multiple arguments. 444 "Almquist shell can't handle multiple arguments.
445Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"." 445Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"."
446 (split-string 446 (split-string
447 (apply 'concat 447 (apply #'concat
448 (mapcar (lambda (s) 448 (mapcar (lambda (s)
449 (replace-regexp-in-string 449 (replace-regexp-in-string
450 "\\(.\\)" " -\\1" (replace-regexp-in-string "^-" "" s))) 450 "\\(.\\)" " -\\1" (replace-regexp-in-string "^-" "" s)))
@@ -476,10 +476,10 @@ Emacs dired can't find files."
476 (sort 476 (sort
477 lines 477 lines
478 (if sort-by-time 478 (if sort-by-time
479 'tramp-adb-ls-output-time-less-p 479 #'tramp-adb-ls-output-time-less-p
480 'tramp-adb-ls-output-name-less-p)))) 480 #'tramp-adb-ls-output-name-less-p))))
481 (delete-region (point-min) (point-max)) 481 (delete-region (point-min) (point-max))
482 (insert " " (mapconcat 'identity sorted-lines "\n "))) 482 (insert " " (mapconcat #'identity sorted-lines "\n ")))
483 ;; Add final newline. 483 ;; Add final newline.
484 (goto-char (point-max)) 484 (goto-char (point-max))
485 (unless (bolp) (insert "\n")))) 485 (unless (bolp) (insert "\n"))))
@@ -634,7 +634,7 @@ But handle the case, if the \"test\" command is not available."
634 (copy-file filename tmpfile 'ok) 634 (copy-file filename tmpfile 'ok)
635 (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600))) 635 (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600)))
636 (tramp-run-real-handler 636 (tramp-run-real-handler
637 'write-region (list start end tmpfile append 'no-message lockname)) 637 #'write-region (list start end tmpfile append 'no-message lockname))
638 (with-tramp-progress-reporter 638 (with-tramp-progress-reporter
639 v 3 (format-message 639 v 3 (format-message
640 "Moving tmp file `%s' to `%s'" tmpfile filename) 640 "Moving tmp file `%s' to `%s'" tmpfile filename)
@@ -827,7 +827,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
827 (with-parsed-tramp-file-name default-directory nil 827 (with-parsed-tramp-file-name default-directory nil
828 (let (command input tmpinput stderr tmpstderr outbuf ret) 828 (let (command input tmpinput stderr tmpstderr outbuf ret)
829 ;; Compute command. 829 ;; Compute command.
830 (setq command (mapconcat 'tramp-shell-quote-argument 830 (setq command (mapconcat #'tramp-shell-quote-argument
831 (cons program args) " ")) 831 (cons program args) " "))
832 ;; Determine input. 832 ;; Determine input.
833 (if (null infile) 833 (if (null infile)
@@ -970,7 +970,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
970 (if (and (not current-buffer-p) (integerp asynchronous)) 970 (if (and (not current-buffer-p) (integerp asynchronous))
971 (prog1 971 (prog1
972 ;; Run the process. 972 ;; Run the process.
973 (apply 'start-file-process "*Async Shell*" buffer args) 973 (apply #'start-file-process "*Async Shell*" buffer args)
974 ;; Display output. 974 ;; Display output.
975 (pop-to-buffer output-buffer) 975 (pop-to-buffer output-buffer)
976 (setq mode-line-process '(":%s")) 976 (setq mode-line-process '(":%s"))
@@ -978,7 +978,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
978 978
979 (prog1 979 (prog1
980 ;; Run the process. 980 ;; Run the process.
981 (apply 'process-file (car args) nil buffer nil (cdr args)) 981 (apply #'process-file (car args) nil buffer nil (cdr args))
982 ;; Insert error messages if they were separated. 982 ;; Insert error messages if they were separated.
983 (when (listp buffer) 983 (when (listp buffer)
984 (with-current-buffer error-buffer 984 (with-current-buffer error-buffer
@@ -1014,25 +1014,25 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
1014 (sentinel (plist-get args :sentinel)) 1014 (sentinel (plist-get args :sentinel))
1015 (stderr (plist-get args :stderr))) 1015 (stderr (plist-get args :stderr)))
1016 (unless (stringp name) 1016 (unless (stringp name)
1017 (signal 'wrong-type-argument (list 'stringp name))) 1017 (signal 'wrong-type-argument (list #'stringp name)))
1018 (unless (or (null buffer) (bufferp buffer) (stringp buffer)) 1018 (unless (or (null buffer) (bufferp buffer) (stringp buffer))
1019 (signal 'wrong-type-argument (list 'stringp buffer))) 1019 (signal 'wrong-type-argument (list #'stringp buffer)))
1020 (unless (consp command) 1020 (unless (consp command)
1021 (signal 'wrong-type-argument (list 'consp command))) 1021 (signal 'wrong-type-argument (list #'consp command)))
1022 (unless (or (null coding) 1022 (unless (or (null coding)
1023 (and (symbolp coding) (memq coding coding-system-list)) 1023 (and (symbolp coding) (memq coding coding-system-list))
1024 (and (consp coding) 1024 (and (consp coding)
1025 (memq (car coding) coding-system-list) 1025 (memq (car coding) coding-system-list)
1026 (memq (cdr coding) coding-system-list))) 1026 (memq (cdr coding) coding-system-list)))
1027 (signal 'wrong-type-argument (list 'symbolp coding))) 1027 (signal 'wrong-type-argument (list #'symbolp coding)))
1028 (unless (or (null connection-type) (memq connection-type '(pipe pty))) 1028 (unless (or (null connection-type) (memq connection-type '(pipe pty)))
1029 (signal 'wrong-type-argument (list 'symbolp connection-type))) 1029 (signal 'wrong-type-argument (list #'symbolp connection-type)))
1030 (unless (or (null filter) (functionp filter)) 1030 (unless (or (null filter) (functionp filter))
1031 (signal 'wrong-type-argument (list 'functionp filter))) 1031 (signal 'wrong-type-argument (list #'functionp filter)))
1032 (unless (or (null sentinel) (functionp sentinel)) 1032 (unless (or (null sentinel) (functionp sentinel))
1033 (signal 'wrong-type-argument (list 'functionp sentinel))) 1033 (signal 'wrong-type-argument (list #'functionp sentinel)))
1034 (unless (or (null stderr) (bufferp stderr) (stringp stderr)) 1034 (unless (or (null stderr) (bufferp stderr) (stringp stderr))
1035 (signal 'wrong-type-argument (list 'stringp stderr))) 1035 (signal 'wrong-type-argument (list #'stringp stderr)))
1036 1036
1037 (let* ((buffer 1037 (let* ((buffer
1038 (if buffer 1038 (if buffer
@@ -1044,7 +1044,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
1044 (command 1044 (command
1045 (format "cd %s; %s" 1045 (format "cd %s; %s"
1046 (tramp-shell-quote-argument localname) 1046 (tramp-shell-quote-argument localname)
1047 (mapconcat 'tramp-shell-quote-argument 1047 (mapconcat #'tramp-shell-quote-argument
1048 (cons program args) " "))) 1048 (cons program args) " ")))
1049 (tramp-process-connection-type 1049 (tramp-process-connection-type
1050 (or (null program) tramp-process-connection-type)) 1050 (or (null program) tramp-process-connection-type))
@@ -1140,7 +1140,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1140 (with-tramp-connection-property (tramp-get-connection-process vec) "device" 1140 (with-tramp-connection-property (tramp-get-connection-process vec) "device"
1141 (let* ((host (tramp-file-name-host vec)) 1141 (let* ((host (tramp-file-name-host vec))
1142 (port (tramp-file-name-port-or-default vec)) 1142 (port (tramp-file-name-port-or-default vec))
1143 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) 1143 (devices (mapcar #'cadr (tramp-adb-parse-device-names nil))))
1144 (replace-regexp-in-string 1144 (replace-regexp-in-string
1145 tramp-prefix-port-format ":" 1145 tramp-prefix-port-format ":"
1146 (cond ((member host devices) host) 1146 (cond ((member host devices) host)
@@ -1177,7 +1177,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1177 (prog1 1177 (prog1
1178 (unless 1178 (unless
1179 (zerop 1179 (zerop
1180 (apply 'tramp-call-process vec tramp-adb-program nil t nil args)) 1180 (apply #'tramp-call-process vec tramp-adb-program nil t nil args))
1181 (buffer-string)) 1181 (buffer-string))
1182 (tramp-message vec 6 "%s" (buffer-string))))) 1182 (tramp-message vec 6 "%s" (buffer-string)))))
1183 1183
@@ -1232,7 +1232,7 @@ the exit status is not equal 0, and t otherwise."
1232 "Run COMMAND, check exit status, throw error if exit status not okay. 1232 "Run COMMAND, check exit status, throw error if exit status not okay.
1233FMT and ARGS are passed to `error'." 1233FMT and ARGS are passed to `error'."
1234 (unless (tramp-adb-send-command-and-check vec command) 1234 (unless (tramp-adb-send-command-and-check vec command)
1235 (apply 'tramp-error vec 'file-error fmt args))) 1235 (apply #'tramp-error vec 'file-error fmt args)))
1236 1236
1237(defun tramp-adb-wait-for-output (proc &optional timeout) 1237(defun tramp-adb-wait-for-output (proc &optional timeout)
1238 "Wait for output from remote command." 1238 "Wait for output from remote command."
@@ -1308,12 +1308,12 @@ connection if a previous connection has died for some reason."
1308 (list "shell"))) 1308 (list "shell")))
1309 (p (let ((default-directory 1309 (p (let ((default-directory
1310 (tramp-compat-temporary-file-directory))) 1310 (tramp-compat-temporary-file-directory)))
1311 (apply 'start-process (tramp-get-connection-name vec) buf 1311 (apply #'start-process (tramp-get-connection-name vec) buf
1312 tramp-adb-program args))) 1312 tramp-adb-program args)))
1313 (prompt (md5 (concat (prin1-to-string process-environment) 1313 (prompt (md5 (concat (prin1-to-string process-environment)
1314 (current-time-string))))) 1314 (current-time-string)))))
1315 (tramp-message 1315 (tramp-message
1316 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 1316 vec 6 "%s" (mapconcat #'identity (process-command p) " "))
1317 ;; Wait for initial prompt. On some devices, it needs an 1317 ;; Wait for initial prompt. On some devices, it needs an
1318 ;; initial RET, in order to get it. 1318 ;; initial RET, in order to get it.
1319 (sleep-for 0.1) 1319 (sleep-for 0.1)
@@ -1322,7 +1322,7 @@ connection if a previous connection has died for some reason."
1322 (unless (process-live-p p) 1322 (unless (process-live-p p)
1323 (tramp-error vec 'file-error "Terminated!")) 1323 (tramp-error vec 'file-error "Terminated!"))
1324 (process-put p 'vector vec) 1324 (process-put p 'vector vec)
1325 (process-put p 'adjust-window-size-function 'ignore) 1325 (process-put p 'adjust-window-size-function #'ignore)
1326 (set-process-query-on-exit-flag p nil) 1326 (set-process-query-on-exit-flag p nil)
1327 1327
1328 ;; Change prompt. 1328 ;; Change prompt.
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index dcddb0ec67d..9e131b1a47d 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -201,8 +201,8 @@ It must be supported by libarchive(3).")
201(defconst tramp-archive-all-gvfs-methods 201(defconst tramp-archive-all-gvfs-methods
202 (cons tramp-archive-method 202 (cons tramp-archive-method
203 (let ((values (cdr (cadr (get 'tramp-gvfs-methods 'custom-type))))) 203 (let ((values (cdr (cadr (get 'tramp-gvfs-methods 'custom-type)))))
204 (setq values (mapcar 'last values) 204 (setq values (mapcar #'last values)
205 values (mapcar 'car values)))) 205 values (mapcar #'car values))))
206 "List of all methods `tramp-gvfs-methods' offers.") 206 "List of all methods `tramp-gvfs-methods' offers.")
207 207
208 208
@@ -287,8 +287,9 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
287 287
288(defsubst tramp-archive-file-name-for-operation (operation &rest args) 288(defsubst tramp-archive-file-name-for-operation (operation &rest args)
289 "Like `tramp-file-name-for-operation', but for archive file name syntax." 289 "Like `tramp-file-name-for-operation', but for archive file name syntax."
290 (cl-letf (((symbol-function 'tramp-tramp-file-p) 'tramp-archive-file-name-p)) 290 (cl-letf (((symbol-function #'tramp-tramp-file-p)
291 (apply 'tramp-file-name-for-operation operation args))) 291 #'tramp-archive-file-name-p))
292 (apply #'tramp-file-name-for-operation operation args)))
292 293
293(defun tramp-archive-run-real-handler (operation args) 294(defun tramp-archive-run-real-handler (operation args)
294 "Invoke normal file name handler for OPERATION. 295 "Invoke normal file name handler for OPERATION.
@@ -313,14 +314,14 @@ pass to the OPERATION."
313 (tramp-register-file-name-handlers) 314 (tramp-register-file-name-handlers)
314 (tramp-archive-run-real-handler operation args)) 315 (tramp-archive-run-real-handler operation args))
315 316
316 (let* ((filename (apply 'tramp-archive-file-name-for-operation 317 (let* ((filename (apply #'tramp-archive-file-name-for-operation
317 operation args)) 318 operation args))
318 (archive (tramp-archive-file-name-archive filename))) 319 (archive (tramp-archive-file-name-archive filename)))
319 320
320 ;; The file archive could be a directory, see Bug#30293. 321 ;; The file archive could be a directory, see Bug#30293.
321 (if (and archive 322 (if (and archive
322 (tramp-archive-run-real-handler 323 (tramp-archive-run-real-handler
323 'file-directory-p (list archive))) 324 #'file-directory-p (list archive)))
324 (tramp-archive-run-real-handler operation args) 325 (tramp-archive-run-real-handler operation args)
325 ;; Now run the handler. 326 ;; Now run the handler.
326 (let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods)) 327 (let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods))
@@ -329,7 +330,7 @@ pass to the OPERATION."
329 (tramp-unknown-id-integer (user-uid)) 330 (tramp-unknown-id-integer (user-uid))
330 (tramp-unknown-id-string (user-login-name)) 331 (tramp-unknown-id-string (user-login-name))
331 (fn (assoc operation tramp-archive-file-name-handler-alist))) 332 (fn (assoc operation tramp-archive-file-name-handler-alist)))
332 (when (eq (cdr fn) 'tramp-archive-handle-not-implemented) 333 (when (eq (cdr fn) #'tramp-archive-handle-not-implemented)
333 (setq args (cons operation args))) 334 (setq args (cons operation args)))
334 (if fn 335 (if fn
335 (save-match-data (apply (cdr fn) args)) 336 (save-match-data (apply (cdr fn) args))
@@ -337,7 +338,7 @@ pass to the OPERATION."
337 338
338;;;###autoload 339;;;###autoload
339(defalias 340(defalias
340 'tramp-archive-autoload-file-name-handler 'tramp-autoload-file-name-handler) 341 'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler)
341 342
342;;;###autoload 343;;;###autoload
343(progn (defun tramp-register-archive-file-name-handler () 344(progn (defun tramp-register-archive-file-name-handler ()
@@ -345,17 +346,17 @@ pass to the OPERATION."
345 (when tramp-archive-enabled 346 (when tramp-archive-enabled
346 (add-to-list 'file-name-handler-alist 347 (add-to-list 'file-name-handler-alist
347 (cons (tramp-archive-autoload-file-name-regexp) 348 (cons (tramp-archive-autoload-file-name-regexp)
348 'tramp-archive-autoload-file-name-handler)) 349 #'tramp-archive-autoload-file-name-handler))
349 (put 'tramp-archive-autoload-file-name-handler 'safe-magic t)))) 350 (put 'tramp-archive-autoload-file-name-handler 'safe-magic t))))
350 351
351;;;###autoload 352;;;###autoload
352(progn 353(progn
353 (add-hook 'after-init-hook 'tramp-register-archive-file-name-handler) 354 (add-hook 'after-init-hook #'tramp-register-archive-file-name-handler)
354 (add-hook 355 (add-hook
355 'tramp-archive-unload-hook 356 'tramp-archive-unload-hook
356 (lambda () 357 (lambda ()
357 (remove-hook 358 (remove-hook
358 'after-init-hook 'tramp-register-archive-file-name-handler)))) 359 'after-init-hook #'tramp-register-archive-file-name-handler))))
359 360
360;; In older Emacsen (prior 27.1), the autoload above does not exist. 361;; In older Emacsen (prior 27.1), the autoload above does not exist.
361;; So we call it again; it doesn't hurt. 362;; So we call it again; it doesn't hurt.
@@ -363,19 +364,19 @@ pass to the OPERATION."
363 364
364;; Mark `operations' the handler is responsible for. 365;; Mark `operations' the handler is responsible for.
365(put 'tramp-archive-file-name-handler 'operations 366(put 'tramp-archive-file-name-handler 'operations
366 (mapcar 'car tramp-archive-file-name-handler-alist)) 367 (mapcar #'car tramp-archive-file-name-handler-alist))
367 368
368;; `tramp-archive-file-name-handler' must be placed before `url-file-handler'. 369;; `tramp-archive-file-name-handler' must be placed before `url-file-handler'.
369(when url-handler-mode (tramp-register-file-name-handlers)) 370(when url-handler-mode (tramp-register-file-name-handlers))
370 371
371(eval-after-load 'url-handler 372(eval-after-load 'url-handler
372 '(progn 373 '(progn
373 (add-hook 'url-handler-mode-hook 'tramp-register-file-name-handlers) 374 (add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers)
374 (add-hook 375 (add-hook
375 'tramp-archive-unload-hook 376 'tramp-archive-unload-hook
376 (lambda () 377 (lambda ()
377 (remove-hook 378 (remove-hook
378 'url-handler-mode-hook 'tramp-register-file-name-handlers))))) 379 'url-handler-mode-hook #'tramp-register-file-name-handlers)))))
379 380
380 381
381;; File name conversions. 382;; File name conversions.
@@ -455,9 +456,9 @@ name is kept in slot `hop'"
455 456
456 ;; Anything else. Here we call `file-local-copy', which we 457 ;; Anything else. Here we call `file-local-copy', which we
457 ;; have avoided so far. 458 ;; have avoided so far.
458 (t (let* ((inhibit-file-name-operation 'file-local-copy) 459 (t (let* ((inhibit-file-name-operation #'file-local-copy)
459 (inhibit-file-name-handlers 460 (inhibit-file-name-handlers
460 (cons 'jka-compr-handler inhibit-file-name-handlers)) 461 (cons #'jka-compr-handler inhibit-file-name-handlers))
461 (copy (file-local-copy archive))) 462 (copy (file-local-copy archive)))
462 (setf (tramp-file-name-host vec) (tramp-archive-gvfs-host copy)) 463 (setf (tramp-file-name-host vec) (tramp-archive-gvfs-host copy))
463 (puthash archive (cons vec copy) tramp-archive-hash)))) 464 (puthash archive (cons vec copy) tramp-archive-hash))))
@@ -481,14 +482,14 @@ name is kept in slot `hop'"
481 tramp-archive-hash) 482 tramp-archive-hash)
482 (clrhash tramp-archive-hash)) 483 (clrhash tramp-archive-hash))
483 484
484(add-hook 'tramp-cleanup-all-connections-hook 'tramp-archive-cleanup-hash) 485(add-hook 'tramp-cleanup-all-connections-hook #'tramp-archive-cleanup-hash)
485(add-hook 'kill-emacs-hook 'tramp-archive-cleanup-hash) 486(add-hook 'kill-emacs-hook #'tramp-archive-cleanup-hash)
486(add-hook 'tramp-archive-unload-hook 487(add-hook 'tramp-archive-unload-hook
487 (lambda () 488 (lambda ()
488 (remove-hook 'tramp-cleanup-all-connections-hook 489 (remove-hook 'tramp-cleanup-all-connections-hook
489 'tramp-archive-cleanup-hash) 490 #'tramp-archive-cleanup-hash)
490 (remove-hook 'kill-emacs-hook 491 (remove-hook 'kill-emacs-hook
491 'tramp-archive-cleanup-hash))) 492 #'tramp-archive-cleanup-hash)))
492 493
493(defsubst tramp-file-name-archive (vec) 494(defsubst tramp-file-name-archive (vec)
494 "Extract the archive file name from VEC. 495 "Extract the archive file name from VEC.
@@ -638,7 +639,7 @@ offered."
638 "Generic handler for operations not implemented for file archives." 639 "Generic handler for operations not implemented for file archives."
639 (let ((v (ignore-errors 640 (let ((v (ignore-errors
640 (tramp-archive-dissect-file-name 641 (tramp-archive-dissect-file-name
641 (apply 'tramp-archive-file-name-for-operation operation args))))) 642 (apply #'tramp-archive-file-name-for-operation operation args)))))
642 (tramp-message v 10 "%s" (cons operation args)) 643 (tramp-message v 10 "%s" (cons operation args))
643 (tramp-error 644 (tramp-error
644 v 'file-error 645 v 'file-error
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 0fb9bea14bc..3d3b14e7371 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -69,7 +69,7 @@
69;;; -- Cache -- 69;;; -- Cache --
70 70
71;;;###tramp-autoload 71;;;###tramp-autoload
72(defvar tramp-cache-data (make-hash-table :test 'equal) 72(defvar tramp-cache-data (make-hash-table :test #'equal)
73 "Hash table for remote files properties.") 73 "Hash table for remote files properties.")
74 74
75;;;###tramp-autoload 75;;;###tramp-autoload
@@ -101,7 +101,7 @@ If it doesn't exist yet, it is created and initialized with
101matching entries of `tramp-connection-properties'." 101matching entries of `tramp-connection-properties'."
102 (or (gethash key tramp-cache-data) 102 (or (gethash key tramp-cache-data)
103 (let ((hash 103 (let ((hash
104 (puthash key (make-hash-table :test 'equal) tramp-cache-data))) 104 (puthash key (make-hash-table :test #'equal) tramp-cache-data)))
105 (when (tramp-file-name-p key) 105 (when (tramp-file-name-p key)
106 (dolist (elt tramp-connection-properties) 106 (dolist (elt tramp-connection-properties)
107 (when (string-match-p 107 (when (string-match-p
@@ -118,7 +118,7 @@ Returns DEFAULT if not set."
118 (setq file (tramp-compat-file-name-unquote file) 118 (setq file (tramp-compat-file-name-unquote file)
119 key (copy-tramp-file-name key)) 119 key (copy-tramp-file-name key))
120 (setf (tramp-file-name-localname key) 120 (setf (tramp-file-name-localname key)
121 (tramp-run-real-handler 'directory-file-name (list file)) 121 (tramp-run-real-handler #'directory-file-name (list file))
122 (tramp-file-name-hop key) nil) 122 (tramp-file-name-hop key) nil)
123 (let* ((hash (tramp-get-hash-table key)) 123 (let* ((hash (tramp-get-hash-table key))
124 (value (when (hash-table-p hash) (gethash property hash)))) 124 (value (when (hash-table-p hash) (gethash property hash))))
@@ -161,7 +161,7 @@ Returns VALUE."
161 (setq file (tramp-compat-file-name-unquote file) 161 (setq file (tramp-compat-file-name-unquote file)
162 key (copy-tramp-file-name key)) 162 key (copy-tramp-file-name key))
163 (setf (tramp-file-name-localname key) 163 (setf (tramp-file-name-localname key)
164 (tramp-run-real-handler 'directory-file-name (list file)) 164 (tramp-run-real-handler #'directory-file-name (list file))
165 (tramp-file-name-hop key) nil) 165 (tramp-file-name-hop key) nil)
166 (let ((hash (tramp-get-hash-table key))) 166 (let ((hash (tramp-get-hash-table key)))
167 ;; We put the timestamp there. 167 ;; We put the timestamp there.
@@ -184,7 +184,7 @@ Returns VALUE."
184 (setq file (tramp-compat-file-name-unquote file) 184 (setq file (tramp-compat-file-name-unquote file)
185 key (copy-tramp-file-name key)) 185 key (copy-tramp-file-name key))
186 (setf (tramp-file-name-localname key) 186 (setf (tramp-file-name-localname key)
187 (tramp-run-real-handler 'directory-file-name (list file)) 187 (tramp-run-real-handler #'directory-file-name (list file))
188 (tramp-file-name-hop key) nil) 188 (tramp-file-name-hop key) nil)
189 (remhash property (tramp-get-hash-table key)) 189 (remhash property (tramp-get-hash-table key))
190 (tramp-message key 8 "%s %s" file property) 190 (tramp-message key 8 "%s %s" file property)
@@ -196,7 +196,7 @@ Returns VALUE."
196(defun tramp-flush-file-properties (key file) 196(defun tramp-flush-file-properties (key file)
197 "Remove all properties of FILE in the cache context of KEY." 197 "Remove all properties of FILE in the cache context of KEY."
198 (let* ((file (tramp-run-real-handler 198 (let* ((file (tramp-run-real-handler
199 'directory-file-name (list file))) 199 #'directory-file-name (list file)))
200 (truename (tramp-get-file-property key file "file-truename" nil))) 200 (truename (tramp-get-file-property key file "file-truename" nil)))
201 ;; Unify localname. Remove hop from `tramp-file-name' structure. 201 ;; Unify localname. Remove hop from `tramp-file-name' structure.
202 (setq file (tramp-compat-file-name-unquote file) 202 (setq file (tramp-compat-file-name-unquote file)
@@ -216,7 +216,7 @@ Returns VALUE."
216Remove also properties of all files in subdirectories." 216Remove also properties of all files in subdirectories."
217 (setq directory (tramp-compat-file-name-unquote directory)) 217 (setq directory (tramp-compat-file-name-unquote directory))
218 (let* ((directory (tramp-run-real-handler 218 (let* ((directory (tramp-run-real-handler
219 'directory-file-name (list directory))) 219 #'directory-file-name (list directory)))
220 (truename (tramp-get-file-property key directory "file-truename" nil))) 220 (truename (tramp-get-file-property key directory "file-truename" nil)))
221 (tramp-message key 8 "%s" directory) 221 (tramp-message key 8 "%s" directory)
222 (maphash 222 (maphash
@@ -369,7 +369,7 @@ used to cache connection properties of the local machine."
369 (when (tramp-file-name-p key) 369 (when (tramp-file-name-p key)
370 ;; (dolist 370 ;; (dolist
371 ;; (slot 371 ;; (slot
372 ;; (mapcar 'car (cdr (cl-struct-slot-info 'tramp-file-name)))) 372 ;; (mapcar #'car (cdr (cl-struct-slot-info 'tramp-file-name))))
373 ;; (when (stringp (cl-struct-slot-value 'tramp-file-name slot key)) 373 ;; (when (stringp (cl-struct-slot-value 'tramp-file-name slot key))
374 ;; (setf (cl-struct-slot-value 'tramp-file-name slot key) 374 ;; (setf (cl-struct-slot-value 'tramp-file-name slot key)
375 ;; (substring-no-properties 375 ;; (substring-no-properties
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index cf4f7417475..f1e1d8271ff 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -55,9 +55,9 @@ SYNTAX can be one of the symbols `default' (default),
55 "Return a list of all Tramp connection buffers." 55 "Return a list of all Tramp connection buffers."
56 (append 56 (append
57 (all-completions 57 (all-completions
58 "*tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list)))) 58 "*tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list))))
59 (all-completions 59 (all-completions
60 "*debug tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list)))))) 60 "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list))))))
61 61
62(defun tramp-list-remote-buffers () 62(defun tramp-list-remote-buffers ()
63 "Return a list of all buffers with remote default-directory." 63 "Return a list of all buffers with remote default-directory."
@@ -85,7 +85,7 @@ When called interactively, a Tramp connection has to be selected."
85 ;; Return nil when there is no Tramp connection. 85 ;; Return nil when there is no Tramp connection.
86 (list 86 (list
87 (let ((connections 87 (let ((connections
88 (mapcar 'tramp-make-tramp-file-name (tramp-list-connections))) 88 (mapcar #'tramp-make-tramp-file-name (tramp-list-connections)))
89 name) 89 name)
90 90
91 (when connections 91 (when connections
@@ -216,7 +216,7 @@ This includes password cache, file cache, connection cache, buffers."
216 (lambda (x) 216 (lambda (x)
217 (and x (boundp x) (cons x 'tramp-reporter-dump-variable))) 217 (and x (boundp x) (cons x 'tramp-reporter-dump-variable)))
218 (append 218 (append
219 (mapcar 'intern (all-completions "tramp-" obarray 'boundp)) 219 (mapcar #'intern (all-completions "tramp-" obarray #'boundp))
220 ;; Non-tramp variables of interest. 220 ;; Non-tramp variables of interest.
221 '(shell-prompt-pattern 221 '(shell-prompt-pattern
222 backup-by-copying 222 backup-by-copying
@@ -330,11 +330,11 @@ buffer in your bug report.
330 (sort 330 (sort
331 (append 331 (append
332 (mapcar 332 (mapcar
333 'intern 333 #'intern
334 (all-completions "tramp-" (buffer-local-variables buffer))) 334 (all-completions "tramp-" (buffer-local-variables buffer)))
335 ;; Non-tramp variables of interest. 335 ;; Non-tramp variables of interest.
336 '(connection-local-variables-alist default-directory)) 336 '(connection-local-variables-alist default-directory))
337 'string<)) 337 #'string<))
338 (reporter-dump-variable varsym elbuf)) 338 (reporter-dump-variable varsym elbuf))
339 (lisp-indent-line) 339 (lisp-indent-line)
340 (insert ")\n")) 340 (insert ")\n"))
@@ -412,7 +412,7 @@ please ensure that the buffers are attached to your email.\n\n"))
412 (kill-buffer nil) 412 (kill-buffer nil)
413 (throw 'dont-send nil)))))) 413 (throw 'dont-send nil))))))
414 414
415(defalias 'tramp-submit-bug 'tramp-bug) 415(defalias 'tramp-submit-bug #'tramp-bug)
416 416
417(add-hook 'tramp-unload-hook 417(add-hook 'tramp-unload-hook
418 (lambda () (unload-feature 'tramp-cmds 'force))) 418 (lambda () (unload-feature 'tramp-cmds 'force)))
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 0fa9ae89fd9..e3d03435691 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -73,7 +73,7 @@ Add the extension of F, if existing."
73;; `temporary-file-directory' as function is introduced with Emacs 26.1. 73;; `temporary-file-directory' as function is introduced with Emacs 26.1.
74(defalias 'tramp-compat-temporary-file-directory-function 74(defalias 'tramp-compat-temporary-file-directory-function
75 (if (fboundp 'temporary-file-directory) 75 (if (fboundp 'temporary-file-directory)
76 'temporary-file-directory 76 #'temporary-file-directory
77 'tramp-handle-temporary-file-directory)) 77 'tramp-handle-temporary-file-directory))
78 78
79(defun tramp-compat-process-running-p (process-name) 79(defun tramp-compat-process-running-p (process-name)
@@ -102,12 +102,12 @@ Add the extension of F, if existing."
102 102
103;; `default-toplevel-value' has been declared in Emacs 24.4. 103;; `default-toplevel-value' has been declared in Emacs 24.4.
104(unless (fboundp 'default-toplevel-value) 104(unless (fboundp 'default-toplevel-value)
105 (defalias 'default-toplevel-value 'symbol-value)) 105 (defalias 'default-toplevel-value #'symbol-value))
106 106
107;; `file-attribute-*' are introduced in Emacs 25.1. 107;; `file-attribute-*' are introduced in Emacs 25.1.
108 108
109(if (fboundp 'file-attribute-type) 109(if (fboundp 'file-attribute-type)
110 (defalias 'tramp-compat-file-attribute-type 'file-attribute-type) 110 (defalias 'tramp-compat-file-attribute-type #'file-attribute-type)
111 (defsubst tramp-compat-file-attribute-type (attributes) 111 (defsubst tramp-compat-file-attribute-type (attributes)
112 "The type field in ATTRIBUTES returned by `file-attributes'. 112 "The type field in ATTRIBUTES returned by `file-attributes'.
113The value is either t for directory, string (name linked to) for 113The value is either t for directory, string (name linked to) for
@@ -116,13 +116,13 @@ symbolic link, or nil."
116 116
117(if (fboundp 'file-attribute-link-number) 117(if (fboundp 'file-attribute-link-number)
118 (defalias 'tramp-compat-file-attribute-link-number 118 (defalias 'tramp-compat-file-attribute-link-number
119 'file-attribute-link-number) 119 #'file-attribute-link-number)
120 (defsubst tramp-compat-file-attribute-link-number (attributes) 120 (defsubst tramp-compat-file-attribute-link-number (attributes)
121 "Return the number of links in ATTRIBUTES returned by `file-attributes'." 121 "Return the number of links in ATTRIBUTES returned by `file-attributes'."
122 (nth 1 attributes))) 122 (nth 1 attributes)))
123 123
124(if (fboundp 'file-attribute-user-id) 124(if (fboundp 'file-attribute-user-id)
125 (defalias 'tramp-compat-file-attribute-user-id 'file-attribute-user-id) 125 (defalias 'tramp-compat-file-attribute-user-id #'file-attribute-user-id)
126 (defsubst tramp-compat-file-attribute-user-id (attributes) 126 (defsubst tramp-compat-file-attribute-user-id (attributes)
127 "The UID field in ATTRIBUTES returned by `file-attributes'. 127 "The UID field in ATTRIBUTES returned by `file-attributes'.
128This is either a string or a number. If a string value cannot be 128This is either a string or a number. If a string value cannot be
@@ -131,7 +131,7 @@ returned."
131 (nth 2 attributes))) 131 (nth 2 attributes)))
132 132
133(if (fboundp 'file-attribute-group-id) 133(if (fboundp 'file-attribute-group-id)
134 (defalias 'tramp-compat-file-attribute-group-id 'file-attribute-group-id) 134 (defalias 'tramp-compat-file-attribute-group-id #'file-attribute-group-id)
135 (defsubst tramp-compat-file-attribute-group-id (attributes) 135 (defsubst tramp-compat-file-attribute-group-id (attributes)
136 "The GID field in ATTRIBUTES returned by `file-attributes'. 136 "The GID field in ATTRIBUTES returned by `file-attributes'.
137This is either a string or a number. If a string value cannot be 137This is either a string or a number. If a string value cannot be
@@ -141,7 +141,7 @@ returned."
141 141
142(if (fboundp 'file-attribute-modification-time) 142(if (fboundp 'file-attribute-modification-time)
143 (defalias 'tramp-compat-file-attribute-modification-time 143 (defalias 'tramp-compat-file-attribute-modification-time
144 'file-attribute-modification-time) 144 #'file-attribute-modification-time)
145 (defsubst tramp-compat-file-attribute-modification-time (attributes) 145 (defsubst tramp-compat-file-attribute-modification-time (attributes)
146 "The modification time in ATTRIBUTES returned by `file-attributes'. 146 "The modification time in ATTRIBUTES returned by `file-attributes'.
147This is the time of the last change to the file's contents, and 147This is the time of the last change to the file's contents, and
@@ -149,7 +149,7 @@ is a Lisp timestamp in the style of `current-time'."
149 (nth 5 attributes))) 149 (nth 5 attributes)))
150 150
151(if (fboundp 'file-attribute-size) 151(if (fboundp 'file-attribute-size)
152 (defalias 'tramp-compat-file-attribute-size 'file-attribute-size) 152 (defalias 'tramp-compat-file-attribute-size #'file-attribute-size)
153 (defsubst tramp-compat-file-attribute-size (attributes) 153 (defsubst tramp-compat-file-attribute-size (attributes)
154 "The size (in bytes) in ATTRIBUTES returned by `file-attributes'. 154 "The size (in bytes) in ATTRIBUTES returned by `file-attributes'.
155If the size is too large for a fixnum, this is a bignum in Emacs 27 155If the size is too large for a fixnum, this is a bignum in Emacs 27
@@ -157,7 +157,7 @@ and later, and is a float in Emacs 26 and earlier."
157 (nth 7 attributes))) 157 (nth 7 attributes)))
158 158
159(if (fboundp 'file-attribute-modes) 159(if (fboundp 'file-attribute-modes)
160 (defalias 'tramp-compat-file-attribute-modes 'file-attribute-modes) 160 (defalias 'tramp-compat-file-attribute-modes #'file-attribute-modes)
161 (defsubst tramp-compat-file-attribute-modes (attributes) 161 (defsubst tramp-compat-file-attribute-modes (attributes)
162 "The file modes in ATTRIBUTES returned by `file-attributes'. 162 "The file modes in ATTRIBUTES returned by `file-attributes'.
163This is a string of ten letters or dashes as in ls -l." 163This is a string of ten letters or dashes as in ls -l."
@@ -165,11 +165,11 @@ This is a string of ten letters or dashes as in ls -l."
165 165
166;; `format-message' is new in Emacs 25.1. 166;; `format-message' is new in Emacs 25.1.
167(unless (fboundp 'format-message) 167(unless (fboundp 'format-message)
168 (defalias 'format-message 'format)) 168 (defalias 'format-message #'format))
169 169
170;; `directory-name-p' is new in Emacs 25.1. 170;; `directory-name-p' is new in Emacs 25.1.
171(if (fboundp 'directory-name-p) 171(if (fboundp 'directory-name-p)
172 (defalias 'tramp-compat-directory-name-p 'directory-name-p) 172 (defalias 'tramp-compat-directory-name-p #'directory-name-p)
173 (defsubst tramp-compat-directory-name-p (name) 173 (defsubst tramp-compat-directory-name-p (name)
174 "Return non-nil if NAME ends with a directory separator character." 174 "Return non-nil if NAME ends with a directory separator character."
175 (let ((len (length name)) 175 (let ((len (length name))
@@ -189,7 +189,7 @@ This is a string of ten letters or dashes as in ls -l."
189;; `file-name-unquote' are introduced in Emacs 26. 189;; `file-name-unquote' are introduced in Emacs 26.
190(eval-and-compile 190(eval-and-compile
191 (if (fboundp 'file-local-name) 191 (if (fboundp 'file-local-name)
192 (defalias 'tramp-compat-file-local-name 'file-local-name) 192 (defalias 'tramp-compat-file-local-name #'file-local-name)
193 (defsubst tramp-compat-file-local-name (name) 193 (defsubst tramp-compat-file-local-name (name)
194 "Return the local name component of NAME. 194 "Return the local name component of NAME.
195It returns a file name which can be used directly as argument of 195It returns a file name which can be used directly as argument of
@@ -197,14 +197,14 @@ It returns a file name which can be used directly as argument of
197 (or (file-remote-p name 'localname) name))) 197 (or (file-remote-p name 'localname) name)))
198 198
199 (if (fboundp 'file-name-quoted-p) 199 (if (fboundp 'file-name-quoted-p)
200 (defalias 'tramp-compat-file-name-quoted-p 'file-name-quoted-p) 200 (defalias 'tramp-compat-file-name-quoted-p #'file-name-quoted-p)
201 (defsubst tramp-compat-file-name-quoted-p (name) 201 (defsubst tramp-compat-file-name-quoted-p (name)
202 "Whether NAME is quoted with prefix \"/:\". 202 "Whether NAME is quoted with prefix \"/:\".
203If NAME is a remote file name, check the local part of NAME." 203If NAME is a remote file name, check the local part of NAME."
204 (string-prefix-p "/:" (tramp-compat-file-local-name name)))) 204 (string-prefix-p "/:" (tramp-compat-file-local-name name))))
205 205
206 (if (fboundp 'file-name-quote) 206 (if (fboundp 'file-name-quote)
207 (defalias 'tramp-compat-file-name-quote 'file-name-quote) 207 (defalias 'tramp-compat-file-name-quote #'file-name-quote)
208 (defsubst tramp-compat-file-name-quote (name) 208 (defsubst tramp-compat-file-name-quote (name)
209 "Add the quotation prefix \"/:\" to file NAME. 209 "Add the quotation prefix \"/:\" to file NAME.
210If NAME is a remote file name, the local part of NAME is quoted." 210If NAME is a remote file name, the local part of NAME is quoted."
@@ -214,7 +214,7 @@ If NAME is a remote file name, the local part of NAME is quoted."
214 (file-remote-p name) "/:" (tramp-compat-file-local-name name))))) 214 (file-remote-p name) "/:" (tramp-compat-file-local-name name)))))
215 215
216 (if (fboundp 'file-name-unquote) 216 (if (fboundp 'file-name-unquote)
217 (defalias 'tramp-compat-file-name-unquote 'file-name-unquote) 217 (defalias 'tramp-compat-file-name-unquote #'file-name-unquote)
218 (defsubst tramp-compat-file-name-unquote (name) 218 (defsubst tramp-compat-file-name-unquote (name)
219 "Remove quotation prefix \"/:\" from file NAME. 219 "Remove quotation prefix \"/:\" from file NAME.
220If NAME is a remote file name, the local part of NAME is unquoted." 220If NAME is a remote file name, the local part of NAME is unquoted."
@@ -236,8 +236,8 @@ If NAME is a remote file name, the local part of NAME is unquoted."
236;; `cl-struct-slot-info' has been introduced with Emacs 25. 236;; `cl-struct-slot-info' has been introduced with Emacs 25.
237(defmacro tramp-compat-tramp-file-name-slots () 237(defmacro tramp-compat-tramp-file-name-slots ()
238 (if (fboundp 'cl-struct-slot-info) 238 (if (fboundp 'cl-struct-slot-info)
239 '(cdr (mapcar 'car (cl-struct-slot-info 'tramp-file-name))) 239 '(cdr (mapcar #'car (cl-struct-slot-info 'tramp-file-name)))
240 '(cdr (mapcar 'car (get 'tramp-file-name 'cl-struct-slots))))) 240 '(cdr (mapcar #'car (get 'tramp-file-name 'cl-struct-slots)))))
241 241
242;; The signature of `tramp-make-tramp-file-name' has been changed. 242;; The signature of `tramp-make-tramp-file-name' has been changed.
243;; Therefore, we cannot us `url-tramp-convert-url-to-tramp' prior 243;; Therefore, we cannot us `url-tramp-convert-url-to-tramp' prior
@@ -248,7 +248,7 @@ If NAME is a remote file name, the local part of NAME is unquoted."
248;; `exec-path' is new in Emacs 27.1. 248;; `exec-path' is new in Emacs 27.1.
249(eval-and-compile 249(eval-and-compile
250 (if (fboundp 'exec-path) 250 (if (fboundp 'exec-path)
251 (defalias 'tramp-compat-exec-path 'exec-path) 251 (defalias 'tramp-compat-exec-path #'exec-path)
252 (defun tramp-compat-exec-path () 252 (defun tramp-compat-exec-path ()
253 "List of directories to search programs to run in remote subprocesses." 253 "List of directories to search programs to run in remote subprocesses."
254 (let ((handler (find-file-name-handler default-directory 'exec-path))) 254 (let ((handler (find-file-name-handler default-directory 'exec-path)))
@@ -258,7 +258,7 @@ If NAME is a remote file name, the local part of NAME is unquoted."
258 258
259;; `time-equal-p' has appeared in Emacs 27.1. 259;; `time-equal-p' has appeared in Emacs 27.1.
260(if (fboundp 'time-equal-p) 260(if (fboundp 'time-equal-p)
261 (defalias 'tramp-compat-time-equal-p 'time-equal-p) 261 (defalias 'tramp-compat-time-equal-p #'time-equal-p)
262 (defsubst tramp-compat-time-equal-p (t1 t2) 262 (defsubst tramp-compat-time-equal-p (t1 t2)
263 "Return non-nil if time value T1 is equal to time value T2. 263 "Return non-nil if time value T1 is equal to time value T2.
264A nil value for either argument stands for the current time." 264A nil value for either argument stands for the current time."
@@ -266,7 +266,7 @@ A nil value for either argument stands for the current time."
266 266
267;; `flatten-tree' has appeared in Emacs 27.1. 267;; `flatten-tree' has appeared in Emacs 27.1.
268(if (fboundp 'flatten-tree) 268(if (fboundp 'flatten-tree)
269 (defalias 'tramp-compat-flatten-tree 'flatten-tree) 269 (defalias 'tramp-compat-flatten-tree #'flatten-tree)
270 (defun tramp-compat-flatten-tree (tree) 270 (defun tramp-compat-flatten-tree (tree)
271 "Take TREE and \"flatten\" it." 271 "Take TREE and \"flatten\" it."
272 (let (elems) 272 (let (elems)
@@ -288,7 +288,7 @@ A nil value for either argument stands for the current time."
288 288
289;;; TODO: 289;;; TODO:
290 290
291;; * When we get rid of Emacs 24, replace "(mapconcat 'identity" by 291;; * When we get rid of Emacs 24, replace "(mapconcat #'identity" by
292;; "(string-join". 292;; "(string-join".
293 293
294;;; tramp-compat.el ends here 294;;; tramp-compat.el ends here
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 8735d13f9dd..d1aae22a484 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -85,7 +85,7 @@ present for backward compatibility."
85 ange-ftp-completion-hook-function) 85 ange-ftp-completion-hook-function)
86 file-name-handler-alist))))) 86 file-name-handler-alist)))))
87 87
88(add-hook 'tramp-ftp-unload-hook 'tramp-ftp-enable-ange-ftp) 88(add-hook 'tramp-ftp-unload-hook #'tramp-ftp-enable-ange-ftp)
89 89
90;; Define FTP method ... 90;; Define FTP method ...
91;;;###tramp-autoload 91;;;###tramp-autoload
@@ -138,7 +138,7 @@ pass to the OPERATION."
138 ;; because this returns another user but the one declared in 138 ;; because this returns another user but the one declared in
139 ;; "~/.netrc". 139 ;; "~/.netrc".
140 ((memq operation '(file-directory-p file-exists-p)) 140 ((memq operation '(file-directory-p file-exists-p))
141 (if (apply 'ange-ftp-hook-function operation args) 141 (if (apply #'ange-ftp-hook-function operation args)
142 (let ((v (tramp-dissect-file-name (car args) t))) 142 (let ((v (tramp-dissect-file-name (car args) t)))
143 (setf (tramp-file-name-method v) tramp-ftp-method) 143 (setf (tramp-file-name-method v) tramp-ftp-method)
144 (tramp-set-connection-property v "started" t)) 144 (tramp-set-connection-property v "started" t))
@@ -172,7 +172,7 @@ pass to the OPERATION."
172 (and (eq inhibit-file-name-operation operation) 172 (and (eq inhibit-file-name-operation operation)
173 inhibit-file-name-handlers))) 173 inhibit-file-name-handlers)))
174 (inhibit-file-name-operation operation)) 174 (inhibit-file-name-operation operation))
175 (apply 'ange-ftp-hook-function operation args))))))) 175 (apply #'ange-ftp-hook-function operation args)))))))
176 176
177;; It must be a `defsubst' in order to push the whole code into 177;; It must be a `defsubst' in order to push the whole code into
178;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. 178;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index ccbb522184d..569fdb55615 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -68,7 +68,7 @@
68;; (message 68;; (message
69;; "%s" 69;; "%s"
70;; (mapcar 70;; (mapcar
71;; 'car 71;; #'car
72;; (dbus-call-method 72;; (dbus-call-method
73;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker 73;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
74;; tramp-gvfs-interface-mounttracker "ListMountableInfo"))) 74;; tramp-gvfs-interface-mounttracker "ListMountableInfo")))
@@ -657,7 +657,7 @@ Return nil for null BYTE-ARRAY."
657 (cons (tramp-gvfs-stringify-dbus-message (car message)) 657 (cons (tramp-gvfs-stringify-dbus-message (car message))
658 (tramp-gvfs-stringify-dbus-message (cdr message)))) 658 (tramp-gvfs-stringify-dbus-message (cdr message))))
659 ((consp message) 659 ((consp message)
660 (mapcar 'tramp-gvfs-stringify-dbus-message message)) 660 (mapcar #'tramp-gvfs-stringify-dbus-message message))
661 ((stringp message) 661 ((stringp message)
662 (format "%S" message)) 662 (format "%S" message))
663 (t message))) 663 (t message)))
@@ -681,7 +681,7 @@ it is an asynchronous call, with `ignore' as callback function.
681The other arguments have the same meaning as with `dbus-call-method' 681The other arguments have the same meaning as with `dbus-call-method'
682or `dbus-call-method-asynchronously'." 682or `dbus-call-method-asynchronously'."
683 `(let ((func (if ,synchronous 683 `(let ((func (if ,synchronous
684 'dbus-call-method 'dbus-call-method-asynchronously)) 684 #'dbus-call-method #'dbus-call-method-asynchronously))
685 (args (append (list ,bus ,service ,path ,interface ,method) 685 (args (append (list ,bus ,service ,path ,interface ,method)
686 (if ,synchronous (list ,@args) (list 'ignore ,@args))))) 686 (if ,synchronous (list ,@args) (list 'ignore ,@args)))))
687 (tramp-dbus-function ,vec func args))) 687 (tramp-dbus-function ,vec func args)))
@@ -698,10 +698,10 @@ The call will be traced by Tramp with trace level 6."
698 `(when (member 698 `(when (member
699 ,interface 699 ,interface
700 (tramp-dbus-function 700 (tramp-dbus-function
701 ,vec 'dbus-introspect-get-interface-names 701 ,vec #'dbus-introspect-get-interface-names
702 (list ,bus ,service ,path))) 702 (list ,bus ,service ,path)))
703 (tramp-dbus-function 703 (tramp-dbus-function
704 ,vec 'dbus-get-all-properties (list ,bus ,service ,path ,interface)))) 704 ,vec #'dbus-get-all-properties (list ,bus ,service ,path ,interface))))
705 705
706(put 'with-tramp-dbus-get-all-properties 'lisp-indent-function 1) 706(put 'with-tramp-dbus-get-all-properties 'lisp-indent-function 1)
707(put 'with-tramp-dbus-get-all-properties 'edebug-form-spec '(form symbolp body)) 707(put 'with-tramp-dbus-get-all-properties 'edebug-form-spec '(form symbolp body))
@@ -723,7 +723,7 @@ is no information where to trace the message.")
723(add-hook 723(add-hook
724 (if (boundp 'dbus-event-error-functions) 724 (if (boundp 'dbus-event-error-functions)
725 'dbus-event-error-functions 'dbus-event-error-hooks) 725 'dbus-event-error-functions 'dbus-event-error-hooks)
726 'tramp-gvfs-dbus-event-error) 726 #'tramp-gvfs-dbus-event-error)
727 727
728 728
729;; File name primitives. 729;; File name primitives.
@@ -783,7 +783,7 @@ file names."
783 v 0 (format "%s %s to %s" msg-operation filename newname) 783 v 0 (format "%s %s to %s" msg-operation filename newname)
784 (unless 784 (unless
785 (apply 785 (apply
786 'tramp-gvfs-send-command v gvfs-operation 786 #'tramp-gvfs-send-command v gvfs-operation
787 (append 787 (append
788 (and (eq op 'copy) (or keep-date preserve-uid-gid) 788 (and (eq op 'copy) (or keep-date preserve-uid-gid)
789 '("--preserve")) 789 '("--preserve"))
@@ -888,7 +888,7 @@ file names."
888 (setq name (concat (file-name-as-directory dir) name))) 888 (setq name (concat (file-name-as-directory dir) name)))
889 ;; If NAME is not a Tramp file, run the real handler. 889 ;; If NAME is not a Tramp file, run the real handler.
890 (if (not (tramp-tramp-file-p name)) 890 (if (not (tramp-tramp-file-p name))
891 (tramp-run-real-handler 'expand-file-name (list name nil)) 891 (tramp-run-real-handler #'expand-file-name (list name nil))
892 ;; Dissect NAME. 892 ;; Dissect NAME.
893 (with-parsed-tramp-file-name name nil 893 (with-parsed-tramp-file-name name nil
894 ;; If there is a default location, expand tilde. 894 ;; If there is a default location, expand tilde.
@@ -907,7 +907,7 @@ file names."
907 (tramp-error 907 (tramp-error
908 v 'file-error 908 v 'file-error
909 "Cannot expand tilde in file `%s'" name)) 909 "Cannot expand tilde in file `%s'" name))
910 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) 910 (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
911 (setq localname (concat "/" localname))) 911 (setq localname (concat "/" localname)))
912 ;; We do not pass "/..". 912 ;; We do not pass "/..".
913 (if (string-match-p "^\\(afp\\|davs?\\|smb\\)$" method) 913 (if (string-match-p "^\\(afp\\|davs?\\|smb\\)$" method)
@@ -921,7 +921,7 @@ file names."
921 ;; No tilde characters in file name, do normal 921 ;; No tilde characters in file name, do normal
922 ;; `expand-file-name' (this does "/./" and "/../"). 922 ;; `expand-file-name' (this does "/./" and "/../").
923 (tramp-make-tramp-file-name 923 (tramp-make-tramp-file-name
924 v (tramp-run-real-handler 'expand-file-name (list localname)))))) 924 v (tramp-run-real-handler #'expand-file-name (list localname))))))
925 925
926(defun tramp-gvfs-get-directory-attributes (directory) 926(defun tramp-gvfs-get-directory-attributes (directory)
927 "Return GVFS attributes association list of all files in DIRECTORY." 927 "Return GVFS attributes association list of all files in DIRECTORY."
@@ -935,7 +935,7 @@ file names."
935 ;; Send command. 935 ;; Send command.
936 (tramp-gvfs-send-command 936 (tramp-gvfs-send-command
937 v "gvfs-ls" "-h" "-n" "-a" 937 v "gvfs-ls" "-h" "-n" "-a"
938 (mapconcat 'identity tramp-gvfs-file-attributes ",") 938 (mapconcat #'identity tramp-gvfs-file-attributes ",")
939 (tramp-gvfs-url-file-name directory)) 939 (tramp-gvfs-url-file-name directory))
940 ;; Parse output. 940 ;; Parse output.
941 (with-current-buffer (tramp-get-connection-buffer v) 941 (with-current-buffer (tramp-get-connection-buffer v)
@@ -1170,20 +1170,20 @@ If FILE-SYSTEM is non-nil, return file system attributes."
1170 '(created changed changes-done-hint moved deleted)) 1170 '(created changed changes-done-hint moved deleted))
1171 ((memq 'attribute-change flags) '(attribute-changed)))) 1171 ((memq 'attribute-change flags) '(attribute-changed))))
1172 (p (apply 1172 (p (apply
1173 'start-process 1173 #'start-process
1174 "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*") 1174 "gvfs-monitor" (generate-new-buffer " *gvfs-monitor*")
1175 `("gio" "monitor" ,(tramp-gvfs-url-file-name file-name))))) 1175 `("gio" "monitor" ,(tramp-gvfs-url-file-name file-name)))))
1176 (if (not (processp p)) 1176 (if (not (processp p))
1177 (tramp-error 1177 (tramp-error
1178 v 'file-notify-error "Monitoring not supported for `%s'" file-name) 1178 v 'file-notify-error "Monitoring not supported for `%s'" file-name)
1179 (tramp-message 1179 (tramp-message
1180 v 6 "Run `%s', %S" (mapconcat 'identity (process-command p) " ") p) 1180 v 6 "Run `%s', %S" (mapconcat #'identity (process-command p) " ") p)
1181 (process-put p 'vector v) 1181 (process-put p 'vector v)
1182 (process-put p 'events events) 1182 (process-put p 'events events)
1183 (process-put p 'watch-name localname) 1183 (process-put p 'watch-name localname)
1184 (process-put p 'adjust-window-size-function 'ignore) 1184 (process-put p 'adjust-window-size-function #'ignore)
1185 (set-process-query-on-exit-flag p nil) 1185 (set-process-query-on-exit-flag p nil)
1186 (set-process-filter p 'tramp-gvfs-monitor-process-filter) 1186 (set-process-filter p #'tramp-gvfs-monitor-process-filter)
1187 ;; There might be an error if the monitor is not supported. 1187 ;; There might be an error if the monitor is not supported.
1188 ;; Give the filter a chance to read the output. 1188 ;; Give the filter a chance to read the output.
1189 (while (tramp-accept-process-output p 0)) 1189 (while (tramp-accept-process-output p 0))
@@ -1305,7 +1305,7 @@ file-notify events."
1305 'rename filename newname ok-if-already-exists 1305 'rename filename newname ok-if-already-exists
1306 'keep-date 'preserve-uid-gid) 1306 'keep-date 'preserve-uid-gid)
1307 (tramp-run-real-handler 1307 (tramp-run-real-handler
1308 'rename-file (list filename newname ok-if-already-exists)))) 1308 #'rename-file (list filename newname ok-if-already-exists))))
1309 1309
1310 1310
1311;; File name conversions. 1311;; File name conversions.
@@ -1514,20 +1514,20 @@ file-notify events."
1514 (dbus-register-signal 1514 (dbus-register-signal
1515 :session nil tramp-gvfs-path-mounttracker 1515 :session nil tramp-gvfs-path-mounttracker
1516 tramp-gvfs-interface-mounttracker "mounted" 1516 tramp-gvfs-interface-mounttracker "mounted"
1517 'tramp-gvfs-handler-mounted-unmounted) 1517 #'tramp-gvfs-handler-mounted-unmounted)
1518 (dbus-register-signal 1518 (dbus-register-signal
1519 :session nil tramp-gvfs-path-mounttracker 1519 :session nil tramp-gvfs-path-mounttracker
1520 tramp-gvfs-interface-mounttracker "Mounted" 1520 tramp-gvfs-interface-mounttracker "Mounted"
1521 'tramp-gvfs-handler-mounted-unmounted) 1521 #'tramp-gvfs-handler-mounted-unmounted)
1522 1522
1523 (dbus-register-signal 1523 (dbus-register-signal
1524 :session nil tramp-gvfs-path-mounttracker 1524 :session nil tramp-gvfs-path-mounttracker
1525 tramp-gvfs-interface-mounttracker "unmounted" 1525 tramp-gvfs-interface-mounttracker "unmounted"
1526 'tramp-gvfs-handler-mounted-unmounted) 1526 #'tramp-gvfs-handler-mounted-unmounted)
1527 (dbus-register-signal 1527 (dbus-register-signal
1528 :session nil tramp-gvfs-path-mounttracker 1528 :session nil tramp-gvfs-path-mounttracker
1529 tramp-gvfs-interface-mounttracker "Unmounted" 1529 tramp-gvfs-interface-mounttracker "Unmounted"
1530 'tramp-gvfs-handler-mounted-unmounted)) 1530 #'tramp-gvfs-handler-mounted-unmounted))
1531 1531
1532(defun tramp-gvfs-connection-mounted-p (vec) 1532(defun tramp-gvfs-connection-mounted-p (vec)
1533 "Check, whether the location is already mounted." 1533 "Check, whether the location is already mounted."
@@ -1782,22 +1782,22 @@ connection if a previous connection has died for some reason."
1782 (dbus-register-method 1782 (dbus-register-method
1783 :session dbus-service-emacs object-path 1783 :session dbus-service-emacs object-path
1784 tramp-gvfs-interface-mountoperation "askPassword" 1784 tramp-gvfs-interface-mountoperation "askPassword"
1785 'tramp-gvfs-handler-askpassword) 1785 #'tramp-gvfs-handler-askpassword)
1786 (dbus-register-method 1786 (dbus-register-method
1787 :session dbus-service-emacs object-path 1787 :session dbus-service-emacs object-path
1788 tramp-gvfs-interface-mountoperation "AskPassword" 1788 tramp-gvfs-interface-mountoperation "AskPassword"
1789 'tramp-gvfs-handler-askpassword) 1789 #'tramp-gvfs-handler-askpassword)
1790 1790
1791 ;; There could be a callback of "askQuestion" when adding 1791 ;; There could be a callback of "askQuestion" when adding
1792 ;; fingerprints or checking certificates. 1792 ;; fingerprints or checking certificates.
1793 (dbus-register-method 1793 (dbus-register-method
1794 :session dbus-service-emacs object-path 1794 :session dbus-service-emacs object-path
1795 tramp-gvfs-interface-mountoperation "askQuestion" 1795 tramp-gvfs-interface-mountoperation "askQuestion"
1796 'tramp-gvfs-handler-askquestion) 1796 #'tramp-gvfs-handler-askquestion)
1797 (dbus-register-method 1797 (dbus-register-method
1798 :session dbus-service-emacs object-path 1798 :session dbus-service-emacs object-path
1799 tramp-gvfs-interface-mountoperation "AskQuestion" 1799 tramp-gvfs-interface-mountoperation "AskQuestion"
1800 'tramp-gvfs-handler-askquestion) 1800 #'tramp-gvfs-handler-askquestion)
1801 1801
1802 ;; The call must be asynchronously, because of the "askPassword" 1802 ;; The call must be asynchronously, because of the "askPassword"
1803 ;; or "askQuestion" callbacks. 1803 ;; or "askQuestion" callbacks.
@@ -1880,7 +1880,7 @@ is applied, and it returns t if the return code is zero."
1880 (with-current-buffer (tramp-get-connection-buffer vec) 1880 (with-current-buffer (tramp-get-connection-buffer vec)
1881 (tramp-gvfs-maybe-open-connection vec) 1881 (tramp-gvfs-maybe-open-connection vec)
1882 (erase-buffer) 1882 (erase-buffer)
1883 (or (zerop (apply 'tramp-call-process vec command nil t nil args)) 1883 (or (zerop (apply #'tramp-call-process vec command nil t nil args))
1884 ;; Remove information about mounted connection. 1884 ;; Remove information about mounted connection.
1885 (and (tramp-flush-file-properties vec "/") nil))))) 1885 (and (tramp-flush-file-properties vec "/") nil)))))
1886 1886
@@ -1897,9 +1897,9 @@ VEC is used only for traces."
1897 (dolist 1897 (dolist
1898 (object-path 1898 (object-path
1899 (mapcar 1899 (mapcar
1900 'car 1900 #'car
1901 (tramp-dbus-function 1901 (tramp-dbus-function
1902 vec 'dbus-get-all-managed-objects 1902 vec #'dbus-get-all-managed-objects
1903 `(:session ,tramp-goa-service ,tramp-goa-path)))) 1903 `(:session ,tramp-goa-service ,tramp-goa-path))))
1904 (let* ((account-properties 1904 (let* ((account-properties
1905 (with-tramp-dbus-get-all-properties vec 1905 (with-tramp-dbus-get-all-properties vec
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index e2a0d6b206f..2a461763480 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -61,11 +61,11 @@ special handling of `substitute-in-file-name'."
61 (pop props) (pop props)))))) 61 (pop props) (pop props))))))
62 62
63(add-hook 'rfn-eshadow-setup-minibuffer-hook 63(add-hook 'rfn-eshadow-setup-minibuffer-hook
64 'tramp-rfn-eshadow-setup-minibuffer) 64 #'tramp-rfn-eshadow-setup-minibuffer)
65(add-hook 'tramp-unload-hook 65(add-hook 'tramp-unload-hook
66 (lambda () 66 (lambda ()
67 (remove-hook 'rfn-eshadow-setup-minibuffer-hook 67 (remove-hook 'rfn-eshadow-setup-minibuffer-hook
68 'tramp-rfn-eshadow-setup-minibuffer))) 68 #'tramp-rfn-eshadow-setup-minibuffer)))
69 69
70(defun tramp-rfn-eshadow-update-overlay-regexp () 70(defun tramp-rfn-eshadow-update-overlay-regexp ()
71 (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) 71 (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
@@ -104,11 +104,11 @@ been set up by `rfn-eshadow-setup-minibuffer'."
104 (rfn-eshadow-update-overlay)))))))) 104 (rfn-eshadow-update-overlay))))))))
105 105
106(add-hook 'rfn-eshadow-update-overlay-hook 106(add-hook 'rfn-eshadow-update-overlay-hook
107 'tramp-rfn-eshadow-update-overlay) 107 #'tramp-rfn-eshadow-update-overlay)
108(add-hook 'tramp-unload-hook 108(add-hook 'tramp-unload-hook
109 (lambda () 109 (lambda ()
110 (remove-hook 'rfn-eshadow-update-overlay-hook 110 (remove-hook 'rfn-eshadow-update-overlay-hook
111 'tramp-rfn-eshadow-update-overlay))) 111 #'tramp-rfn-eshadow-update-overlay)))
112 112
113;;; Integration of eshell.el: 113;;; Integration of eshell.el:
114 114
@@ -120,20 +120,20 @@ been set up by `rfn-eshadow-setup-minibuffer'."
120 ;; Use `path-separator' as it does eshell. 120 ;; Use `path-separator' as it does eshell.
121 (setq eshell-path-env 121 (setq eshell-path-env
122 (mapconcat 122 (mapconcat
123 'identity (butlast (tramp-compat-exec-path)) path-separator))) 123 #'identity (butlast (tramp-compat-exec-path)) path-separator)))
124 124
125(eval-after-load "esh-util" 125(eval-after-load "esh-util"
126 '(progn 126 '(progn
127 (add-hook 'eshell-mode-hook 127 (add-hook 'eshell-mode-hook
128 'tramp-eshell-directory-change) 128 #'tramp-eshell-directory-change)
129 (add-hook 'eshell-directory-change-hook 129 (add-hook 'eshell-directory-change-hook
130 'tramp-eshell-directory-change) 130 #'tramp-eshell-directory-change)
131 (add-hook 'tramp-integration-unload-hook 131 (add-hook 'tramp-integration-unload-hook
132 (lambda () 132 (lambda ()
133 (remove-hook 'eshell-mode-hook 133 (remove-hook 'eshell-mode-hook
134 'tramp-eshell-directory-change) 134 #'tramp-eshell-directory-change)
135 (remove-hook 'eshell-directory-change-hook 135 (remove-hook 'eshell-directory-change-hook
136 'tramp-eshell-directory-change))))) 136 #'tramp-eshell-directory-change)))))
137 137
138;;; Integration of recentf.el: 138;;; Integration of recentf.el:
139 139
@@ -160,15 +160,15 @@ NAME must be equal to `tramp-current-connection'."
160(eval-after-load "recentf" 160(eval-after-load "recentf"
161 '(progn 161 '(progn
162 (add-hook 'tramp-cleanup-connection-hook 162 (add-hook 'tramp-cleanup-connection-hook
163 'tramp-recentf-cleanup) 163 #'tramp-recentf-cleanup)
164 (add-hook 'tramp-cleanup-all-connections-hook 164 (add-hook 'tramp-cleanup-all-connections-hook
165 'tramp-recentf-cleanup-all) 165 #'tramp-recentf-cleanup-all)
166 (add-hook 'tramp-integration-unload-hook 166 (add-hook 'tramp-integration-unload-hook
167 (lambda () 167 (lambda ()
168 (remove-hook 'tramp-cleanup-connection-hook 168 (remove-hook 'tramp-cleanup-connection-hook
169 'tramp-recentf-cleanup) 169 #'tramp-recentf-cleanup)
170 (remove-hook 'tramp-cleanup-all-connections-hook 170 (remove-hook 'tramp-cleanup-all-connections-hook
171 'tramp-recentf-cleanup-all))))) 171 #'tramp-recentf-cleanup-all)))))
172 172
173(add-hook 'tramp-unload-hook 173(add-hook 'tramp-unload-hook
174 (lambda () (unload-feature 'tramp-integration 'force))) 174 (lambda () (unload-feature 'tramp-integration 'force)))
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 698296bf550..0148116d739 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -280,7 +280,7 @@ file names."
280 'copy filename newname ok-if-already-exists keep-date 280 'copy filename newname ok-if-already-exists keep-date
281 preserve-uid-gid preserve-extended-attributes) 281 preserve-uid-gid preserve-extended-attributes)
282 (tramp-run-real-handler 282 (tramp-run-real-handler
283 'copy-file 283 #'copy-file
284 (list filename newname ok-if-already-exists keep-date 284 (list filename newname ok-if-already-exists keep-date
285 preserve-uid-gid preserve-extended-attributes)))) 285 preserve-uid-gid preserve-extended-attributes))))
286 286
@@ -314,7 +314,7 @@ file names."
314 (when full 314 (when full
315 (let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v)))) 315 (let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v))))
316 (remote (funcall (if (tramp-compat-file-name-quoted-p directory) 316 (remote (funcall (if (tramp-compat-file-name-quoted-p directory)
317 'tramp-compat-file-name-quote 'identity) 317 #'tramp-compat-file-name-quote #'identity)
318 (file-remote-p directory)))) 318 (file-remote-p directory))))
319 (setq result 319 (setq result
320 (mapcar 320 (mapcar
@@ -328,7 +328,7 @@ file names."
328 result))) 328 result)))
329 (setq result (cons item result)))) 329 (setq result (cons item result))))
330 ;; Return result. 330 ;; Return result.
331 (if nosort result (sort result 'string<)))))) 331 (if nosort result (sort result #'string<))))))
332 332
333(defun tramp-rclone-handle-file-attributes (filename &optional id-format) 333(defun tramp-rclone-handle-file-attributes (filename &optional id-format)
334 "Like `file-attributes' for Tramp files." 334 "Like `file-attributes' for Tramp files."
@@ -436,7 +436,7 @@ file names."
436 'rename filename newname ok-if-already-exists 436 'rename filename newname ok-if-already-exists
437 'keep-date 'preserve-uid-gid) 437 'keep-date 'preserve-uid-gid)
438 (tramp-run-real-handler 438 (tramp-run-real-handler
439 'rename-file (list filename newname ok-if-already-exists)))) 439 #'rename-file (list filename newname ok-if-already-exists))))
440 440
441 441
442;; File name conversions. 442;; File name conversions.
@@ -500,7 +500,7 @@ file names."
500 (let ((quoted (tramp-compat-file-name-quoted-p localname)) 500 (let ((quoted (tramp-compat-file-name-quoted-p localname))
501 (localname (tramp-compat-file-name-unquote localname))) 501 (localname (tramp-compat-file-name-unquote localname)))
502 (funcall 502 (funcall
503 (if quoted 'tramp-compat-file-name-quote 'identity) 503 (if quoted #'tramp-compat-file-name-quote #'identity)
504 (expand-file-name 504 (expand-file-name
505 (if (file-name-absolute-p localname) 505 (if (file-name-absolute-p localname)
506 (substring localname 1) localname) 506 (substring localname 1) localname)
@@ -560,7 +560,7 @@ connection if a previous connection has died for some reason."
560 ;; DESTINATION of `tramp-call-process'. 560 ;; DESTINATION of `tramp-call-process'.
561 (unless (tramp-rclone-mounted-p vec) 561 (unless (tramp-rclone-mounted-p vec)
562 (apply 562 (apply
563 'tramp-call-process 563 #'tramp-call-process
564 vec tramp-rclone-program nil 0 nil 564 vec tramp-rclone-program nil 0 nil
565 (delq nil 565 (delq nil
566 `("mount" ,(concat host ":/") 566 `("mount" ,(concat host ":/")
@@ -591,7 +591,7 @@ connection if a previous connection has died for some reason."
591 (erase-buffer) 591 (erase-buffer)
592 (let ((flags (tramp-get-method-parameter 592 (let ((flags (tramp-get-method-parameter
593 vec (intern (format "tramp-%s-args" (car args)))))) 593 vec (intern (format "tramp-%s-args" (car args))))))
594 (apply 'tramp-call-process 594 (apply #'tramp-call-process
595 vec tramp-rclone-program nil t nil (append args flags))))) 595 vec tramp-rclone-program nil t nil (append args flags)))))
596 596
597(add-hook 'tramp-unload-hook 597(add-hook 'tramp-unload-hook
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2d02961db5e..58c2fe5fd3f 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1026,7 +1026,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
1026component is used as the target of the symlink." 1026component is used as the target of the symlink."
1027 (if (not (tramp-tramp-file-p (expand-file-name linkname))) 1027 (if (not (tramp-tramp-file-p (expand-file-name linkname)))
1028 (tramp-run-real-handler 1028 (tramp-run-real-handler
1029 'make-symbolic-link (list target linkname ok-if-already-exists)) 1029 #'make-symbolic-link (list target linkname ok-if-already-exists))
1030 1030
1031 (with-parsed-tramp-file-name linkname nil 1031 (with-parsed-tramp-file-name linkname nil
1032 ;; If TARGET is a Tramp name, use just the localname component. 1032 ;; If TARGET is a Tramp name, use just the localname component.
@@ -1044,7 +1044,7 @@ component is used as the target of the symlink."
1044 1044
1045 (let ((ln (tramp-get-remote-ln v)) 1045 (let ((ln (tramp-get-remote-ln v))
1046 (cwd (tramp-run-real-handler 1046 (cwd (tramp-run-real-handler
1047 'file-name-directory (list localname)))) 1047 #'file-name-directory (list localname))))
1048 (unless ln 1048 (unless ln
1049 (tramp-error 1049 (tramp-error
1050 v 'file-error 1050 v 'file-error
@@ -1088,7 +1088,7 @@ component is used as the target of the symlink."
1088 ;; Preserve trailing "/". 1088 ;; Preserve trailing "/".
1089 (funcall 1089 (funcall
1090 (if (string-equal (file-name-nondirectory filename) "") 1090 (if (string-equal (file-name-nondirectory filename) "")
1091 'file-name-as-directory 'identity) 1091 #'file-name-as-directory #'identity)
1092 (with-parsed-tramp-file-name (expand-file-name filename) nil 1092 (with-parsed-tramp-file-name (expand-file-name filename) nil
1093 (tramp-make-tramp-file-name 1093 (tramp-make-tramp-file-name
1094 v 1094 v
@@ -1136,7 +1136,7 @@ component is used as the target of the symlink."
1136 (setq thisstep (pop steps)) 1136 (setq thisstep (pop steps))
1137 (tramp-message 1137 (tramp-message
1138 v 5 "Check %s" 1138 v 5 "Check %s"
1139 (mapconcat 'identity 1139 (mapconcat #'identity
1140 (append '("") (reverse result) (list thisstep)) 1140 (append '("") (reverse result) (list thisstep))
1141 "/")) 1141 "/"))
1142 (setq symlink-target 1142 (setq symlink-target
@@ -1144,7 +1144,7 @@ component is used as the target of the symlink."
1144 (file-attributes 1144 (file-attributes
1145 (tramp-make-tramp-file-name 1145 (tramp-make-tramp-file-name
1146 v 1146 v
1147 (mapconcat 'identity 1147 (mapconcat #'identity
1148 (append '("") 1148 (append '("")
1149 (reverse result) 1149 (reverse result)
1150 (list thisstep)) 1150 (list thisstep))
@@ -1176,7 +1176,7 @@ component is used as the target of the symlink."
1176 ;; Combine list to form string. 1176 ;; Combine list to form string.
1177 (setq result 1177 (setq result
1178 (if result 1178 (if result
1179 (mapconcat 'identity (cons "" result) "/") 1179 (mapconcat #'identity (cons "" result) "/")
1180 "/")) 1180 "/"))
1181 (when (string= "" result) 1181 (when (string= "" result)
1182 (setq result "/"))))) 1182 (setq result "/")))))
@@ -1379,7 +1379,7 @@ component is used as the target of the symlink."
1379 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" 1379 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
1380 (buffer-name))) 1380 (buffer-name)))
1381 (if time-list 1381 (if time-list
1382 (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) 1382 (tramp-run-real-handler #'set-visited-file-modtime (list time-list))
1383 (let ((f (buffer-file-name)) 1383 (let ((f (buffer-file-name))
1384 coding-system-used) 1384 coding-system-used)
1385 (with-parsed-tramp-file-name f nil 1385 (with-parsed-tramp-file-name f nil
@@ -1389,7 +1389,7 @@ component is used as the target of the symlink."
1389 tramp-time-doesnt-exist))) 1389 tramp-time-doesnt-exist)))
1390 (setq coding-system-used last-coding-system-used) 1390 (setq coding-system-used last-coding-system-used)
1391 (if (not (tramp-compat-time-equal-p modtime tramp-time-dont-know)) 1391 (if (not (tramp-compat-time-equal-p modtime tramp-time-dont-know))
1392 (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) 1392 (tramp-run-real-handler #'set-visited-file-modtime (list modtime))
1393 (progn 1393 (progn
1394 (tramp-send-command 1394 (tramp-send-command
1395 v 1395 v
@@ -1961,7 +1961,7 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
1961 'rename filename newname ok-if-already-exists 1961 'rename filename newname ok-if-already-exists
1962 'keep-time 'preserve-uid-gid) 1962 'keep-time 'preserve-uid-gid)
1963 (tramp-run-real-handler 1963 (tramp-run-real-handler
1964 'rename-file (list filename newname ok-if-already-exists)))) 1964 #'rename-file (list filename newname ok-if-already-exists))))
1965 1965
1966(defun tramp-do-copy-or-rename-file 1966(defun tramp-do-copy-or-rename-file
1967 (op filename newname &optional ok-if-already-exists keep-date 1967 (op filename newname &optional ok-if-already-exists keep-date
@@ -1996,7 +1996,7 @@ file names."
1996 (file-attributes (file-truename filename)))) 1996 (file-attributes (file-truename filename))))
1997 ;; `file-extended-attributes' exists since Emacs 24.4. 1997 ;; `file-extended-attributes' exists since Emacs 24.4.
1998 (attributes (and preserve-extended-attributes 1998 (attributes (and preserve-extended-attributes
1999 (apply 'file-extended-attributes (list filename))))) 1999 (apply #'file-extended-attributes (list filename)))))
2000 2000
2001 (with-parsed-tramp-file-name (if t1 filename newname) nil 2001 (with-parsed-tramp-file-name (if t1 filename newname) nil
2002 (when (and (not ok-if-already-exists) (file-exists-p newname)) 2002 (when (and (not ok-if-already-exists) (file-exists-p newname))
@@ -2069,7 +2069,7 @@ file names."
2069 ;; `set-file-extended-attributes' exists since Emacs 24.4. 2069 ;; `set-file-extended-attributes' exists since Emacs 24.4.
2070 (when attributes 2070 (when attributes
2071 (ignore-errors 2071 (ignore-errors
2072 (apply 'set-file-extended-attributes (list newname attributes)))) 2072 (apply #'set-file-extended-attributes (list newname attributes))))
2073 2073
2074 ;; In case of `rename', we must flush the cache of the source file. 2074 ;; In case of `rename', we must flush the cache of the source file.
2075 (when (and t1 (eq op 'rename)) 2075 (when (and t1 (eq op 'rename))
@@ -2193,7 +2193,8 @@ the uid and gid from FILENAME."
2193 localname1 localname2 ok-if-already-exists 2193 localname1 localname2 ok-if-already-exists
2194 keep-date preserve-uid-gid) 2194 keep-date preserve-uid-gid)
2195 (tramp-run-real-handler 2195 (tramp-run-real-handler
2196 'rename-file (list localname1 localname2 ok-if-already-exists)))) 2196 #'rename-file
2197 (list localname1 localname2 ok-if-already-exists))))
2197 2198
2198 ;; We can do it directly with `tramp-send-command' 2199 ;; We can do it directly with `tramp-send-command'
2199 ((and (file-readable-p (concat prefix localname1)) 2200 ((and (file-readable-p (concat prefix localname1))
@@ -2238,7 +2239,7 @@ the uid and gid from FILENAME."
2238 (copy-file 2239 (copy-file
2239 localname1 tmpfile t keep-date preserve-uid-gid) 2240 localname1 tmpfile t keep-date preserve-uid-gid)
2240 (tramp-run-real-handler 2241 (tramp-run-real-handler
2241 'rename-file (list localname1 tmpfile t))) 2242 #'rename-file (list localname1 tmpfile t)))
2242 ;; We must change the ownership as local user. 2243 ;; We must change the ownership as local user.
2243 ;; Since this does not work reliable, we also 2244 ;; Since this does not work reliable, we also
2244 ;; give read permissions. 2245 ;; give read permissions.
@@ -2260,7 +2261,7 @@ the uid and gid from FILENAME."
2260 (tramp-get-buffer v))) 2261 (tramp-get-buffer v)))
2261 (t1 2262 (t1
2262 (tramp-run-real-handler 2263 (tramp-run-real-handler
2263 'rename-file 2264 #'rename-file
2264 (list tmpfile localname2 ok-if-already-exists))))) 2265 (list tmpfile localname2 ok-if-already-exists)))))
2265 2266
2266 ;; Save exit. 2267 ;; Save exit.
@@ -2309,8 +2310,8 @@ The method used must be an out-of-band method."
2309 (setq source (funcall 2310 (setq source (funcall
2310 (if (and (file-directory-p filename) 2311 (if (and (file-directory-p filename)
2311 (not (file-exists-p newname))) 2312 (not (file-exists-p newname)))
2312 'file-name-as-directory 2313 #'file-name-as-directory
2313 'identity) 2314 #'identity)
2314 (if t1 2315 (if t1
2315 (tramp-make-copy-program-file-name v) 2316 (tramp-make-copy-program-file-name v)
2316 (tramp-unquote-shell-quote-argument filename))) 2317 (tramp-unquote-shell-quote-argument filename)))
@@ -2364,7 +2365,7 @@ The method used must be an out-of-band method."
2364 (mapcar 2365 (mapcar
2365 (lambda (x) 2366 (lambda (x)
2366 (setq x (mapcar (lambda (y) (format-spec y spec)) x)) 2367 (setq x (mapcar (lambda (y) (format-spec y spec)) x))
2367 (unless (member "" x) (mapconcat 'identity x " "))) 2368 (unless (member "" x) (mapconcat #'identity x " ")))
2368 (tramp-get-method-parameter v 'tramp-copy-env))) 2369 (tramp-get-method-parameter v 'tramp-copy-env)))
2369 2370
2370 remote-copy-program 2371 remote-copy-program
@@ -2394,7 +2395,7 @@ The method used must be an out-of-band method."
2394 "Cannot find remote listener: %s" remote-copy-program)) 2395 "Cannot find remote listener: %s" remote-copy-program))
2395 (setq remote-copy-program 2396 (setq remote-copy-program
2396 (mapconcat 2397 (mapconcat
2397 'identity 2398 #'identity
2398 (append 2399 (append
2399 (list remote-copy-program) remote-copy-args 2400 (list remote-copy-program) remote-copy-args
2400 (list (if t1 (concat "<" source) (concat ">" target)) "&")) 2401 (list (if t1 (concat "<" source) (concat ">" target)) "&"))
@@ -2440,7 +2441,7 @@ The method used must be an out-of-band method."
2440 ;; copying of large files can last longer than 60 secs. 2441 ;; copying of large files can last longer than 60 secs.
2441 (let* ((command 2442 (let* ((command
2442 (mapconcat 2443 (mapconcat
2443 'identity (append (list copy-program) copy-args) 2444 #'identity (append (list copy-program) copy-args)
2444 " ")) 2445 " "))
2445 (p (let ((default-directory 2446 (p (let ((default-directory
2446 (tramp-compat-temporary-file-directory))) 2447 (tramp-compat-temporary-file-directory)))
@@ -2450,7 +2451,7 @@ The method used must be an out-of-band method."
2450 command)))) 2451 command))))
2451 (tramp-message orig-vec 6 "%s" command) 2452 (tramp-message orig-vec 6 "%s" command)
2452 (process-put p 'vector orig-vec) 2453 (process-put p 'vector orig-vec)
2453 (process-put p 'adjust-window-size-function 'ignore) 2454 (process-put p 'adjust-window-size-function #'ignore)
2454 (set-process-query-on-exit-flag p nil) 2455 (set-process-query-on-exit-flag p nil)
2455 2456
2456 ;; We must adapt `tramp-local-end-of-line' for 2457 ;; We must adapt `tramp-local-end-of-line' for
@@ -2593,12 +2594,12 @@ The method used must be an out-of-band method."
2593 (setq switches (delete "--dired" switches))) 2594 (setq switches (delete "--dired" switches)))
2594 (when wildcard 2595 (when wildcard
2595 (setq wildcard (tramp-run-real-handler 2596 (setq wildcard (tramp-run-real-handler
2596 'file-name-nondirectory (list localname))) 2597 #'file-name-nondirectory (list localname)))
2597 (setq localname (tramp-run-real-handler 2598 (setq localname (tramp-run-real-handler
2598 'file-name-directory (list localname)))) 2599 #'file-name-directory (list localname))))
2599 (unless (or full-directory-p (member "-d" switches)) 2600 (unless (or full-directory-p (member "-d" switches))
2600 (setq switches (append switches '("-d")))) 2601 (setq switches (append switches '("-d"))))
2601 (setq switches (mapconcat 'tramp-shell-quote-argument switches " ")) 2602 (setq switches (mapconcat #'tramp-shell-quote-argument switches " "))
2602 (when wildcard 2603 (when wildcard
2603 (setq switches (concat switches " " wildcard))) 2604 (setq switches (concat switches " " wildcard)))
2604 (tramp-message 2605 (tramp-message
@@ -2620,10 +2621,10 @@ The method used must be an out-of-band method."
2620 v 2621 v
2621 (format "cd %s" (tramp-shell-quote-argument 2622 (format "cd %s" (tramp-shell-quote-argument
2622 (tramp-run-real-handler 2623 (tramp-run-real-handler
2623 'file-name-directory (list localname)))) 2624 #'file-name-directory (list localname))))
2624 "Couldn't `cd %s'" 2625 "Couldn't `cd %s'"
2625 (tramp-shell-quote-argument 2626 (tramp-shell-quote-argument
2626 (tramp-run-real-handler 'file-name-directory (list localname)))) 2627 (tramp-run-real-handler #'file-name-directory (list localname))))
2627 (tramp-send-command 2628 (tramp-send-command
2628 v 2629 v
2629 (format "%s %s %s 2>/dev/null" 2630 (format "%s %s %s 2>/dev/null"
@@ -2632,11 +2633,11 @@ The method used must be an out-of-band method."
2632 (if (or wildcard 2633 (if (or wildcard
2633 (zerop (length 2634 (zerop (length
2634 (tramp-run-real-handler 2635 (tramp-run-real-handler
2635 'file-name-nondirectory (list localname))))) 2636 #'file-name-nondirectory (list localname)))))
2636 "" 2637 ""
2637 (tramp-shell-quote-argument 2638 (tramp-shell-quote-argument
2638 (tramp-run-real-handler 2639 (tramp-run-real-handler
2639 'file-name-nondirectory (list localname))))))) 2640 #'file-name-nondirectory (list localname)))))))
2640 2641
2641 (save-restriction 2642 (save-restriction
2642 (let ((beg (point))) 2643 (let ((beg (point)))
@@ -2720,10 +2721,10 @@ the result will be a local, non-Tramp, file name."
2720 (setq name (concat (file-name-as-directory dir) name))) 2721 (setq name (concat (file-name-as-directory dir) name)))
2721 ;; If connection is not established yet, run the real handler. 2722 ;; If connection is not established yet, run the real handler.
2722 (if (not (tramp-connectable-p name)) 2723 (if (not (tramp-connectable-p name))
2723 (tramp-run-real-handler 'expand-file-name (list name nil)) 2724 (tramp-run-real-handler #'expand-file-name (list name nil))
2724 ;; Dissect NAME. 2725 ;; Dissect NAME.
2725 (with-parsed-tramp-file-name name nil 2726 (with-parsed-tramp-file-name name nil
2726 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) 2727 (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
2727 (setq localname (concat "~/" localname))) 2728 (setq localname (concat "~/" localname)))
2728 ;; Tilde expansion if necessary. This needs a shell which 2729 ;; Tilde expansion if necessary. This needs a shell which
2729 ;; groks tilde expansion! The function `tramp-find-shell' is 2730 ;; groks tilde expansion! The function `tramp-find-shell' is
@@ -2761,7 +2762,7 @@ the result will be a local, non-Tramp, file name."
2761 (tramp-make-tramp-file-name 2762 (tramp-make-tramp-file-name
2762 v (tramp-drop-volume-letter 2763 v (tramp-drop-volume-letter
2763 (tramp-run-real-handler 2764 (tramp-run-real-handler
2764 'expand-file-name (list localname)))))))) 2765 #'expand-file-name (list localname))))))))
2765 2766
2766;;; Remote commands: 2767;;; Remote commands:
2767 2768
@@ -2792,25 +2793,25 @@ the result will be a local, non-Tramp, file name."
2792 (sentinel (plist-get args :sentinel)) 2793 (sentinel (plist-get args :sentinel))
2793 (stderr (plist-get args :stderr))) 2794 (stderr (plist-get args :stderr)))
2794 (unless (stringp name) 2795 (unless (stringp name)
2795 (signal 'wrong-type-argument (list 'stringp name))) 2796 (signal 'wrong-type-argument (list #'stringp name)))
2796 (unless (or (null buffer) (bufferp buffer) (stringp buffer)) 2797 (unless (or (null buffer) (bufferp buffer) (stringp buffer))
2797 (signal 'wrong-type-argument (list 'stringp buffer))) 2798 (signal 'wrong-type-argument (list #'stringp buffer)))
2798 (unless (consp command) 2799 (unless (consp command)
2799 (signal 'wrong-type-argument (list 'consp command))) 2800 (signal 'wrong-type-argument (list #'consp command)))
2800 (unless (or (null coding) 2801 (unless (or (null coding)
2801 (and (symbolp coding) (memq coding coding-system-list)) 2802 (and (symbolp coding) (memq coding coding-system-list))
2802 (and (consp coding) 2803 (and (consp coding)
2803 (memq (car coding) coding-system-list) 2804 (memq (car coding) coding-system-list)
2804 (memq (cdr coding) coding-system-list))) 2805 (memq (cdr coding) coding-system-list)))
2805 (signal 'wrong-type-argument (list 'symbolp coding))) 2806 (signal 'wrong-type-argument (list #'symbolp coding)))
2806 (unless (or (null connection-type) (memq connection-type '(pipe pty))) 2807 (unless (or (null connection-type) (memq connection-type '(pipe pty)))
2807 (signal 'wrong-type-argument (list 'symbolp connection-type))) 2808 (signal 'wrong-type-argument (list #'symbolp connection-type)))
2808 (unless (or (null filter) (functionp filter)) 2809 (unless (or (null filter) (functionp filter))
2809 (signal 'wrong-type-argument (list 'functionp filter))) 2810 (signal 'wrong-type-argument (list #'functionp filter)))
2810 (unless (or (null sentinel) (functionp sentinel)) 2811 (unless (or (null sentinel) (functionp sentinel))
2811 (signal 'wrong-type-argument (list 'functionp sentinel))) 2812 (signal 'wrong-type-argument (list #'functionp sentinel)))
2812 (unless (or (null stderr) (bufferp stderr) (stringp stderr)) 2813 (unless (or (null stderr) (bufferp stderr) (stringp stderr))
2813 (signal 'wrong-type-argument (list 'stringp stderr))) 2814 (signal 'wrong-type-argument (list #'stringp stderr)))
2814 2815
2815 (let* ((buffer 2816 (let* ((buffer
2816 (if buffer 2817 (if buffer
@@ -2864,15 +2865,16 @@ the result will be a local, non-Tramp, file name."
2864 (if uenv 2865 (if uenv
2865 (format 2866 (format
2866 "unset %s &&" 2867 "unset %s &&"
2867 (mapconcat 'tramp-shell-quote-argument uenv " ")) 2868 (mapconcat
2869 #'tramp-shell-quote-argument uenv " "))
2868 "") 2870 "")
2869 (if heredoc (format "<<'%s'" tramp-end-of-heredoc) "") 2871 (if heredoc (format "<<'%s'" tramp-end-of-heredoc) "")
2870 (if tmpstderr (format "2>'%s'" tmpstderr) "") 2872 (if tmpstderr (format "2>'%s'" tmpstderr) "")
2871 (mapconcat 'tramp-shell-quote-argument env " ") 2873 (mapconcat #'tramp-shell-quote-argument env " ")
2872 (if heredoc 2874 (if heredoc
2873 (format "%s\n(\n%s\n) </dev/tty\n%s" 2875 (format "%s\n(\n%s\n) </dev/tty\n%s"
2874 program (car args) tramp-end-of-heredoc) 2876 program (car args) tramp-end-of-heredoc)
2875 (mapconcat 'tramp-shell-quote-argument 2877 (mapconcat #'tramp-shell-quote-argument
2876 (cons program args) " "))))) 2878 (cons program args) " ")))))
2877 (tramp-process-connection-type 2879 (tramp-process-connection-type
2878 (or (null program) tramp-process-connection-type)) 2880 (or (null program) tramp-process-connection-type))
@@ -2985,7 +2987,7 @@ the result will be a local, non-Tramp, file name."
2985 (with-parsed-tramp-file-name default-directory nil 2987 (with-parsed-tramp-file-name default-directory nil
2986 (let (command env uenv input tmpinput stderr tmpstderr outbuf ret) 2988 (let (command env uenv input tmpinput stderr tmpstderr outbuf ret)
2987 ;; Compute command. 2989 ;; Compute command.
2988 (setq command (mapconcat 'tramp-shell-quote-argument 2990 (setq command (mapconcat #'tramp-shell-quote-argument
2989 (cons program args) " ")) 2991 (cons program args) " "))
2990 ;; We use as environment the difference to toplevel `process-environment'. 2992 ;; We use as environment the difference to toplevel `process-environment'.
2991 (dolist (elt process-environment) 2993 (dolist (elt process-environment)
@@ -2999,12 +3001,12 @@ the result will be a local, non-Tramp, file name."
2999 (setq command 3001 (setq command
3000 (format 3002 (format
3001 "env %s %s" 3003 "env %s %s"
3002 (mapconcat 'tramp-shell-quote-argument env " ") command))) 3004 (mapconcat #'tramp-shell-quote-argument env " ") command)))
3003 (when uenv 3005 (when uenv
3004 (setq command 3006 (setq command
3005 (format 3007 (format
3006 "unset %s && %s" 3008 "unset %s && %s"
3007 (mapconcat 'tramp-shell-quote-argument uenv " ") command))) 3009 (mapconcat #'tramp-shell-quote-argument uenv " ") command)))
3008 ;; Determine input. 3010 ;; Determine input.
3009 (if (null infile) 3011 (if (null infile)
3010 (setq input "/dev/null") 3012 (setq input "/dev/null")
@@ -3216,7 +3218,8 @@ the result will be a local, non-Tramp, file name."
3216 (file-writable-p localname))))) 3218 (file-writable-p localname)))))
3217 ;; Short track: if we are on the local host, we can run directly. 3219 ;; Short track: if we are on the local host, we can run directly.
3218 (tramp-run-real-handler 3220 (tramp-run-real-handler
3219 'write-region (list start end localname append 'no-message lockname)) 3221 #'write-region
3222 (list start end localname append 'no-message lockname))
3220 3223
3221 (let* ((modes (save-excursion (tramp-default-file-modes filename))) 3224 (let* ((modes (save-excursion (tramp-default-file-modes filename)))
3222 ;; We use this to save the value of 3225 ;; We use this to save the value of
@@ -3252,7 +3255,7 @@ the result will be a local, non-Tramp, file name."
3252 (tramp-find-file-name-coding-system-alist filename tmpfile))) 3255 (tramp-find-file-name-coding-system-alist filename tmpfile)))
3253 (condition-case err 3256 (condition-case err
3254 (tramp-run-real-handler 3257 (tramp-run-real-handler
3255 'write-region 3258 #'write-region
3256 (list start end tmpfile append 'no-message lockname)) 3259 (list start end tmpfile append 'no-message lockname))
3257 ((error quit) 3260 ((error quit)
3258 (setq tramp-temp-buffer-file-name nil) 3261 (setq tramp-temp-buffer-file-name nil)
@@ -3466,7 +3469,7 @@ the result will be a local, non-Tramp, file name."
3466 ;; Here we collect only file names, which need an operation. 3469 ;; Here we collect only file names, which need an operation.
3467 (tramp-with-demoted-errors 3470 (tramp-with-demoted-errors
3468 v "Error in 1st pass of `vc-registered': %s" 3471 v "Error in 1st pass of `vc-registered': %s"
3469 (tramp-run-real-handler 'vc-registered (list file))) 3472 (tramp-run-real-handler #'vc-registered (list file)))
3470 (tramp-message v 10 "\n%s" tramp-vc-registered-file-names) 3473 (tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
3471 3474
3472 ;; Send just one command, in order to fill the cache. 3475 ;; Send just one command, in order to fill the cache.
@@ -3489,7 +3492,7 @@ the result will be a local, non-Tramp, file name."
3489 (format 3492 (format
3490 "tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n" 3493 "tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n"
3491 tramp-end-of-heredoc 3494 tramp-end-of-heredoc
3492 (mapconcat 'tramp-shell-quote-argument 3495 (mapconcat #'tramp-shell-quote-argument
3493 tramp-vc-registered-file-names 3496 tramp-vc-registered-file-names
3494 "\n") 3497 "\n")
3495 tramp-end-of-heredoc)) 3498 tramp-end-of-heredoc))
@@ -3529,7 +3532,7 @@ the result will be a local, non-Tramp, file name."
3529 ;; Run. 3532 ;; Run.
3530 (tramp-with-demoted-errors 3533 (tramp-with-demoted-errors
3531 v "Error in 2nd pass of `vc-registered': %s" 3534 v "Error in 2nd pass of `vc-registered': %s"
3532 (tramp-run-real-handler 'vc-registered (list file)))))))) 3535 (tramp-run-real-handler #'vc-registered (list file))))))))
3533 3536
3534;;;###tramp-autoload 3537;;;###tramp-autoload
3535(defun tramp-sh-file-name-handler (operation &rest args) 3538(defun tramp-sh-file-name-handler (operation &rest args)
@@ -3551,7 +3554,7 @@ Fall back to normal file name handler if no Tramp handler exists."
3551 (save-match-data 3554 (save-match-data
3552 (let ((filename 3555 (let ((filename
3553 (tramp-replace-environment-variables 3556 (tramp-replace-environment-variables
3554 (apply 'tramp-file-name-for-operation operation args))) 3557 (apply #'tramp-file-name-for-operation operation args)))
3555 (fn (assoc operation tramp-sh-file-name-handler-alist))) 3558 (fn (assoc operation tramp-sh-file-name-handler-alist)))
3556 (with-parsed-tramp-file-name filename nil 3559 (with-parsed-tramp-file-name filename nil
3557 (cond 3560 (cond
@@ -3581,7 +3584,7 @@ Fall back to normal file name handler if no Tramp handler exists."
3581 (cond 3584 (cond
3582 ;; "inotifywait". 3585 ;; "inotifywait".
3583 ((setq command (tramp-get-remote-inotifywait v)) 3586 ((setq command (tramp-get-remote-inotifywait v))
3584 (setq filter 'tramp-sh-inotifywait-process-filter 3587 (setq filter #'tramp-sh-inotifywait-process-filter
3585 events 3588 events
3586 (cond 3589 (cond
3587 ((and (memq 'change flags) (memq 'attribute-change flags)) 3590 ((and (memq 'change flags) (memq 'attribute-change flags))
@@ -3601,7 +3604,7 @@ Fall back to normal file name handler if no Tramp handler exists."
3601 (split-string events "," 'omit)))) 3604 (split-string events "," 'omit))))
3602 ;; "gio monitor". 3605 ;; "gio monitor".
3603 ((setq command (tramp-get-remote-gio-monitor v)) 3606 ((setq command (tramp-get-remote-gio-monitor v))
3604 (setq filter 'tramp-sh-gio-monitor-process-filter 3607 (setq filter #'tramp-sh-gio-monitor-process-filter
3605 events 3608 events
3606 (cond 3609 (cond
3607 ((and (memq 'change flags) (memq 'attribute-change flags)) 3610 ((and (memq 'change flags) (memq 'attribute-change flags))
@@ -3630,7 +3633,7 @@ Fall back to normal file name handler if no Tramp handler exists."
3630 (file-remote-p file-name)))) 3633 (file-remote-p file-name))))
3631 ;; Start process. 3634 ;; Start process.
3632 (setq p (apply 3635 (setq p (apply
3633 'start-file-process 3636 #'start-file-process
3634 (file-name-nondirectory command) 3637 (file-name-nondirectory command)
3635 (generate-new-buffer 3638 (generate-new-buffer
3636 (format " *%s*" (file-name-nondirectory command))) 3639 (format " *%s*" (file-name-nondirectory command)))
@@ -3640,8 +3643,8 @@ Fall back to normal file name handler if no Tramp handler exists."
3640 (tramp-error 3643 (tramp-error
3641 v 'file-notify-error 3644 v 'file-notify-error
3642 "`%s' failed to start on remote host" 3645 "`%s' failed to start on remote host"
3643 (mapconcat 'identity sequence " ")) 3646 (mapconcat #'identity sequence " "))
3644 (tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p) 3647 (tramp-message v 6 "Run `%s', %S" (mapconcat #'identity sequence " ") p)
3645 (process-put p 'vector v) 3648 (process-put p 'vector v)
3646 ;; Needed for process filter. 3649 ;; Needed for process filter.
3647 (process-put p 'events events) 3650 (process-put p 'events events)
@@ -3942,7 +3945,7 @@ This function expects to be in the right *tramp* buffer."
3942 "%s\n%s")) 3945 "%s\n%s"))
3943 progname progname progname 3946 progname progname progname
3944 tramp-end-of-heredoc 3947 tramp-end-of-heredoc
3945 (mapconcat 'identity dirlist "\n") 3948 (mapconcat #'identity dirlist "\n")
3946 tramp-end-of-heredoc)) 3949 tramp-end-of-heredoc))
3947 (goto-char (point-max)) 3950 (goto-char (point-max))
3948 (when (search-backward "tramp_executable " nil t) 3951 (when (search-backward "tramp_executable " nil t)
@@ -3961,7 +3964,7 @@ whether it exists and if so, it is added to the environment
3961variable PATH." 3964variable PATH."
3962 (let ((command 3965 (let ((command
3963 (format "PATH=%s; export PATH" 3966 (format "PATH=%s; export PATH"
3964 (mapconcat 'identity (tramp-get-remote-path vec) ":"))) 3967 (mapconcat #'identity (tramp-get-remote-path vec) ":")))
3965 (pipe-buf 3968 (pipe-buf
3966 (or (with-tramp-connection-property vec "pipe-buf" 3969 (or (with-tramp-connection-property vec "pipe-buf"
3967 (tramp-send-command-and-read 3970 (tramp-send-command-and-read
@@ -4154,7 +4157,7 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
4154 "\\(%s\\|%s\\)\\'" shell-prompt-pattern tramp-shell-prompt-pattern)) 4157 "\\(%s\\|%s\\)\\'" shell-prompt-pattern tramp-shell-prompt-pattern))
4155 (error 4158 (error
4156 (delete-process proc) 4159 (delete-process proc)
4157 (apply 'tramp-error-with-buffer 4160 (apply #'tramp-error-with-buffer
4158 (tramp-get-connection-buffer vec) vec 'file-error error-args))))) 4161 (tramp-get-connection-buffer vec) vec 'file-error error-args)))))
4159 4162
4160(defun tramp-open-connection-setup-interactive-shell (proc vec) 4163(defun tramp-open-connection-setup-interactive-shell (proc vec)
@@ -4304,7 +4307,7 @@ process to set up. VEC specifies the connection."
4304 (append `(,(tramp-get-remote-locale vec)) 4307 (append `(,(tramp-get-remote-locale vec))
4305 (copy-sequence tramp-remote-process-environment)))) 4308 (copy-sequence tramp-remote-process-environment))))
4306 (setq item (split-string item "=" 'omit)) 4309 (setq item (split-string item "=" 'omit))
4307 (setcdr item (mapconcat 'identity (cdr item) "=")) 4310 (setcdr item (mapconcat #'identity (cdr item) "="))
4308 (if (and (stringp (cdr item)) (not (string-equal (cdr item) ""))) 4311 (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
4309 (push (format "%s %s" (car item) (cdr item)) vars) 4312 (push (format "%s %s" (car item) (cdr item)) vars)
4310 (push (car item) unset))) 4313 (push (car item) unset)))
@@ -4314,12 +4317,12 @@ process to set up. VEC specifies the connection."
4314 (format 4317 (format
4315 "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s" 4318 "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s"
4316 tramp-end-of-heredoc 4319 tramp-end-of-heredoc
4317 (mapconcat 'identity vars "\n") 4320 (mapconcat #'identity vars "\n")
4318 tramp-end-of-heredoc) 4321 tramp-end-of-heredoc)
4319 t)) 4322 t))
4320 (when unset 4323 (when unset
4321 (tramp-send-command 4324 (tramp-send-command
4322 vec (format "unset %s" (mapconcat 'identity unset " ")) t))))) 4325 vec (format "unset %s" (mapconcat #'identity unset " ")) t)))))
4323 4326
4324;; Old text from documentation of tramp-methods: 4327;; Old text from documentation of tramp-methods:
4325;; Using a uuencode/uudecode inline method is discouraged, please use one 4328;; Using a uuencode/uudecode inline method is discouraged, please use one
@@ -4581,9 +4584,9 @@ Goes through the list `tramp-inline-compress-commands'."
4581 ;; the pipe symbol be quoted if they use forward 4584 ;; the pipe symbol be quoted if they use forward
4582 ;; slashes as directory separators. 4585 ;; slashes as directory separators.
4583 (mapconcat 4586 (mapconcat
4584 'shell-quote-argument (split-string compress) " ") 4587 #'shell-quote-argument (split-string compress) " ")
4585 (mapconcat 4588 (mapconcat
4586 'shell-quote-argument (split-string decompress) " ")) 4589 #'shell-quote-argument (split-string decompress) " "))
4587 nil nil)) 4590 nil nil))
4588 (throw 'next nil)) 4591 (throw 'next nil))
4589 (tramp-message 4592 (tramp-message
@@ -4871,7 +4874,7 @@ connection if a previous connection has died for some reason."
4871 (p (let ((default-directory 4874 (p (let ((default-directory
4872 (tramp-compat-temporary-file-directory))) 4875 (tramp-compat-temporary-file-directory)))
4873 (apply 4876 (apply
4874 'start-process 4877 #'start-process
4875 (tramp-get-connection-name vec) 4878 (tramp-get-connection-name vec)
4876 (tramp-get-connection-buffer vec) 4879 (tramp-get-connection-buffer vec)
4877 (if tramp-encoding-command-interactive 4880 (if tramp-encoding-command-interactive
@@ -4882,12 +4885,12 @@ connection if a previous connection has died for some reason."
4882 ;; Set sentinel and query flag. Initialize variables. 4885 ;; Set sentinel and query flag. Initialize variables.
4883 (set-process-sentinel p 'tramp-process-sentinel) 4886 (set-process-sentinel p 'tramp-process-sentinel)
4884 (process-put p 'vector vec) 4887 (process-put p 'vector vec)
4885 (process-put p 'adjust-window-size-function 'ignore) 4888 (process-put p 'adjust-window-size-function #'ignore)
4886 (set-process-query-on-exit-flag p nil) 4889 (set-process-query-on-exit-flag p nil)
4887 (setq tramp-current-connection (cons vec (current-time))) 4890 (setq tramp-current-connection (cons vec (current-time)))
4888 4891
4889 (tramp-message 4892 (tramp-message
4890 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 4893 vec 6 "%s" (mapconcat #'identity (process-command p) " "))
4891 4894
4892 ;; Check whether process is alive. 4895 ;; Check whether process is alive.
4893 (tramp-barf-if-no-shell-prompt 4896 (tramp-barf-if-no-shell-prompt
@@ -4964,7 +4967,7 @@ connection if a previous connection has died for some reason."
4964 (mapcar 4967 (mapcar
4965 (lambda (x) 4968 (lambda (x)
4966 (setq x (mapcar (lambda (y) (format-spec y spec)) x)) 4969 (setq x (mapcar (lambda (y) (format-spec y spec)) x))
4967 (unless (member "" x) (mapconcat 'identity x " "))) 4970 (unless (member "" x) (mapconcat #'identity x " ")))
4968 login-env)) 4971 login-env))
4969 (while login-env 4972 (while login-env
4970 (setq command 4973 (setq command
@@ -4993,7 +4996,7 @@ connection if a previous connection has died for some reason."
4993 (mapconcat 4996 (mapconcat
4994 (lambda (x) 4997 (lambda (x)
4995 (setq x (mapcar (lambda (y) (format-spec y spec)) x)) 4998 (setq x (mapcar (lambda (y) (format-spec y spec)) x))
4996 (unless (member "" x) (mapconcat 'identity x " "))) 4999 (unless (member "" x) (mapconcat #'identity x " ")))
4997 login-args " ") 5000 login-args " ")
4998 ;; Local shell could be a Windows COMSPEC. It 5001 ;; Local shell could be a Windows COMSPEC. It
4999 ;; doesn't know the ";" syntax, but we must exit 5002 ;; doesn't know the ";" syntax, but we must exit
@@ -5140,7 +5143,7 @@ DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to /dev/null."
5140Similar to `tramp-send-command-and-check' but accepts two more arguments 5143Similar to `tramp-send-command-and-check' but accepts two more arguments
5141FMT and ARGS which are passed to `error'." 5144FMT and ARGS which are passed to `error'."
5142 (or (tramp-send-command-and-check vec command) 5145 (or (tramp-send-command-and-check vec command)
5143 (apply 'tramp-error vec 'file-error fmt args))) 5146 (apply #'tramp-error vec 'file-error fmt args)))
5144 5147
5145(defun tramp-send-command-and-read (vec command &optional noerror marker) 5148(defun tramp-send-command-and-read (vec command &optional noerror marker)
5146 "Run COMMAND and return the output, which must be a Lisp expression. 5149 "Run COMMAND and return the output, which must be a Lisp expression.
@@ -5342,11 +5345,11 @@ Nonexistent directories are removed from spec."
5342 "%s %s %s 'echo %s \\\"$PATH\\\"'" 5345 "%s %s %s 'echo %s \\\"$PATH\\\"'"
5343 (tramp-get-method-parameter vec 'tramp-remote-shell) 5346 (tramp-get-method-parameter vec 'tramp-remote-shell)
5344 (mapconcat 5347 (mapconcat
5345 'identity 5348 #'identity
5346 (tramp-get-method-parameter vec 'tramp-remote-shell-login) 5349 (tramp-get-method-parameter vec 'tramp-remote-shell-login)
5347 " ") 5350 " ")
5348 (mapconcat 5351 (mapconcat
5349 'identity 5352 #'identity
5350 (tramp-get-method-parameter vec 'tramp-remote-shell-args) 5353 (tramp-get-method-parameter vec 'tramp-remote-shell-args)
5351 " ") 5354 " ")
5352 (tramp-shell-quote-argument tramp-end-of-heredoc)) 5355 (tramp-shell-quote-argument tramp-end-of-heredoc))
@@ -5679,7 +5682,7 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil."
5679 (tramp-get-remote-python vec) 5682 (tramp-get-remote-python vec)
5680 (if (equal id-format 'integer) 5683 (if (equal id-format 'integer)
5681 "import os; print (os.getuid())" 5684 "import os; print (os.getuid())"
5682 "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')")))) 5685 "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')"))))
5683 5686
5684(defun tramp-get-remote-uid (vec id-format) 5687(defun tramp-get-remote-uid (vec id-format)
5685 "The uid of the remote connection VEC, in ID-FORMAT. 5688 "The uid of the remote connection VEC, in ID-FORMAT.
@@ -5730,7 +5733,7 @@ ID-FORMAT valid values are `string' and `integer'."
5730 (tramp-get-remote-python vec) 5733 (tramp-get-remote-python vec)
5731 (if (equal id-format 'integer) 5734 (if (equal id-format 'integer)
5732 "import os; print (os.getgid())" 5735 "import os; print (os.getgid())"
5733 "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')")))) 5736 "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')"))))
5734 5737
5735(defun tramp-get-remote-gid (vec id-format) 5738(defun tramp-get-remote-gid (vec id-format)
5736 "The gid of the remote connection VEC, in ID-FORMAT. 5739 "The gid of the remote connection VEC, in ID-FORMAT.
@@ -5819,14 +5822,14 @@ function cell is returned to be applied on a buffer."
5819 (let ((coding-system-for-write 'binary) 5822 (let ((coding-system-for-write 'binary)
5820 (coding-system-for-read 'binary)) 5823 (coding-system-for-read 'binary))
5821 (apply 5824 (apply
5822 'tramp-call-process-region ',vec (point-min) (point-max) 5825 #'tramp-call-process-region ',vec (point-min) (point-max)
5823 (car (split-string ,compress)) t t nil 5826 (car (split-string ,compress)) t t nil
5824 (cdr (split-string ,compress))))) 5827 (cdr (split-string ,compress)))))
5825 `(lambda (beg end) 5828 `(lambda (beg end)
5826 (let ((coding-system-for-write 'binary) 5829 (let ((coding-system-for-write 'binary)
5827 (coding-system-for-read 'binary)) 5830 (coding-system-for-read 'binary))
5828 (apply 5831 (apply
5829 'tramp-call-process-region ',vec beg end 5832 #'tramp-call-process-region ',vec beg end
5830 (car (split-string ,compress)) t t nil 5833 (car (split-string ,compress)) t t nil
5831 (cdr (split-string ,compress)))) 5834 (cdr (split-string ,compress))))
5832 (,coding (point-min) (point-max))))) 5835 (,coding (point-min) (point-max)))))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index eda30812ebc..64a8fa22507 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -100,7 +100,7 @@ call, letting the SMB client use the default one."
100 100
101(defconst tramp-smb-errors 101(defconst tramp-smb-errors
102 (mapconcat 102 (mapconcat
103 'identity 103 #'identity
104 `(;; Connection error / timeout / unknown command. 104 `(;; Connection error / timeout / unknown command.
105 "Connection\\( to \\S-+\\)? failed" 105 "Connection\\( to \\S-+\\)? failed"
106 "Read from server failed, maybe it closed the connection" 106 "Read from server failed, maybe it closed the connection"
@@ -405,7 +405,7 @@ pass to the OPERATION."
405 (if copy-contents 405 (if copy-contents
406 ;; We must do it file-wise. 406 ;; We must do it file-wise.
407 (tramp-run-real-handler 407 (tramp-run-real-handler
408 'copy-directory (list dirname newname keep-date parents copy-contents)) 408 #'copy-directory (list dirname newname keep-date parents copy-contents))
409 409
410 (setq dirname (expand-file-name dirname) 410 (setq dirname (expand-file-name dirname)
411 newname (expand-file-name newname)) 411 newname (expand-file-name newname))
@@ -511,15 +511,15 @@ pass to the OPERATION."
511 ;; password can be handled. 511 ;; password can be handled.
512 (let* ((default-directory tmpdir) 512 (let* ((default-directory tmpdir)
513 (p (apply 513 (p (apply
514 'start-process 514 #'start-process
515 (tramp-get-connection-name v) 515 (tramp-get-connection-name v)
516 (tramp-get-connection-buffer v) 516 (tramp-get-connection-buffer v)
517 tramp-smb-program args))) 517 tramp-smb-program args)))
518 518
519 (tramp-message 519 (tramp-message
520 v 6 "%s" (mapconcat 'identity (process-command p) " ")) 520 v 6 "%s" (mapconcat #'identity (process-command p) " "))
521 (process-put p 'vector v) 521 (process-put p 'vector v)
522 (process-put p 'adjust-window-size-function 'ignore) 522 (process-put p 'adjust-window-size-function #'ignore)
523 (set-process-query-on-exit-flag p nil) 523 (set-process-query-on-exit-flag p nil)
524 (tramp-process-actions p v nil tramp-smb-actions-with-tar) 524 (tramp-process-actions p v nil tramp-smb-actions-with-tar)
525 525
@@ -552,7 +552,7 @@ pass to the OPERATION."
552 ;; We must do it file-wise. 552 ;; We must do it file-wise.
553 (t 553 (t
554 (tramp-run-real-handler 554 (tramp-run-real-handler
555 'copy-directory (list dirname newname keep-date parents))))))))) 555 #'copy-directory (list dirname newname keep-date parents)))))))))
556 556
557(defun tramp-smb-handle-copy-file 557(defun tramp-smb-handle-copy-file
558 (filename newname &optional ok-if-already-exists keep-date 558 (filename newname &optional ok-if-already-exists keep-date
@@ -670,7 +670,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
670(defun tramp-smb-handle-directory-files 670(defun tramp-smb-handle-directory-files
671 (directory &optional full match nosort) 671 (directory &optional full match nosort)
672 "Like `directory-files' for Tramp files." 672 "Like `directory-files' for Tramp files."
673 (let ((result (mapcar 'directory-file-name 673 (let ((result (mapcar #'directory-file-name
674 (file-name-all-completions "" directory)))) 674 (file-name-all-completions "" directory))))
675 ;; Discriminate with regexp. 675 ;; Discriminate with regexp.
676 (when match 676 (when match
@@ -685,7 +685,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
685 (lambda (x) (format "%s/%s" directory x)) 685 (lambda (x) (format "%s/%s" directory x))
686 result))) 686 result)))
687 ;; Sort them if necessary. 687 ;; Sort them if necessary.
688 (unless nosort (setq result (sort result 'string-lessp))) 688 (unless nosort (setq result (sort result #'string-lessp)))
689 result)) 689 result))
690 690
691(defun tramp-smb-handle-expand-file-name (name &optional dir) 691(defun tramp-smb-handle-expand-file-name (name &optional dir)
@@ -697,7 +697,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
697 (setq name (concat (file-name-as-directory dir) name))) 697 (setq name (concat (file-name-as-directory dir) name)))
698 ;; If NAME is not a Tramp file, run the real handler. 698 ;; If NAME is not a Tramp file, run the real handler.
699 (if (not (tramp-tramp-file-p name)) 699 (if (not (tramp-tramp-file-p name))
700 (tramp-run-real-handler 'expand-file-name (list name nil)) 700 (tramp-run-real-handler #'expand-file-name (list name nil))
701 ;; Dissect NAME. 701 ;; Dissect NAME.
702 (with-parsed-tramp-file-name name nil 702 (with-parsed-tramp-file-name name nil
703 ;; Tilde expansion if necessary. We use the user name as share, 703 ;; Tilde expansion if necessary. We use the user name as share,
@@ -710,12 +710,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
710 (match-string 1 localname)) 710 (match-string 1 localname))
711 nil nil localname))) 711 nil nil localname)))
712 ;; Make the file name absolute. 712 ;; Make the file name absolute.
713 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) 713 (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
714 (setq localname (concat "/" localname))) 714 (setq localname (concat "/" localname)))
715 ;; No tilde characters in file name, do normal 715 ;; No tilde characters in file name, do normal
716 ;; `expand-file-name' (this does "/./" and "/../"). 716 ;; `expand-file-name' (this does "/./" and "/../").
717 (tramp-make-tramp-file-name 717 (tramp-make-tramp-file-name
718 v (tramp-run-real-handler 'expand-file-name (list localname)))))) 718 v (tramp-run-real-handler #'expand-file-name (list localname))))))
719 719
720(defun tramp-smb-action-get-acl (proc vec) 720(defun tramp-smb-action-get-acl (proc vec)
721 "Read ACL data from connection buffer." 721 "Read ACL data from connection buffer."
@@ -772,15 +772,15 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
772 ;; Use an asynchronous process. By this, password can 772 ;; Use an asynchronous process. By this, password can
773 ;; be handled. 773 ;; be handled.
774 (let ((p (apply 774 (let ((p (apply
775 'start-process 775 #'start-process
776 (tramp-get-connection-name v) 776 (tramp-get-connection-name v)
777 (tramp-get-connection-buffer v) 777 (tramp-get-connection-buffer v)
778 tramp-smb-acl-program args))) 778 tramp-smb-acl-program args)))
779 779
780 (tramp-message 780 (tramp-message
781 v 6 "%s" (mapconcat 'identity (process-command p) " ")) 781 v 6 "%s" (mapconcat #'identity (process-command p) " "))
782 (process-put p 'vector v) 782 (process-put p 'vector v)
783 (process-put p 'adjust-window-size-function 'ignore) 783 (process-put p 'adjust-window-size-function #'ignore)
784 (set-process-query-on-exit-flag p nil) 784 (set-process-query-on-exit-flag p nil)
785 (tramp-process-actions p v nil tramp-smb-actions-get-acl) 785 (tramp-process-actions p v nil tramp-smb-actions-get-acl)
786 (when (> (point-max) (point-min)) 786 (when (> (point-max) (point-min))
@@ -1163,7 +1163,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
1163component is used as the target of the symlink." 1163component is used as the target of the symlink."
1164 (if (not (tramp-tramp-file-p (expand-file-name linkname))) 1164 (if (not (tramp-tramp-file-p (expand-file-name linkname)))
1165 (tramp-run-real-handler 1165 (tramp-run-real-handler
1166 'make-symbolic-link (list target linkname ok-if-already-exists)) 1166 #'make-symbolic-link (list target linkname ok-if-already-exists))
1167 1167
1168 (with-parsed-tramp-file-name linkname nil 1168 (with-parsed-tramp-file-name linkname nil
1169 ;; If TARGET is a Tramp name, use just the localname component. 1169 ;; If TARGET is a Tramp name, use just the localname component.
@@ -1262,7 +1262,7 @@ component is used as the target of the symlink."
1262 (setq outbuf (current-buffer)))) 1262 (setq outbuf (current-buffer))))
1263 1263
1264 ;; Construct command. 1264 ;; Construct command.
1265 (setq command (mapconcat 'identity (cons program args) " ") 1265 (setq command (mapconcat #'identity (cons program args) " ")
1266 command (if input 1266 command (if input
1267 (format 1267 (format
1268 "get-content %s | & %s" 1268 "get-content %s | & %s"
@@ -1426,15 +1426,15 @@ component is used as the target of the symlink."
1426 ;; Use an asynchronous process. By this, password can 1426 ;; Use an asynchronous process. By this, password can
1427 ;; be handled. 1427 ;; be handled.
1428 (let ((p (apply 1428 (let ((p (apply
1429 'start-process 1429 #'start-process
1430 (tramp-get-connection-name v) 1430 (tramp-get-connection-name v)
1431 (tramp-get-connection-buffer v) 1431 (tramp-get-connection-buffer v)
1432 tramp-smb-acl-program args))) 1432 tramp-smb-acl-program args)))
1433 1433
1434 (tramp-message 1434 (tramp-message
1435 v 6 "%s" (mapconcat 'identity (process-command p) " ")) 1435 v 6 "%s" (mapconcat #'identity (process-command p) " "))
1436 (process-put p 'vector v) 1436 (process-put p 'vector v)
1437 (process-put p 'adjust-window-size-function 'ignore) 1437 (process-put p 'adjust-window-size-function #'ignore)
1438 (set-process-query-on-exit-flag p nil) 1438 (set-process-query-on-exit-flag p nil)
1439 (tramp-process-actions p v nil tramp-smb-actions-set-acl) 1439 (tramp-process-actions p v nil tramp-smb-actions-set-acl)
1440 (goto-char (point-max)) 1440 (goto-char (point-max))
@@ -1476,7 +1476,7 @@ component is used as the target of the symlink."
1476 (get-buffer-create buffer) 1476 (get-buffer-create buffer)
1477 ;; BUFFER can be nil. We use a temporary buffer. 1477 ;; BUFFER can be nil. We use a temporary buffer.
1478 (generate-new-buffer tramp-temp-buffer-name))) 1478 (generate-new-buffer tramp-temp-buffer-name)))
1479 (command (mapconcat 'identity (cons program args) " ")) 1479 (command (mapconcat #'identity (cons program args) " "))
1480 (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer))) 1480 (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
1481 (name1 name) 1481 (name1 name)
1482 (i 0) 1482 (i 0)
@@ -1531,7 +1531,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1531 (concat (file-remote-p filename) 1531 (concat (file-remote-p filename)
1532 (replace-match "\\1" nil nil localname))))) 1532 (replace-match "\\1" nil nil localname)))))
1533 (condition-case nil 1533 (condition-case nil
1534 (tramp-run-real-handler 'substitute-in-file-name (list filename)) 1534 (tramp-run-real-handler #'substitute-in-file-name (list filename))
1535 (error filename)))) 1535 (error filename))))
1536 1536
1537(defun tramp-smb-handle-write-region 1537(defun tramp-smb-handle-write-region
@@ -1558,7 +1558,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1558 ;; modtime data to be clobbered from the temp file. We call 1558 ;; modtime data to be clobbered from the temp file. We call
1559 ;; `set-visited-file-modtime' ourselves later on. 1559 ;; `set-visited-file-modtime' ourselves later on.
1560 (tramp-run-real-handler 1560 (tramp-run-real-handler
1561 'write-region (list start end tmpfile append 'no-message lockname)) 1561 #'write-region (list start end tmpfile append 'no-message lockname))
1562 1562
1563 (with-tramp-progress-reporter 1563 (with-tramp-progress-reporter
1564 v 3 (format "Moving tmp file %s to %s" tmpfile filename) 1564 v 3 (format "Moving tmp file %s to %s" tmpfile filename)
@@ -1974,9 +1974,9 @@ If ARGUMENT is non-nil, use it as argument for
1974 args)))) 1974 args))))
1975 1975
1976 (tramp-message 1976 (tramp-message
1977 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 1977 vec 6 "%s" (mapconcat #'identity (process-command p) " "))
1978 (process-put p 'vector vec) 1978 (process-put p 'vector vec)
1979 (process-put p 'adjust-window-size-function 'ignore) 1979 (process-put p 'adjust-window-size-function #'ignore)
1980 (set-process-query-on-exit-flag p nil) 1980 (set-process-query-on-exit-flag p nil)
1981 1981
1982 (condition-case err 1982 (condition-case err
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 60eb2125030..42deaf37975 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -314,7 +314,7 @@ absolute file names."
314 'copy filename newname ok-if-already-exists keep-date 314 'copy filename newname ok-if-already-exists keep-date
315 preserve-uid-gid preserve-extended-attributes) 315 preserve-uid-gid preserve-extended-attributes)
316 (tramp-run-real-handler 316 (tramp-run-real-handler
317 'copy-file 317 #'copy-file
318 (list filename newname ok-if-already-exists keep-date 318 (list filename newname ok-if-already-exists keep-date
319 preserve-uid-gid preserve-extended-attributes)))) 319 preserve-uid-gid preserve-extended-attributes))))
320 320
@@ -542,7 +542,7 @@ the result will be a local, non-Tramp, file name."
542 ;; Preserve trailing "/". 542 ;; Preserve trailing "/".
543 (funcall 543 (funcall
544 (if (string-equal (file-name-nondirectory filename) "") 544 (if (string-equal (file-name-nondirectory filename) "")
545 'file-name-as-directory 'identity) 545 #'file-name-as-directory #'identity)
546 (with-parsed-tramp-file-name (expand-file-name filename) nil 546 (with-parsed-tramp-file-name (expand-file-name filename) nil
547 (tramp-make-tramp-file-name 547 (tramp-make-tramp-file-name
548 v 548 v
@@ -601,7 +601,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
601component is used as the target of the symlink." 601component is used as the target of the symlink."
602 (if (not (tramp-tramp-file-p (expand-file-name linkname))) 602 (if (not (tramp-tramp-file-p (expand-file-name linkname)))
603 (tramp-run-real-handler 603 (tramp-run-real-handler
604 'make-symbolic-link (list target linkname ok-if-already-exists)) 604 #'make-symbolic-link (list target linkname ok-if-already-exists))
605 605
606 (with-parsed-tramp-file-name linkname nil 606 (with-parsed-tramp-file-name linkname nil
607 ;; If TARGET is a Tramp name, use just the localname component. 607 ;; If TARGET is a Tramp name, use just the localname component.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c2636274a34..420a72d42ef 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1506,7 +1506,7 @@ the form (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP)."
1506 ;; Unless `tramp-syntax' is `simplified', we need a method. 1506 ;; Unless `tramp-syntax' is `simplified', we need a method.
1507 (when (and (not (zerop (length tramp-postfix-method-format))) 1507 (when (and (not (zerop (length tramp-postfix-method-format)))
1508 (zerop (length method))) 1508 (zerop (length method)))
1509 (signal 'wrong-type-argument (list 'stringp method))) 1509 (signal 'wrong-type-argument (list #'stringp method)))
1510 (concat tramp-prefix-format hop 1510 (concat tramp-prefix-format hop
1511 (unless (zerop (length tramp-postfix-method-format)) 1511 (unless (zerop (length tramp-postfix-method-format))
1512 (concat method tramp-postfix-method-format)) 1512 (concat method tramp-postfix-method-format))
@@ -1746,7 +1746,7 @@ applicable)."
1746 (when (<= level tramp-verbose) 1746 (when (<= level tramp-verbose)
1747 ;; Display only when there is a minimum level. 1747 ;; Display only when there is a minimum level.
1748 (when (and tramp-message-show-message (<= level 3)) 1748 (when (and tramp-message-show-message (<= level 3))
1749 (apply 'message 1749 (apply #'message
1750 (concat 1750 (concat
1751 (cond 1751 (cond
1752 ((= level 0) "") 1752 ((= level 0) "")
@@ -1771,7 +1771,7 @@ applicable)."
1771 (setq vec-or-proc (process-get vec-or-proc 'vector)))) 1771 (setq vec-or-proc (process-get vec-or-proc 'vector))))
1772 ;; Do it. 1772 ;; Do it.
1773 (when (tramp-file-name-p vec-or-proc) 1773 (when (tramp-file-name-p vec-or-proc)
1774 (apply 'tramp-debug-message 1774 (apply #'tramp-debug-message
1775 vec-or-proc 1775 vec-or-proc
1776 (concat (format "(%d) # " level) fmt-string) 1776 (concat (format "(%d) # " level) fmt-string)
1777 arguments)))))) 1777 arguments))))))
@@ -1822,7 +1822,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
1822 (and buf (with-current-buffer buf 1822 (and buf (with-current-buffer buf
1823 (tramp-dissect-file-name default-directory)))))) 1823 (tramp-dissect-file-name default-directory))))))
1824 (unwind-protect 1824 (unwind-protect
1825 (apply 'tramp-error vec-or-proc signal fmt-string arguments) 1825 (apply #'tramp-error vec-or-proc signal fmt-string arguments)
1826 ;; Save exit. 1826 ;; Save exit.
1827 (when (and buf 1827 (when (and buf
1828 tramp-message-show-message 1828 tramp-message-show-message
@@ -1834,7 +1834,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
1834 (let ((enable-recursive-minibuffers t)) 1834 (let ((enable-recursive-minibuffers t))
1835 ;; `tramp-error' does not show messages. So we must do it 1835 ;; `tramp-error' does not show messages. So we must do it
1836 ;; ourselves. 1836 ;; ourselves.
1837 (apply 'message fmt-string arguments) 1837 (apply #'message fmt-string arguments)
1838 ;; Show buffer. 1838 ;; Show buffer.
1839 (pop-to-buffer buf) 1839 (pop-to-buffer buf)
1840 (discard-input) 1840 (discard-input)
@@ -1848,7 +1848,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
1848 "Signal a pilot error." 1848 "Signal a pilot error."
1849 (unwind-protect 1849 (unwind-protect
1850 (apply 1850 (apply
1851 'tramp-error vec-or-proc 1851 #'tramp-error vec-or-proc
1852 ;; `user-error' has appeared in Emacs 24.3. 1852 ;; `user-error' has appeared in Emacs 24.3.
1853 (if (fboundp 'user-error) 'user-error 'error) fmt-string arguments) 1853 (if (fboundp 'user-error) 'user-error 'error) fmt-string arguments)
1854 ;; Save exit. 1854 ;; Save exit.
@@ -1860,7 +1860,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
1860 (current-message)) 1860 (current-message))
1861 (let ((enable-recursive-minibuffers t)) 1861 (let ((enable-recursive-minibuffers t))
1862 ;; `tramp-error' does not show messages. So we must do it ourselves. 1862 ;; `tramp-error' does not show messages. So we must do it ourselves.
1863 (apply 'message fmt-string arguments) 1863 (apply #'message fmt-string arguments)
1864 (discard-input) 1864 (discard-input)
1865 (sit-for 30) 1865 (sit-for 30)
1866 ;; Reset timestamp. It would be wrong after waiting for a while. 1866 ;; Reset timestamp. It would be wrong after waiting for a while.
@@ -1991,7 +1991,7 @@ letter into the file name. This function removes it."
1991 (save-match-data 1991 (save-match-data
1992 (funcall 1992 (funcall
1993 (if (tramp-compat-file-name-quoted-p name) 1993 (if (tramp-compat-file-name-quoted-p name)
1994 'tramp-compat-file-name-quote 'identity) 1994 #'tramp-compat-file-name-quote #'identity)
1995 (let ((name (tramp-compat-file-name-unquote name))) 1995 (let ((name (tramp-compat-file-name-unquote name)))
1996 (if (string-match "\\`[a-zA-Z]:/" name) 1996 (if (string-match "\\`[a-zA-Z]:/" name)
1997 (replace-match "/" nil t name) 1997 (replace-match "/" nil t name)
@@ -2274,7 +2274,7 @@ preventing reentrant calls of Tramp.")
2274(defun tramp-file-name-handler (operation &rest args) 2274(defun tramp-file-name-handler (operation &rest args)
2275 "Invoke Tramp file name handler. 2275 "Invoke Tramp file name handler.
2276Falls back to normal file name handler if no Tramp file name handler exists." 2276Falls back to normal file name handler if no Tramp file name handler exists."
2277 (let ((filename (apply 'tramp-file-name-for-operation operation args))) 2277 (let ((filename (apply #'tramp-file-name-for-operation operation args)))
2278 (if (tramp-tramp-file-p filename) 2278 (if (tramp-tramp-file-p filename)
2279 (save-match-data 2279 (save-match-data
2280 (setq filename (tramp-replace-environment-variables filename)) 2280 (setq filename (tramp-replace-environment-variables filename))
@@ -2419,7 +2419,7 @@ remote file names."
2419 "^%s$" 2419 "^%s$"
2420 (regexp-opt 2420 (regexp-opt
2421 (mapcar 2421 (mapcar
2422 'file-name-sans-extension 2422 #'file-name-sans-extension
2423 (directory-files dir nil "^tramp.+\\.elc?$")) 2423 (directory-files dir nil "^tramp.+\\.elc?$"))
2424 'paren)))) 2424 'paren))))
2425 (mapatoms 2425 (mapatoms
@@ -2453,7 +2453,7 @@ remote file names."
2453 (put 'tramp-completion-file-name-handler 'safe-magic t) 2453 (put 'tramp-completion-file-name-handler 'safe-magic t)
2454 ;; Mark `operations' the handler is responsible for. 2454 ;; Mark `operations' the handler is responsible for.
2455 (put 'tramp-completion-file-name-handler 'operations 2455 (put 'tramp-completion-file-name-handler 'operations
2456 (mapcar 'car tramp-completion-file-name-handler-alist)) 2456 (mapcar #'car tramp-completion-file-name-handler-alist))
2457 2457
2458 (when (bound-and-true-p tramp-archive-enabled) 2458 (when (bound-and-true-p tramp-archive-enabled)
2459 (add-to-list 'file-name-handler-alist 2459 (add-to-list 'file-name-handler-alist
@@ -2516,7 +2516,7 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
2516 (string-prefix-p "tramp-" (symbol-name (cdr fnh)))) 2516 (string-prefix-p "tramp-" (symbol-name (cdr fnh))))
2517 (setq file-name-handler-alist (delq fnh file-name-handler-alist)))))) 2517 (setq file-name-handler-alist (delq fnh file-name-handler-alist))))))
2518 2518
2519(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) 2519(add-hook 'tramp-unload-hook #'tramp-unload-file-name-handlers)
2520 2520
2521;;; File name handler functions for completion mode: 2521;;; File name handler functions for completion mode:
2522 2522
@@ -2621,7 +2621,7 @@ not in completion mode."
2621 "Like `file-name-completion' for Tramp files." 2621 "Like `file-name-completion' for Tramp files."
2622 (try-completion 2622 (try-completion
2623 filename 2623 filename
2624 (mapcar 'list (file-name-all-completions filename directory)) 2624 (mapcar #'list (file-name-all-completions filename directory))
2625 (when (and predicate 2625 (when (and predicate
2626 (tramp-connectable-p (expand-file-name filename directory))) 2626 (tramp-connectable-p (expand-file-name filename directory)))
2627 (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) 2627 (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
@@ -2739,7 +2739,7 @@ remote host and localname (filename on remote host)."
2739 (and method 2739 (and method
2740 (string-match-p (concat "^" (regexp-quote partial-method)) method) 2740 (string-match-p (concat "^" (regexp-quote partial-method)) method)
2741 (tramp-completion-make-tramp-file-name method nil nil nil))) 2741 (tramp-completion-make-tramp-file-name method nil nil nil)))
2742 (mapcar 'car tramp-methods))) 2742 (mapcar #'car tramp-methods)))
2743 2743
2744;; Compares partial user and host names with possible completions. 2744;; Compares partial user and host names with possible completions.
2745(defun tramp-get-completion-user-host 2745(defun tramp-get-completion-user-host
@@ -2828,7 +2828,7 @@ User is always nil."
2828(defun tramp-parse-rhosts (filename) 2828(defun tramp-parse-rhosts (filename)
2829 "Return a list of (user host) tuples allowed to access. 2829 "Return a list of (user host) tuples allowed to access.
2830Either user or host may be nil." 2830Either user or host may be nil."
2831 (tramp-parse-file filename 'tramp-parse-rhosts-group)) 2831 (tramp-parse-file filename #'tramp-parse-rhosts-group))
2832 2832
2833(defun tramp-parse-rhosts-group () 2833(defun tramp-parse-rhosts-group ()
2834 "Return a (user host) tuple allowed to access. 2834 "Return a (user host) tuple allowed to access.
@@ -2846,7 +2846,7 @@ Either user or host may be nil."
2846(defun tramp-parse-shosts (filename) 2846(defun tramp-parse-shosts (filename)
2847 "Return a list of (user host) tuples allowed to access. 2847 "Return a list of (user host) tuples allowed to access.
2848User is always nil." 2848User is always nil."
2849 (tramp-parse-file filename 'tramp-parse-shosts-group)) 2849 (tramp-parse-file filename #'tramp-parse-shosts-group))
2850 2850
2851(defun tramp-parse-shosts-group () 2851(defun tramp-parse-shosts-group ()
2852 "Return a (user host) tuple allowed to access. 2852 "Return a (user host) tuple allowed to access.
@@ -2856,7 +2856,7 @@ User is always nil."
2856(defun tramp-parse-sconfig (filename) 2856(defun tramp-parse-sconfig (filename)
2857 "Return a list of (user host) tuples allowed to access. 2857 "Return a list of (user host) tuples allowed to access.
2858User is always nil." 2858User is always nil."
2859 (tramp-parse-file filename 'tramp-parse-sconfig-group)) 2859 (tramp-parse-file filename #'tramp-parse-sconfig-group))
2860 2860
2861(defun tramp-parse-sconfig-group () 2861(defun tramp-parse-sconfig-group ()
2862 "Return a (user host) tuple allowed to access. 2862 "Return a (user host) tuple allowed to access.
@@ -2895,7 +2895,7 @@ User is always nil."
2895(defun tramp-parse-hosts (filename) 2895(defun tramp-parse-hosts (filename)
2896 "Return a list of (user host) tuples allowed to access. 2896 "Return a list of (user host) tuples allowed to access.
2897User is always nil." 2897User is always nil."
2898 (tramp-parse-file filename 'tramp-parse-hosts-group)) 2898 (tramp-parse-file filename #'tramp-parse-hosts-group))
2899 2899
2900(defun tramp-parse-hosts-group () 2900(defun tramp-parse-hosts-group ()
2901 "Return a (user host) tuple allowed to access. 2901 "Return a (user host) tuple allowed to access.
@@ -2913,7 +2913,7 @@ Host is always \"localhost\"."
2913 (goto-char (point-min)) 2913 (goto-char (point-min))
2914 (cl-loop while (not (eobp)) collect 2914 (cl-loop while (not (eobp)) collect
2915 (tramp-parse-etc-group-group)))) 2915 (tramp-parse-etc-group-group))))
2916 (tramp-parse-file filename 'tramp-parse-passwd-group)))) 2916 (tramp-parse-file filename #'tramp-parse-passwd-group))))
2917 2917
2918(defun tramp-parse-passwd-group () 2918(defun tramp-parse-passwd-group ()
2919 "Return a (user host) tuple allowed to access. 2919 "Return a (user host) tuple allowed to access.
@@ -2935,7 +2935,7 @@ Host is always \"localhost\"."
2935 (goto-char (point-min)) 2935 (goto-char (point-min))
2936 (cl-loop while (not (eobp)) collect 2936 (cl-loop while (not (eobp)) collect
2937 (tramp-parse-etc-group-group)))) 2937 (tramp-parse-etc-group-group))))
2938 (tramp-parse-file filename 'tramp-parse-etc-group-group)))) 2938 (tramp-parse-file filename #'tramp-parse-etc-group-group))))
2939 2939
2940(defun tramp-parse-etc-group-group () 2940(defun tramp-parse-etc-group-group ()
2941 "Return a (group host) tuple allowed to access. 2941 "Return a (group host) tuple allowed to access.
@@ -3048,7 +3048,7 @@ User is always nil."
3048 (when (or (null match) (string-match-p match item)) 3048 (when (or (null match) (string-match-p match item))
3049 (push (if full (concat directory item) item) 3049 (push (if full (concat directory item) item)
3050 result))) 3050 result)))
3051 (if nosort result (sort result 'string<))))) 3051 (if nosort result (sort result #'string<)))))
3052 3052
3053(defun tramp-handle-directory-files-and-attributes 3053(defun tramp-handle-directory-files-and-attributes
3054 (directory &optional full match nosort id-format) 3054 (directory &optional full match nosort id-format)
@@ -3074,10 +3074,10 @@ User is always nil."
3074 (setq name (concat (file-name-as-directory dir) name))) 3074 (setq name (concat (file-name-as-directory dir) name)))
3075 ;; If NAME is not a Tramp file, run the real handler. 3075 ;; If NAME is not a Tramp file, run the real handler.
3076 (if (not (tramp-tramp-file-p name)) 3076 (if (not (tramp-tramp-file-p name))
3077 (tramp-run-real-handler 'expand-file-name (list name nil)) 3077 (tramp-run-real-handler #'expand-file-name (list name nil))
3078 ;; Dissect NAME. 3078 ;; Dissect NAME.
3079 (with-parsed-tramp-file-name name nil 3079 (with-parsed-tramp-file-name name nil
3080 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) 3080 (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
3081 (setq localname (concat "/" localname))) 3081 (setq localname (concat "/" localname)))
3082 ;; Do normal `expand-file-name' (this does "/./" and "/../"). 3082 ;; Do normal `expand-file-name' (this does "/./" and "/../").
3083 ;; `default-directory' is bound, because on Windows there would 3083 ;; `default-directory' is bound, because on Windows there would
@@ -3085,7 +3085,7 @@ User is always nil."
3085 (let ((default-directory (tramp-compat-temporary-file-directory))) 3085 (let ((default-directory (tramp-compat-temporary-file-directory)))
3086 (tramp-make-tramp-file-name 3086 (tramp-make-tramp-file-name
3087 v (tramp-drop-volume-letter 3087 v (tramp-drop-volume-letter
3088 (tramp-run-real-handler 'expand-file-name (list localname)))))))) 3088 (tramp-run-real-handler #'expand-file-name (list localname))))))))
3089 3089
3090(defun tramp-handle-file-accessible-directory-p (filename) 3090(defun tramp-handle-file-accessible-directory-p (filename)
3091 "Like `file-accessible-directory-p' for Tramp files." 3091 "Like `file-accessible-directory-p' for Tramp files."
@@ -3106,7 +3106,7 @@ User is always nil."
3106 (when (string-equal 3106 (when (string-equal
3107 (file-remote-p (expand-file-name filename1)) 3107 (file-remote-p (expand-file-name filename1))
3108 (file-remote-p (expand-file-name filename2))) 3108 (file-remote-p (expand-file-name filename2)))
3109 (tramp-run-real-handler 'file-equal-p (list filename1 filename2)))) 3109 (tramp-run-real-handler #'file-equal-p (list filename1 filename2))))
3110 3110
3111(defun tramp-handle-file-exists-p (filename) 3111(defun tramp-handle-file-exists-p (filename)
3112 "Like `file-exists-p' for Tramp files." 3112 "Like `file-exists-p' for Tramp files."
@@ -3120,7 +3120,7 @@ User is always nil."
3120 (when (string-equal 3120 (when (string-equal
3121 (file-remote-p (expand-file-name filename)) 3121 (file-remote-p (expand-file-name filename))
3122 (file-remote-p (expand-file-name directory))) 3122 (file-remote-p (expand-file-name directory)))
3123 (tramp-run-real-handler 'file-in-directory-p (list filename directory)))) 3123 (tramp-run-real-handler #'file-in-directory-p (list filename directory))))
3124 3124
3125(defun tramp-handle-file-local-copy (filename) 3125(defun tramp-handle-file-local-copy (filename)
3126 "Like `file-local-copy' for Tramp files." 3126 "Like `file-local-copy' for Tramp files."
@@ -3152,7 +3152,7 @@ User is always nil."
3152 v (or (and (zerop (length (tramp-file-name-localname v))) 3152 v (or (and (zerop (length (tramp-file-name-localname v)))
3153 (not (tramp-connectable-p file))) 3153 (not (tramp-connectable-p file)))
3154 (tramp-run-real-handler 3154 (tramp-run-real-handler
3155 'file-name-as-directory 3155 #'file-name-as-directory
3156 (list (tramp-file-name-localname v))))))) 3156 (list (tramp-file-name-localname v)))))))
3157 3157
3158(defun tramp-handle-file-name-case-insensitive-p (filename) 3158(defun tramp-handle-file-name-case-insensitive-p (filename)
@@ -3217,7 +3217,7 @@ User is always nil."
3217 (try-completion 3217 (try-completion
3218 filename (file-name-all-completions filename directory) 3218 filename (file-name-all-completions filename directory)
3219 (lambda (x) 3219 (lambda (x)
3220 (when (funcall (or predicate 'identity) (expand-file-name x directory)) 3220 (when (funcall (or predicate #'identity) (expand-file-name x directory))
3221 (not 3221 (not
3222 (and 3222 (and
3223 completion-ignored-extensions 3223 completion-ignored-extensions
@@ -3238,13 +3238,13 @@ User is always nil."
3238 ;; nil, mark also the localname part of `v' as nil. 3238 ;; nil, mark also the localname part of `v' as nil.
3239 (tramp-make-tramp-file-name 3239 (tramp-make-tramp-file-name
3240 v (or (tramp-run-real-handler 3240 v (or (tramp-run-real-handler
3241 'file-name-directory (list (tramp-file-name-localname v))) 3241 #'file-name-directory (list (tramp-file-name-localname v)))
3242 'noloc)))) 3242 'noloc))))
3243 3243
3244(defun tramp-handle-file-name-nondirectory (file) 3244(defun tramp-handle-file-name-nondirectory (file)
3245 "Like `file-name-nondirectory' but aware of Tramp files." 3245 "Like `file-name-nondirectory' but aware of Tramp files."
3246 (with-parsed-tramp-file-name file nil 3246 (with-parsed-tramp-file-name file nil
3247 (tramp-run-real-handler 'file-name-nondirectory (list localname)))) 3247 (tramp-run-real-handler #'file-name-nondirectory (list localname))))
3248 3248
3249(defun tramp-handle-file-newer-than-file-p (file1 file2) 3249(defun tramp-handle-file-newer-than-file-p (file1 file2)
3250 "Like `file-newer-than-file-p' for Tramp files." 3250 "Like `file-newer-than-file-p' for Tramp files."
@@ -3301,7 +3301,7 @@ User is always nil."
3301 ;; Preserve trailing "/". 3301 ;; Preserve trailing "/".
3302 (funcall 3302 (funcall
3303 (if (string-equal (file-name-nondirectory filename) "") 3303 (if (string-equal (file-name-nondirectory filename) "")
3304 'file-name-as-directory 'identity) 3304 #'file-name-as-directory #'identity)
3305 (let ((result (expand-file-name filename)) 3305 (let ((result (expand-file-name filename))
3306 (numchase 0) 3306 (numchase 0)
3307 ;; Don't make the following value larger than necessary. 3307 ;; Don't make the following value larger than necessary.
@@ -3324,7 +3324,7 @@ User is always nil."
3324 v2 3324 v2
3325 (funcall 3325 (funcall
3326 (if (tramp-compat-file-name-quoted-p v2-localname) 3326 (if (tramp-compat-file-name-quoted-p v2-localname)
3327 'tramp-compat-file-name-quote 'identity) 3327 #'tramp-compat-file-name-quote #'identity)
3328 3328
3329 (if (stringp symlink-target) 3329 (if (stringp symlink-target)
3330 (if (file-remote-p symlink-target) 3330 (if (file-remote-p symlink-target)
@@ -3366,7 +3366,7 @@ User is always nil."
3366 (cdr x)))) 3366 (cdr x))))
3367 tramp-backup-directory-alist) 3367 tramp-backup-directory-alist)
3368 backup-directory-alist))) 3368 backup-directory-alist)))
3369 (tramp-run-real-handler 'find-backup-file-name (list filename))))) 3369 (tramp-run-real-handler #'find-backup-file-name (list filename)))))
3370 3370
3371(defun tramp-handle-insert-directory 3371(defun tramp-handle-insert-directory
3372 (filename switches &optional wildcard full-directory-p) 3372 (filename switches &optional wildcard full-directory-p)
@@ -3384,7 +3384,7 @@ User is always nil."
3384 (require 'ls-lisp) 3384 (require 'ls-lisp)
3385 (let (ls-lisp-use-insert-directory-program start) 3385 (let (ls-lisp-use-insert-directory-program start)
3386 (tramp-run-real-handler 3386 (tramp-run-real-handler
3387 'insert-directory 3387 #'insert-directory
3388 (list filename switches wildcard full-directory-p)) 3388 (list filename switches wildcard full-directory-p))
3389 ;; `ls-lisp' always returns full listings. We must remove 3389 ;; `ls-lisp' always returns full listings. We must remove
3390 ;; superfluous parts. 3390 ;; superfluous parts.
@@ -3426,7 +3426,7 @@ User is always nil."
3426 ;; run directly. 3426 ;; run directly.
3427 (setq result 3427 (setq result
3428 (tramp-run-real-handler 3428 (tramp-run-real-handler
3429 'insert-file-contents 3429 #'insert-file-contents
3430 (list localname visit beg end replace))) 3430 (list localname visit beg end replace)))
3431 3431
3432 ;; When we shall insert only a part of the file, we 3432 ;; When we shall insert only a part of the file, we
@@ -3561,7 +3561,7 @@ support symbolic links."
3561 ;; This is needed prior Emacs 26.1, where TARGET has also be 3561 ;; This is needed prior Emacs 26.1, where TARGET has also be
3562 ;; checked for a file name handler. 3562 ;; checked for a file name handler.
3563 (tramp-run-real-handler 3563 (tramp-run-real-handler
3564 'make-symbolic-link (list target linkname ok-if-already-exists)))) 3564 #'make-symbolic-link (list target linkname ok-if-already-exists))))
3565 3565
3566(defun tramp-handle-shell-command 3566(defun tramp-handle-shell-command
3567 (command &optional output-buffer error-buffer) 3567 (command &optional output-buffer error-buffer)
@@ -3619,18 +3619,18 @@ support symbolic links."
3619 (if (and (not current-buffer-p) (integerp asynchronous)) 3619 (if (and (not current-buffer-p) (integerp asynchronous))
3620 (prog1 3620 (prog1
3621 ;; Run the process. 3621 ;; Run the process.
3622 (setq p (apply 'start-file-process "*Async Shell*" buffer args)) 3622 (setq p (apply #'start-file-process "*Async Shell*" buffer args))
3623 ;; Display output. 3623 ;; Display output.
3624 (with-current-buffer output-buffer 3624 (with-current-buffer output-buffer
3625 (display-buffer output-buffer '(nil (allow-no-window . t))) 3625 (display-buffer output-buffer '(nil (allow-no-window . t)))
3626 (setq mode-line-process '(":%s")) 3626 (setq mode-line-process '(":%s"))
3627 (shell-mode) 3627 (shell-mode)
3628 (set-process-sentinel p 'shell-command-sentinel) 3628 (set-process-sentinel p #'shell-command-sentinel)
3629 (set-process-filter p 'comint-output-filter))) 3629 (set-process-filter p 'comint-output-filter)))
3630 3630
3631 (prog1 3631 (prog1
3632 ;; Run the process. 3632 ;; Run the process.
3633 (apply 'process-file (car args) nil buffer nil (cdr args)) 3633 (apply #'process-file (car args) nil buffer nil (cdr args))
3634 ;; Insert error messages if they were separated. 3634 ;; Insert error messages if they were separated.
3635 (when (listp buffer) 3635 (when (listp buffer)
3636 (with-current-buffer error-buffer 3636 (with-current-buffer error-buffer
@@ -3685,7 +3685,7 @@ support symbolic links."
3685 ;; We must disable cygwin-mount file name 3685 ;; We must disable cygwin-mount file name
3686 ;; handlers and alike. 3686 ;; handlers and alike.
3687 (tramp-run-real-handler 3687 (tramp-run-real-handler
3688 'substitute-in-file-name (list localname)))))))) 3688 #'substitute-in-file-name (list localname))))))))
3689 ;; "/m:h:~" does not work for completion. We use "/m:h:~/". 3689 ;; "/m:h:~" does not work for completion. We use "/m:h:~/".
3690 (if (and (stringp localname) (string-equal "~" localname)) 3690 (if (and (stringp localname) (string-equal "~" localname))
3691 (concat filename "/") 3691 (concat filename "/")
@@ -3709,7 +3709,7 @@ support symbolic links."
3709 (file-attributes (buffer-file-name))) 3709 (file-attributes (buffer-file-name)))
3710 tramp-time-doesnt-exist)))) 3710 tramp-time-doesnt-exist))))
3711 (unless (tramp-compat-time-equal-p time-list tramp-time-dont-know) 3711 (unless (tramp-compat-time-equal-p time-list tramp-time-dont-know)
3712 (tramp-run-real-handler 'set-visited-file-modtime (list time-list)))) 3712 (tramp-run-real-handler #'set-visited-file-modtime (list time-list))))
3713 3713
3714(defun tramp-handle-verify-visited-file-modtime (&optional buf) 3714(defun tramp-handle-verify-visited-file-modtime (&optional buf)
3715 "Like `verify-visited-file-modtime' for Tramp files. 3715 "Like `verify-visited-file-modtime' for Tramp files.
@@ -3762,7 +3762,7 @@ of."
3762 ;; modtime data to be clobbered from the temp file. We call 3762 ;; modtime data to be clobbered from the temp file. We call
3763 ;; `set-visited-file-modtime' ourselves later on. 3763 ;; `set-visited-file-modtime' ourselves later on.
3764 (tramp-run-real-handler 3764 (tramp-run-real-handler
3765 'write-region (list start end tmpfile append 'no-message lockname)) 3765 #'write-region (list start end tmpfile append 'no-message lockname))
3766 (condition-case nil 3766 (condition-case nil
3767 (rename-file tmpfile filename 'ok-if-already-exists) 3767 (rename-file tmpfile filename 'ok-if-already-exists)
3768 (error 3768 (error
@@ -3929,7 +3929,7 @@ The terminal type can be configured with `tramp-terminal-type'."
3929 (throw 'tramp-action 'ok)) 3929 (throw 'tramp-action 'ok))
3930 ((or (and (memq (process-status proc) '(stop exit)) 3930 ((or (and (memq (process-status proc) '(stop exit))
3931 (not (zerop (process-exit-status proc)))) 3931 (not (zerop (process-exit-status proc))))
3932 (memq (process-status proc) '(signal))) 3932 (eq (process-status proc) 'signal))
3933 ;; `scp' could have copied correctly, but set modes could have failed. 3933 ;; `scp' could have copied correctly, but set modes could have failed.
3934 ;; This can be ignored. 3934 ;; This can be ignored.
3935 (with-current-buffer (process-buffer proc) 3935 (with-current-buffer (process-buffer proc)
@@ -4157,7 +4157,7 @@ the remote host use line-endings as defined in the variable
4157 ;; Replace "\n" by `tramp-rsh-end-of-line'. 4157 ;; Replace "\n" by `tramp-rsh-end-of-line'.
4158 (setq string 4158 (setq string
4159 (mapconcat 4159 (mapconcat
4160 'identity (split-string string "\n") tramp-rsh-end-of-line)) 4160 #'identity (split-string string "\n") tramp-rsh-end-of-line))
4161 (unless (or (string= string "") 4161 (unless (or (string= string "")
4162 (string-equal (substring string -1) tramp-rsh-end-of-line)) 4162 (string-equal (substring string -1) tramp-rsh-end-of-line))
4163 (setq string (concat string tramp-rsh-end-of-line))) 4163 (setq string (concat string tramp-rsh-end-of-line)))
@@ -4328,7 +4328,7 @@ If FILENAME is remote, a file name handler is called."
4328 4328
4329 (let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid))) 4329 (let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid)))
4330 (if handler 4330 (if handler
4331 (funcall handler 'tramp-set-file-uid-gid filename uid gid) 4331 (funcall handler #'tramp-set-file-uid-gid filename uid gid)
4332 ;; On W32 "chown" does not work. 4332 ;; On W32 "chown" does not work.
4333 (unless (memq system-type '(ms-dos windows-nt)) 4333 (unless (memq system-type '(ms-dos windows-nt))
4334 (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer))) 4334 (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
@@ -4543,7 +4543,7 @@ this file, if that variable is non-nil."
4543 (tramp-compat-file-name-unquote (buffer-file-name))) 4543 (tramp-compat-file-name-unquote (buffer-file-name)))
4544 tramp-auto-save-directory)))) 4544 tramp-auto-save-directory))))
4545 ;; Run plain `make-auto-save-file-name'. 4545 ;; Run plain `make-auto-save-file-name'.
4546 (tramp-run-real-handler 'make-auto-save-file-name nil))) 4546 (tramp-run-real-handler #'make-auto-save-file-name nil)))
4547 4547
4548(defun tramp-subst-strs-in-string (alist string) 4548(defun tramp-subst-strs-in-string (alist string)
4549 "Replace all occurrences of the string FROM with TO in STRING. 4549 "Replace all occurrences of the string FROM with TO in STRING.
@@ -4588,12 +4588,12 @@ are written with verbosity of 6."
4588 output error result) 4588 output error result)
4589 (tramp-message 4589 (tramp-message
4590 vec 6 "`%s %s' %s %s" 4590 vec 6 "`%s %s' %s %s"
4591 program (mapconcat 'identity args " ") infile destination) 4591 program (mapconcat #'identity args " ") infile destination)
4592 (condition-case err 4592 (condition-case err
4593 (with-temp-buffer 4593 (with-temp-buffer
4594 (setq result 4594 (setq result
4595 (apply 4595 (apply
4596 'call-process program infile (or destination t) display args)) 4596 #'call-process program infile (or destination t) display args))
4597 ;; `result' could also be an error string. 4597 ;; `result' could also be an error string.
4598 (when (stringp result) 4598 (when (stringp result)
4599 (setq error result 4599 (setq error result
@@ -4620,12 +4620,12 @@ are written with verbosity of 6."
4620 result) 4620 result)
4621 (tramp-message 4621 (tramp-message
4622 vec 6 "`%s %s' %s %s %s %s" 4622 vec 6 "`%s %s' %s %s %s %s"
4623 program (mapconcat 'identity args " ") start end delete buffer) 4623 program (mapconcat #'identity args " ") start end delete buffer)
4624 (condition-case err 4624 (condition-case err
4625 (progn 4625 (progn
4626 (setq result 4626 (setq result
4627 (apply 4627 (apply
4628 'call-process-region 4628 #'call-process-region
4629 start end program delete buffer display args)) 4629 start end program delete buffer display args))
4630 ;; `result' could also be an error string. 4630 ;; `result' could also be an error string.
4631 (when (stringp result) 4631 (when (stringp result)
@@ -4648,11 +4648,11 @@ verbosity of 6."
4648 (vec (or vec (car tramp-current-connection))) 4648 (vec (or vec (car tramp-current-connection)))
4649 result) 4649 result)
4650 (if args 4650 (if args
4651 (tramp-message vec 6 "%s %s" program (mapconcat 'identity args " ")) 4651 (tramp-message vec 6 "%s %s" program (mapconcat #'identity args " "))
4652 (tramp-message vec 6 "%s" program)) 4652 (tramp-message vec 6 "%s" program))
4653 (setq result 4653 (setq result
4654 (condition-case err 4654 (condition-case err
4655 (apply 'process-lines program args) 4655 (apply #'process-lines program args)
4656 (error 4656 (error
4657 (tramp-error vec (car err) (cdr err))))) 4657 (tramp-error vec (car err) (cdr err)))))
4658 (tramp-message vec 6 "%s" result) 4658 (tramp-message vec 6 "%s" result)
@@ -4838,7 +4838,7 @@ Only works for Bourne-like shells."
4838(defun tramp-unload-tramp () 4838(defun tramp-unload-tramp ()
4839 "Discard Tramp from loading remote files." 4839 "Discard Tramp from loading remote files."
4840 (interactive) 4840 (interactive)
4841 ;; ange-ftp settings must be enabled. 4841 ;; ange-ftp settings must be re-enabled.
4842 (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp) 4842 (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp)
4843 ;; Maybe it's not loaded yet. 4843 ;; Maybe it's not loaded yet.
4844 (ignore-errors (unload-feature 'tramp 'force))) 4844 (ignore-errors (unload-feature 'tramp 'force)))
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el
index 9f06ab1000c..76290cf37f4 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -78,7 +78,7 @@ the origin of the temporary TMPFILE, have no write permissions."
78 (if (file-regular-p tmpfile) 78 (if (file-regular-p tmpfile)
79 (delete-file tmpfile) 79 (delete-file tmpfile)
80 (mapc 80 (mapc
81 'tramp-archive--test-delete 81 #'tramp-archive--test-delete
82 (directory-files tmpfile 'full directory-files-no-dot-files-regexp)) 82 (directory-files tmpfile 'full directory-files-no-dot-files-regexp))
83 (delete-directory tmpfile))) 83 (delete-directory tmpfile)))
84 84
@@ -662,7 +662,7 @@ This tests also `access-file', `file-readable-p' and `file-regular-p'."
662 (dolist (elt attr) 662 (dolist (elt attr)
663 (should (equal (file-attributes (car elt)) (cdr elt)))) 663 (should (equal (file-attributes (car elt)) (cdr elt))))
664 (setq attr (directory-files-and-attributes tmp-name nil "^b")) 664 (setq attr (directory-files-and-attributes tmp-name nil "^b"))
665 (should (equal (mapcar 'car attr) '("bar")))) 665 (should (equal (mapcar #'car attr) '("bar"))))
666 666
667 ;; Cleanup. 667 ;; Cleanup.
668 (tramp-archive-cleanup-hash)))) 668 (tramp-archive-cleanup-hash))))
@@ -752,14 +752,14 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
752 (should-not (file-name-completion "a" tmp-name)) 752 (should-not (file-name-completion "a" tmp-name))
753 (should 753 (should
754 (equal 754 (equal
755 (file-name-completion "b" tmp-name 'file-directory-p) "bar/")) 755 (file-name-completion "b" tmp-name #'file-directory-p) "bar/"))
756 (should 756 (should
757 (equal 757 (equal
758 (sort (file-name-all-completions "fo" tmp-name) 'string-lessp) 758 (sort (file-name-all-completions "fo" tmp-name) #'string-lessp)
759 '("foo.hrd" "foo.lnk" "foo.txt"))) 759 '("foo.hrd" "foo.lnk" "foo.txt")))
760 (should 760 (should
761 (equal 761 (equal
762 (sort (file-name-all-completions "b" tmp-name) 'string-lessp) 762 (sort (file-name-all-completions "b" tmp-name) #'string-lessp)
763 '("bar/" "baz.tar"))) 763 '("bar/" "baz.tar")))
764 (should-not (file-name-all-completions "a" tmp-name)) 764 (should-not (file-name-all-completions "a" tmp-name))
765 ;; `completion-regexp-list' restricts the completion to 765 ;; `completion-regexp-list' restricts the completion to
@@ -770,7 +770,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
770 (equal (file-name-completion "" tmp-name) "ba")) 770 (equal (file-name-completion "" tmp-name) "ba"))
771 (should 771 (should
772 (equal 772 (equal
773 (sort (file-name-all-completions "" tmp-name) 'string-lessp) 773 (sort (file-name-all-completions "" tmp-name) #'string-lessp)
774 '("bar/" "baz.tar"))))) 774 '("bar/" "baz.tar")))))
775 775
776 ;; Cleanup. 776 ;; Cleanup.
@@ -859,7 +859,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
859 "%s -batch -Q -L %s --eval %s" 859 "%s -batch -Q -L %s --eval %s"
860 (shell-quote-argument 860 (shell-quote-argument
861 (expand-file-name invocation-name invocation-directory)) 861 (expand-file-name invocation-name invocation-directory))
862 (mapconcat 'shell-quote-argument load-path " -L ") 862 (mapconcat #'shell-quote-argument load-path " -L ")
863 (shell-quote-argument (format code file))))))))) 863 (shell-quote-argument (format code file)))))))))
864 864
865(ert-deftest tramp-archive-test44-delay-load () 865(ert-deftest tramp-archive-test44-delay-load ()
@@ -896,7 +896,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
896 "%s -batch -Q -L %s --eval %s" 896 "%s -batch -Q -L %s --eval %s"
897 (shell-quote-argument 897 (shell-quote-argument
898 (expand-file-name invocation-name invocation-directory)) 898 (expand-file-name invocation-name invocation-directory))
899 (mapconcat 'shell-quote-argument load-path " -L ") 899 (mapconcat #'shell-quote-argument load-path " -L ")
900 (shell-quote-argument 900 (shell-quote-argument
901 (format 901 (format
902 code tae tramp-archive-test-file-archive 902 code tae tramp-archive-test-file-archive
@@ -958,7 +958,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
958 "Run all tests for \\[tramp-archive]." 958 "Run all tests for \\[tramp-archive]."
959 (interactive "p") 959 (interactive "p")
960 (funcall 960 (funcall
961 (if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) 961 (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
962 "^tramp-archive")) 962 "^tramp-archive"))
963 963
964(provide 'tramp-archive-tests) 964(provide 'tramp-archive-tests)
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 3afe9ad557d..732b4f313ff 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -68,7 +68,7 @@
68;; Beautify batch mode. 68;; Beautify batch mode.
69(when noninteractive 69(when noninteractive
70 ;; Suppress nasty messages. 70 ;; Suppress nasty messages.
71 (fset 'shell-command-sentinel 'ignore) 71 (fset #'shell-command-sentinel #'ignore)
72 ;; We do not want to be interrupted. 72 ;; We do not want to be interrupted.
73 (eval-after-load 'tramp-gvfs 73 (eval-after-load 'tramp-gvfs
74 '(fset 'tramp-gvfs-handler-askquestion 74 '(fset 'tramp-gvfs-handler-askquestion
@@ -149,7 +149,7 @@ If LOCAL is non-nil, a local file name is returned.
149If QUOTED is non-nil, the local part of the file name is quoted. 149If QUOTED is non-nil, the local part of the file name is quoted.
150The temporary file is not created." 150The temporary file is not created."
151 (funcall 151 (funcall
152 (if quoted 'tramp-compat-file-name-quote 'identity) 152 (if quoted #'tramp-compat-file-name-quote #'identity)
153 (expand-file-name 153 (expand-file-name
154 (make-temp-name "tramp-test") 154 (make-temp-name "tramp-test")
155 (if local temporary-file-directory tramp-test-temporary-file-directory)))) 155 (if local temporary-file-directory tramp-test-temporary-file-directory))))
@@ -185,7 +185,7 @@ properly. BODY shall not contain a timeout."
185 "Emit a message into ERT *Messages*." 185 "Emit a message into ERT *Messages*."
186 (tramp--test-instrument-test-case 0 186 (tramp--test-instrument-test-case 0
187 (apply 187 (apply
188 'tramp-message 188 #'tramp-message
189 (tramp-dissect-file-name tramp-test-temporary-file-directory) 0 189 (tramp-dissect-file-name tramp-test-temporary-file-directory) 0
190 fmt-string arguments))) 190 fmt-string arguments)))
191 191
@@ -405,7 +405,7 @@ properly. BODY shall not contain a timeout."
405 tramp-default-user-alist 405 tramp-default-user-alist
406 tramp-default-host-alist 406 tramp-default-host-alist
407 ;; Suppress check for multihops. 407 ;; Suppress check for multihops.
408 (tramp-cache-data (make-hash-table :test 'equal)) 408 (tramp-cache-data (make-hash-table :test #'equal))
409 (tramp-connection-properties '((nil "login-program" t)))) 409 (tramp-connection-properties '((nil "login-program" t))))
410 ;; Expand `tramp-default-user' and `tramp-default-host'. 410 ;; Expand `tramp-default-user' and `tramp-default-host'.
411 (should (string-equal 411 (should (string-equal
@@ -844,7 +844,7 @@ properly. BODY shall not contain a timeout."
844 tramp-default-user-alist 844 tramp-default-user-alist
845 tramp-default-host-alist 845 tramp-default-host-alist
846 ;; Suppress check for multihops. 846 ;; Suppress check for multihops.
847 (tramp-cache-data (make-hash-table :test 'equal)) 847 (tramp-cache-data (make-hash-table :test #'equal))
848 (tramp-connection-properties '((nil "login-program" t))) 848 (tramp-connection-properties '((nil "login-program" t)))
849 (syntax tramp-syntax)) 849 (syntax tramp-syntax))
850 (unwind-protect 850 (unwind-protect
@@ -1168,7 +1168,7 @@ properly. BODY shall not contain a timeout."
1168 tramp-default-user-alist 1168 tramp-default-user-alist
1169 tramp-default-host-alist 1169 tramp-default-host-alist
1170 ;; Suppress check for multihops. 1170 ;; Suppress check for multihops.
1171 (tramp-cache-data (make-hash-table :test 'equal)) 1171 (tramp-cache-data (make-hash-table :test #'equal))
1172 (tramp-connection-properties '((nil "login-program" t))) 1172 (tramp-connection-properties '((nil "login-program" t)))
1173 (syntax tramp-syntax)) 1173 (syntax tramp-syntax))
1174 (unwind-protect 1174 (unwind-protect
@@ -2759,7 +2759,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
2759 (tmp-name4 (expand-file-name "bar" tmp-name2)) 2759 (tmp-name4 (expand-file-name "bar" tmp-name2))
2760 (tramp-test-temporary-file-directory 2760 (tramp-test-temporary-file-directory
2761 (funcall 2761 (funcall
2762 (if quoted 'tramp-compat-file-name-quote 'identity) 2762 (if quoted #'tramp-compat-file-name-quote #'identity)
2763 tramp-test-temporary-file-directory)) 2763 tramp-test-temporary-file-directory))
2764 buffer) 2764 buffer)
2765 (unwind-protect 2765 (unwind-protect
@@ -2936,7 +2936,7 @@ This tests also `access-file', `file-readable-p',
2936 (should 2936 (should
2937 (string-equal 2937 (string-equal
2938 (funcall 2938 (funcall
2939 (if quoted 'tramp-compat-file-name-quote 'identity) 2939 (if quoted #'tramp-compat-file-name-quote #'identity)
2940 (car attr)) 2940 (car attr))
2941 (file-remote-p (file-truename tmp-name1) 'localname))) 2941 (file-remote-p (file-truename tmp-name1) 'localname)))
2942 (delete-file tmp-name2)) 2942 (delete-file tmp-name2))
@@ -3028,7 +3028,7 @@ They might differ only in access time."
3028 (tramp--test-file-attributes-equal-p 3028 (tramp--test-file-attributes-equal-p
3029 (file-attributes (car elt)) (cdr elt))))) 3029 (file-attributes (car elt)) (cdr elt)))))
3030 (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) 3030 (setq attr (directory-files-and-attributes tmp-name2 nil "^b"))
3031 (should (equal (mapcar 'car attr) '("bar" "boz")))) 3031 (should (equal (mapcar #'car attr) '("bar" "boz"))))
3032 3032
3033 ;; Cleanup. 3033 ;; Cleanup.
3034 (ignore-errors (delete-directory tmp-name1 'recursive)))))) 3034 (ignore-errors (delete-directory tmp-name1 'recursive))))))
@@ -3100,7 +3100,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3100 (should 3100 (should
3101 (string-equal 3101 (string-equal
3102 (funcall 3102 (funcall
3103 (if quoted 'tramp-compat-file-name-unquote 'identity) 3103 (if quoted #'tramp-compat-file-name-unquote #'identity)
3104 (file-remote-p tmp-name1 'localname)) 3104 (file-remote-p tmp-name1 'localname))
3105 (file-symlink-p tmp-name2))) 3105 (file-symlink-p tmp-name2)))
3106 (when (tramp--test-expensive-test) 3106 (when (tramp--test-expensive-test)
@@ -3109,7 +3109,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3109 :type 'file-already-exists)) 3109 :type 'file-already-exists))
3110 (when (tramp--test-expensive-test) 3110 (when (tramp--test-expensive-test)
3111 ;; A number means interactive case. 3111 ;; A number means interactive case.
3112 (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) 3112 (cl-letf (((symbol-function 'yes-or-no-p) #'ignore))
3113 (should-error 3113 (should-error
3114 (make-symbolic-link tmp-name1 tmp-name2 0) 3114 (make-symbolic-link tmp-name1 tmp-name2 0)
3115 :type 'file-already-exists))) 3115 :type 'file-already-exists)))
@@ -3118,14 +3118,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3118 (should 3118 (should
3119 (string-equal 3119 (string-equal
3120 (funcall 3120 (funcall
3121 (if quoted 'tramp-compat-file-name-unquote 'identity) 3121 (if quoted #'tramp-compat-file-name-unquote #'identity)
3122 (file-remote-p tmp-name1 'localname)) 3122 (file-remote-p tmp-name1 'localname))
3123 (file-symlink-p tmp-name2)))) 3123 (file-symlink-p tmp-name2))))
3124 (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists) 3124 (make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists)
3125 (should 3125 (should
3126 (string-equal 3126 (string-equal
3127 (funcall 3127 (funcall
3128 (if quoted 'tramp-compat-file-name-unquote 'identity) 3128 (if quoted #'tramp-compat-file-name-unquote #'identity)
3129 (file-remote-p tmp-name1 'localname)) 3129 (file-remote-p tmp-name1 'localname))
3130 (file-symlink-p tmp-name2))) 3130 (file-symlink-p tmp-name2)))
3131 ;; If we use the local part of `tmp-name1', it shall still work. 3131 ;; If we use the local part of `tmp-name1', it shall still work.
@@ -3135,7 +3135,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3135 (should 3135 (should
3136 (string-equal 3136 (string-equal
3137 (funcall 3137 (funcall
3138 (if quoted 'tramp-compat-file-name-unquote 'identity) 3138 (if quoted #'tramp-compat-file-name-unquote #'identity)
3139 (file-remote-p tmp-name1 'localname)) 3139 (file-remote-p tmp-name1 'localname))
3140 (file-symlink-p tmp-name2))) 3140 (file-symlink-p tmp-name2)))
3141 ;; `tmp-name3' is a local file name. Therefore, the link 3141 ;; `tmp-name3' is a local file name. Therefore, the link
@@ -3155,7 +3155,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3155 (should 3155 (should
3156 (string-equal 3156 (string-equal
3157 (funcall 3157 (funcall
3158 (if quoted 'tramp-compat-file-name-unquote 'identity) 3158 (if quoted #'tramp-compat-file-name-unquote #'identity)
3159 (file-remote-p tmp-name1 'localname)) 3159 (file-remote-p tmp-name1 'localname))
3160 (file-symlink-p tmp-name5))) 3160 (file-symlink-p tmp-name5)))
3161 ;; `smbclient' does not show symlinks in directories, so 3161 ;; `smbclient' does not show symlinks in directories, so
@@ -3182,7 +3182,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3182 (add-name-to-file tmp-name1 tmp-name2) 3182 (add-name-to-file tmp-name1 tmp-name2)
3183 :type 'file-already-exists) 3183 :type 'file-already-exists)
3184 ;; A number means interactive case. 3184 ;; A number means interactive case.
3185 (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) 3185 (cl-letf (((symbol-function 'yes-or-no-p) #'ignore))
3186 (should-error 3186 (should-error
3187 (add-name-to-file tmp-name1 tmp-name2 0) 3187 (add-name-to-file tmp-name1 tmp-name2 0)
3188 :type 'file-already-exists)) 3188 :type 'file-already-exists))
@@ -3239,7 +3239,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3239 (delete-file tmp-name2) 3239 (delete-file tmp-name2)
3240 (make-symbolic-link 3240 (make-symbolic-link
3241 (funcall 3241 (funcall
3242 (if quoted 'tramp-compat-file-name-unquote 'identity) 3242 (if quoted #'tramp-compat-file-name-unquote #'identity)
3243 "/penguin:motd:") 3243 "/penguin:motd:")
3244 tmp-name2) 3244 tmp-name2)
3245 (should (file-symlink-p tmp-name2)) 3245 (should (file-symlink-p tmp-name2))
@@ -3328,7 +3328,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3328 (let* ((dir1 3328 (let* ((dir1
3329 (directory-file-name 3329 (directory-file-name
3330 (funcall 3330 (funcall
3331 (if quoted 'tramp-compat-file-name-quote 'identity) 3331 (if quoted #'tramp-compat-file-name-quote #'identity)
3332 tramp-test-temporary-file-directory))) 3332 tramp-test-temporary-file-directory)))
3333 (dir2 (file-name-as-directory dir1))) 3333 (dir2 (file-name-as-directory dir1)))
3334 (should (string-equal (file-truename dir1) (expand-file-name dir1))) 3334 (should (string-equal (file-truename dir1) (expand-file-name dir1)))
@@ -3708,12 +3708,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3708 (should-not (file-name-completion "a" tmp-name)) 3708 (should-not (file-name-completion "a" tmp-name))
3709 (should 3709 (should
3710 (equal 3710 (equal
3711 (file-name-completion "b" tmp-name 'file-directory-p) "boz/")) 3711 (file-name-completion "b" tmp-name #'file-directory-p) "boz/"))
3712 (should 3712 (should
3713 (equal (file-name-all-completions "fo" tmp-name) '("foo"))) 3713 (equal (file-name-all-completions "fo" tmp-name) '("foo")))
3714 (should 3714 (should
3715 (equal 3715 (equal
3716 (sort (file-name-all-completions "b" tmp-name) 'string-lessp) 3716 (sort (file-name-all-completions "b" tmp-name) #'string-lessp)
3717 '("bold" "boz/"))) 3717 '("bold" "boz/")))
3718 (should-not (file-name-all-completions "a" tmp-name)) 3718 (should-not (file-name-all-completions "a" tmp-name))
3719 ;; `completion-regexp-list' restricts the completion to 3719 ;; `completion-regexp-list' restricts the completion to
@@ -3724,7 +3724,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3724 (equal (file-name-completion "" tmp-name) "bo")) 3724 (equal (file-name-completion "" tmp-name) "bo"))
3725 (should 3725 (should
3726 (equal 3726 (equal
3727 (sort (file-name-all-completions "" tmp-name) 'string-lessp) 3727 (sort (file-name-all-completions "" tmp-name) #'string-lessp)
3728 '("bold" "boz/")))) 3728 '("bold" "boz/"))))
3729 ;; `file-name-completion' ignores file names that end in 3729 ;; `file-name-completion' ignores file names that end in
3730 ;; any string in `completion-ignored-extensions'. 3730 ;; any string in `completion-ignored-extensions'.
@@ -3739,7 +3739,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3739 ;; `file-name-all-completions' is not affected. 3739 ;; `file-name-all-completions' is not affected.
3740 (should 3740 (should
3741 (equal 3741 (equal
3742 (sort (file-name-all-completions "" tmp-name) 'string-lessp) 3742 (sort (file-name-all-completions "" tmp-name) #'string-lessp)
3743 '("../" "./" "bold" "boz/" "foo" "foo.ext"))))) 3743 '("../" "./" "bold" "boz/" "foo" "foo.ext")))))
3744 3744
3745 ;; Cleanup. 3745 ;; Cleanup.
@@ -4288,7 +4288,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4288 (with-current-buffer (get-buffer-create "*shell*") 4288 (with-current-buffer (get-buffer-create "*shell*")
4289 (ignore-errors (kill-process (current-buffer))) 4289 (ignore-errors (kill-process (current-buffer)))
4290 (should-not explicit-shell-file-name) 4290 (should-not explicit-shell-file-name)
4291 (call-interactively 'shell) 4291 (call-interactively #'shell)
4292 (should explicit-shell-file-name))) 4292 (should explicit-shell-file-name)))
4293 4293
4294 (put 'explicit-shell-file-name 'permanent-local nil) 4294 (put 'explicit-shell-file-name 'permanent-local nil)
@@ -4315,7 +4315,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4315 (car (last (with-no-warnings (exec-path)))) 4315 (car (last (with-no-warnings (exec-path))))
4316 (file-remote-p default-directory 'localname))) 4316 (file-remote-p default-directory 'localname)))
4317 ;; The shell "sh" shall always exist. 4317 ;; The shell "sh" shall always exist.
4318 (should (apply 'executable-find '("sh" remote))) 4318 (should (apply #'executable-find '("sh" remote)))
4319 ;; Since the last element in `exec-path' is the current 4319 ;; Since the last element in `exec-path' is the current
4320 ;; directory, an executable file in that directory will be 4320 ;; directory, an executable file in that directory will be
4321 ;; found. 4321 ;; found.
@@ -4326,11 +4326,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4326 (should 4326 (should
4327 (string-equal 4327 (string-equal
4328 (apply 4328 (apply
4329 'executable-find `(,(file-name-nondirectory tmp-name) remote)) 4329 #'executable-find `(,(file-name-nondirectory tmp-name) remote))
4330 (file-remote-p tmp-name 'localname))) 4330 (file-remote-p tmp-name 'localname)))
4331 (should-not 4331 (should-not
4332 (apply 4332 (apply
4333 'executable-find 4333 #'executable-find
4334 `(,(concat (file-name-nondirectory tmp-name) "foo") remote)))) 4334 `(,(concat (file-name-nondirectory tmp-name) "foo") remote))))
4335 4335
4336 ;; Cleanup. 4336 ;; Cleanup.
@@ -4375,7 +4375,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4375 ;; We make a super long `tramp-remote-path'. 4375 ;; We make a super long `tramp-remote-path'.
4376 (make-directory tmp-name) 4376 (make-directory tmp-name)
4377 (should (file-directory-p tmp-name)) 4377 (should (file-directory-p tmp-name))
4378 (while (< (length (mapconcat 'identity orig-exec-path ":")) 5000) 4378 (while (< (length (mapconcat #'identity orig-exec-path ":")) 5000)
4379 (let ((dir (make-temp-file (file-name-as-directory tmp-name) 'dir))) 4379 (let ((dir (make-temp-file (file-name-as-directory tmp-name) 'dir)))
4380 (should (file-directory-p dir)) 4380 (should (file-directory-p dir))
4381 (setq tramp-remote-path 4381 (setq tramp-remote-path
@@ -4391,9 +4391,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4391 ;; Ignore trailing newline. 4391 ;; Ignore trailing newline.
4392 (substring (shell-command-to-string "echo $PATH") nil -1) 4392 (substring (shell-command-to-string "echo $PATH") nil -1)
4393 ;; The last element of `exec-path' is `exec-directory'. 4393 ;; The last element of `exec-path' is `exec-directory'.
4394 (mapconcat 'identity (butlast orig-exec-path) ":"))) 4394 (mapconcat #'identity (butlast orig-exec-path) ":")))
4395 ;; The shell "sh" shall always exist. 4395 ;; The shell "sh" shall always exist.
4396 (should (apply 'executable-find '("sh" remote)))) 4396 (should (apply #'executable-find '("sh" remote))))
4397 4397
4398 ;; Cleanup. 4398 ;; Cleanup.
4399 (tramp-cleanup-connection 4399 (tramp-cleanup-connection
@@ -4509,7 +4509,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4509 (string-equal 4509 (string-equal
4510 (make-auto-save-file-name) 4510 (make-auto-save-file-name)
4511 (funcall 4511 (funcall
4512 (if quoted 'tramp-compat-file-name-quote 'identity) 4512 (if quoted #'tramp-compat-file-name-quote #'identity)
4513 (expand-file-name 4513 (expand-file-name
4514 (format "#%s#" (file-name-nondirectory tmp-name1)) 4514 (format "#%s#" (file-name-nondirectory tmp-name1))
4515 tramp-test-temporary-file-directory)))))) 4515 tramp-test-temporary-file-directory))))))
@@ -4583,7 +4583,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4583 (find-backup-file-name tmp-name1) 4583 (find-backup-file-name tmp-name1)
4584 (list 4584 (list
4585 (funcall 4585 (funcall
4586 (if quoted 'tramp-compat-file-name-quote 'identity) 4586 (if quoted #'tramp-compat-file-name-quote #'identity)
4587 (expand-file-name 4587 (expand-file-name
4588 (format "%s~" (file-name-nondirectory tmp-name1)) 4588 (format "%s~" (file-name-nondirectory tmp-name1))
4589 tramp-test-temporary-file-directory))))))) 4589 tramp-test-temporary-file-directory)))))))
@@ -4597,7 +4597,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4597 (find-backup-file-name tmp-name1) 4597 (find-backup-file-name tmp-name1)
4598 (list 4598 (list
4599 (funcall 4599 (funcall
4600 (if quoted 'tramp-compat-file-name-quote 'identity) 4600 (if quoted #'tramp-compat-file-name-quote #'identity)
4601 (expand-file-name 4601 (expand-file-name
4602 (format 4602 (format
4603 "%s~" 4603 "%s~"
@@ -4625,7 +4625,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4625 (find-backup-file-name tmp-name1) 4625 (find-backup-file-name tmp-name1)
4626 (list 4626 (list
4627 (funcall 4627 (funcall
4628 (if quoted 'tramp-compat-file-name-quote 'identity) 4628 (if quoted #'tramp-compat-file-name-quote #'identity)
4629 (expand-file-name 4629 (expand-file-name
4630 (format 4630 (format
4631 "%s~" 4631 "%s~"
@@ -4654,7 +4654,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4654 (find-backup-file-name tmp-name1) 4654 (find-backup-file-name tmp-name1)
4655 (list 4655 (list
4656 (funcall 4656 (funcall
4657 (if quoted 'tramp-compat-file-name-quote 'identity) 4657 (if quoted #'tramp-compat-file-name-quote #'identity)
4658 (expand-file-name 4658 (expand-file-name
4659 (format 4659 (format
4660 "%s~" 4660 "%s~"
@@ -4863,7 +4863,7 @@ This requires restrictions of file name syntax."
4863 (should 4863 (should
4864 (string-equal 4864 (string-equal
4865 (funcall 4865 (funcall
4866 (if quoted 'tramp-compat-file-name-quote 'identity) 4866 (if quoted #'tramp-compat-file-name-quote #'identity)
4867 (car (file-attributes file3))) 4867 (car (file-attributes file3)))
4868 (file-remote-p (file-truename file1) 'localname))) 4868 (file-remote-p (file-truename file1) 'localname)))
4869 ;; Check file contents. 4869 ;; Check file contents.
@@ -4875,10 +4875,10 @@ This requires restrictions of file name syntax."
4875 ;; Check file names. 4875 ;; Check file names.
4876 (should (equal (directory-files 4876 (should (equal (directory-files
4877 tmp-name1 nil directory-files-no-dot-files-regexp) 4877 tmp-name1 nil directory-files-no-dot-files-regexp)
4878 (sort (copy-sequence files) 'string-lessp))) 4878 (sort (copy-sequence files) #'string-lessp)))
4879 (should (equal (directory-files 4879 (should (equal (directory-files
4880 tmp-name2 nil directory-files-no-dot-files-regexp) 4880 tmp-name2 nil directory-files-no-dot-files-regexp)
4881 (sort (copy-sequence files) 'string-lessp))) 4881 (sort (copy-sequence files) #'string-lessp)))
4882 4882
4883 ;; `substitute-in-file-name' could return different 4883 ;; `substitute-in-file-name' could return different
4884 ;; values. For `adb', there could be strange file 4884 ;; values. For `adb', there could be strange file
@@ -4938,7 +4938,7 @@ This requires restrictions of file name syntax."
4938 (should 4938 (should
4939 (string-equal 4939 (string-equal
4940 (funcall 4940 (funcall
4941 (if quoted 'tramp-compat-file-name-quote 'identity) 4941 (if quoted #'tramp-compat-file-name-quote #'identity)
4942 (cadr (car (directory-files-and-attributes 4942 (cadr (car (directory-files-and-attributes
4943 file1 nil (regexp-quote elt1))))) 4943 file1 nil (regexp-quote elt1)))))
4944 (file-remote-p (file-truename file2) 'localname))) 4944 (file-remote-p (file-truename file2) 'localname)))
@@ -5024,9 +5024,9 @@ This requires restrictions of file name syntax."
5024 (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]") 5024 (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]")
5025 "{foo}bar{baz}"))) 5025 "{foo}bar{baz}")))
5026 ;; Simplify test in order to speed up. 5026 ;; Simplify test in order to speed up.
5027 (apply 'tramp--test-check-files 5027 (apply #'tramp--test-check-files
5028 (if (tramp--test-expensive-test) 5028 (if (tramp--test-expensive-test)
5029 files (list (mapconcat 'identity files "")))))) 5029 files (list (mapconcat #'identity files ""))))))
5030 5030
5031;; These tests are inspired by Bug#17238. 5031;; These tests are inspired by Bug#17238.
5032(ert-deftest tramp-test40-special-characters () 5032(ert-deftest tramp-test40-special-characters ()
@@ -5108,7 +5108,7 @@ Use the `ls' command."
5108 (file-name-coding-system 5108 (file-name-coding-system
5109 (coding-system-change-eol-conversion utf8 'unix))) 5109 (coding-system-change-eol-conversion utf8 'unix)))
5110 (apply 5110 (apply
5111 'tramp--test-check-files 5111 #'tramp--test-check-files
5112 (append 5112 (append
5113 (list 5113 (list
5114 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ") 5114 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
@@ -5252,7 +5252,7 @@ process sentinels. They shall not disturb each other."
5252 5252
5253 (with-timeout 5253 (with-timeout
5254 (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler)) 5254 (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))
5255 (define-key special-event-map [sigusr1] 'tramp--test-timeout-handler) 5255 (define-key special-event-map [sigusr1] #'tramp--test-timeout-handler)
5256 (let* (;; For the watchdog. 5256 (let* (;; For the watchdog.
5257 (default-directory (expand-file-name temporary-file-directory)) 5257 (default-directory (expand-file-name temporary-file-directory))
5258 (shell-file-name "/bin/sh") 5258 (shell-file-name "/bin/sh")
@@ -5287,8 +5287,8 @@ process sentinels. They shall not disturb each other."
5287 ;; We must distinguish due to performance reasons. 5287 ;; We must distinguish due to performance reasons.
5288 (timer-operation 5288 (timer-operation
5289 (cond 5289 (cond
5290 ((tramp--test-mock-p) 'vc-registered) 5290 ((tramp--test-mock-p) #'vc-registered)
5291 (t 'file-attributes))) 5291 (t #'file-attributes)))
5292 ;; This is when all timers start. We check inside the 5292 ;; This is when all timers start. We check inside the
5293 ;; timer function, that we don't exceed timeout. 5293 ;; timer function, that we don't exceed timeout.
5294 (timer-start (current-time)) 5294 (timer-start (current-time))
@@ -5414,7 +5414,7 @@ process sentinels. They shall not disturb each other."
5414 tmp-name nil directory-files-no-dot-files-regexp))) 5414 tmp-name nil directory-files-no-dot-files-regexp)))
5415 5415
5416 ;; Cleanup. 5416 ;; Cleanup.
5417 (define-key special-event-map [sigusr1] 'ignore) 5417 (define-key special-event-map [sigusr1] #'ignore)
5418 (ignore-errors (quit-process watchdog)) 5418 (ignore-errors (quit-process watchdog))
5419 (dolist (buf buffers) 5419 (dolist (buf buffers)
5420 (ignore-errors (delete-process (get-buffer-process buf))) 5420 (ignore-errors (delete-process (get-buffer-process buf)))
@@ -5440,7 +5440,7 @@ process sentinels. They shall not disturb each other."
5440 "%s -batch -Q -L %s --eval %s" 5440 "%s -batch -Q -L %s --eval %s"
5441 (shell-quote-argument 5441 (shell-quote-argument
5442 (expand-file-name invocation-name invocation-directory)) 5442 (expand-file-name invocation-name invocation-directory))
5443 (mapconcat 'shell-quote-argument load-path " -L ") 5443 (mapconcat #'shell-quote-argument load-path " -L ")
5444 (shell-quote-argument code))))))) 5444 (shell-quote-argument code)))))))
5445 5445
5446(ert-deftest tramp-test44-delay-load () 5446(ert-deftest tramp-test44-delay-load ()
@@ -5473,7 +5473,7 @@ process sentinels. They shall not disturb each other."
5473 "%s -batch -Q -L %s --eval %s" 5473 "%s -batch -Q -L %s --eval %s"
5474 (shell-quote-argument 5474 (shell-quote-argument
5475 (expand-file-name invocation-name invocation-directory)) 5475 (expand-file-name invocation-name invocation-directory))
5476 (mapconcat 'shell-quote-argument load-path " -L ") 5476 (mapconcat #'shell-quote-argument load-path " -L ")
5477 (shell-quote-argument (format code tm))))))))) 5477 (shell-quote-argument (format code tm)))))))))
5478 5478
5479(ert-deftest tramp-test44-recursive-load () 5479(ert-deftest tramp-test44-recursive-load ()
@@ -5497,7 +5497,7 @@ process sentinels. They shall not disturb each other."
5497 "%s -batch -Q -L %s --eval %s" 5497 "%s -batch -Q -L %s --eval %s"
5498 (shell-quote-argument 5498 (shell-quote-argument
5499 (expand-file-name invocation-name invocation-directory)) 5499 (expand-file-name invocation-name invocation-directory))
5500 (mapconcat 'shell-quote-argument load-path " -L ") 5500 (mapconcat #'shell-quote-argument load-path " -L ")
5501 (shell-quote-argument code)))))))) 5501 (shell-quote-argument code))))))))
5502 5502
5503(ert-deftest tramp-test44-remote-load-path () 5503(ert-deftest tramp-test44-remote-load-path ()
@@ -5526,7 +5526,7 @@ process sentinels. They shall not disturb each other."
5526 "%s -batch -Q -L %s -l tramp-sh --eval %s" 5526 "%s -batch -Q -L %s -l tramp-sh --eval %s"
5527 (shell-quote-argument 5527 (shell-quote-argument
5528 (expand-file-name invocation-name invocation-directory)) 5528 (expand-file-name invocation-name invocation-directory))
5529 (mapconcat 'shell-quote-argument load-path " -L ") 5529 (mapconcat #'shell-quote-argument load-path " -L ")
5530 (shell-quote-argument code))))))) 5530 (shell-quote-argument code)))))))
5531 5531
5532(ert-deftest tramp-test45-unload () 5532(ert-deftest tramp-test45-unload ()
@@ -5554,7 +5554,7 @@ Since it unloads Tramp, it shall be the last test to run."
5554 (all-completions 5554 (all-completions
5555 "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features)))) 5555 "tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features))))
5556 ;; `file-name-handler-alist' must be clean. 5556 ;; `file-name-handler-alist' must be clean.
5557 (should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist))) 5557 (should-not (all-completions "tramp" (mapcar #'cdr file-name-handler-alist)))
5558 ;; There shouldn't be left a bound symbol, except buffer-local 5558 ;; There shouldn't be left a bound symbol, except buffer-local
5559 ;; variables, and autoload functions. We do not regard our test 5559 ;; variables, and autoload functions. We do not regard our test
5560 ;; symbols, and the Tramp unload hooks. 5560 ;; symbols, and the Tramp unload hooks.
@@ -5589,7 +5589,8 @@ Since it unloads Tramp, it shall be the last test to run."
5589 "Run all tests for \\[tramp]." 5589 "Run all tests for \\[tramp]."
5590 (interactive "p") 5590 (interactive "p")
5591 (funcall 5591 (funcall
5592 (if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) "^tramp")) 5592 (if interactive
5593 #'ert-run-tests-interactively #'ert-run-tests-batch) "^tramp"))
5593 5594
5594;; TODO: 5595;; TODO:
5595 5596