Commit a80e1045 authored by Michael Albinus's avatar Michael Albinus

Use proper read syntax for all function names in Tramp

* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sudoedit.el:
* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use proper read syntax for all
function names.
parent 4927f947
......@@ -232,7 +232,7 @@ pass to the OPERATION."
;; Preserve trailing "/".
(funcall
(if (string-equal (file-name-nondirectory filename) "")
'file-name-as-directory 'identity)
#'file-name-as-directory #'identity)
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name
v
......@@ -257,14 +257,14 @@ pass to the OPERATION."
(setq thisstep (pop steps))
(tramp-message
v 5 "Check %s"
(mapconcat 'identity
(mapconcat #'identity
(append '("") (reverse result) (list thisstep))
"/"))
(setq symlink-target
(tramp-compat-file-attribute-type
(file-attributes
(tramp-make-tramp-file-name
v (mapconcat 'identity
v (mapconcat #'identity
(append
'("") (reverse result) (list thisstep))
"/")))))
......@@ -302,7 +302,7 @@ pass to the OPERATION."
;; Combine list to form string.
(setq result
(if result
(mapconcat 'identity (cons "" result) "/")
(mapconcat #'identity (cons "" result) "/")
"/"))
(when (and is-dir (or (string= "" result)
(not (string= (substring result -1) "/"))))
......@@ -444,7 +444,7 @@ pass to the OPERATION."
"Almquist shell can't handle multiple arguments.
Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"."
(split-string
(apply 'concat
(apply #'concat
(mapcar (lambda (s)
(replace-regexp-in-string
"\\(.\\)" " -\\1" (replace-regexp-in-string "^-" "" s)))
......@@ -476,10 +476,10 @@ Emacs dired can't find files."
(sort
lines
(if sort-by-time
'tramp-adb-ls-output-time-less-p
'tramp-adb-ls-output-name-less-p))))
#'tramp-adb-ls-output-time-less-p
#'tramp-adb-ls-output-name-less-p))))
(delete-region (point-min) (point-max))
(insert " " (mapconcat 'identity sorted-lines "\n ")))
(insert " " (mapconcat #'identity sorted-lines "\n ")))
;; Add final newline.
(goto-char (point-max))
(unless (bolp) (insert "\n"))))
......@@ -634,7 +634,7 @@ But handle the case, if the \"test\" command is not available."
(copy-file filename tmpfile 'ok)
(set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600)))
(tramp-run-real-handler
'write-region (list start end tmpfile append 'no-message lockname))
#'write-region (list start end tmpfile append 'no-message lockname))
(with-tramp-progress-reporter
v 3 (format-message
"Moving tmp file `%s' to `%s'" tmpfile filename)
......@@ -827,7 +827,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(with-parsed-tramp-file-name default-directory nil
(let (command input tmpinput stderr tmpstderr outbuf ret)
;; Compute command.
(setq command (mapconcat 'tramp-shell-quote-argument
(setq command (mapconcat #'tramp-shell-quote-argument
(cons program args) " "))
;; Determine input.
(if (null infile)
......@@ -970,7 +970,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(if (and (not current-buffer-p) (integerp asynchronous))
(prog1
;; Run the process.
(apply 'start-file-process "*Async Shell*" buffer args)
(apply #'start-file-process "*Async Shell*" buffer args)
;; Display output.
(pop-to-buffer output-buffer)
(setq mode-line-process '(":%s"))
......@@ -978,7 +978,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(prog1
;; Run the process.
(apply 'process-file (car args) nil buffer nil (cdr args))
(apply #'process-file (car args) nil buffer nil (cdr args))
;; Insert error messages if they were separated.
(when (listp buffer)
(with-current-buffer error-buffer
......@@ -1014,25 +1014,25 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(sentinel (plist-get args :sentinel))
(stderr (plist-get args :stderr)))
(unless (stringp name)
(signal 'wrong-type-argument (list 'stringp name)))
(signal 'wrong-type-argument (list #'stringp name)))
(unless (or (null buffer) (bufferp buffer) (stringp buffer))
(signal 'wrong-type-argument (list 'stringp buffer)))
(signal 'wrong-type-argument (list #'stringp buffer)))
(unless (consp command)
(signal 'wrong-type-argument (list 'consp command)))
(signal 'wrong-type-argument (list #'consp command)))
(unless (or (null coding)
(and (symbolp coding) (memq coding coding-system-list))
(and (consp coding)
(memq (car coding) coding-system-list)
(memq (cdr coding) coding-system-list)))
(signal 'wrong-type-argument (list 'symbolp coding)))
(signal 'wrong-type-argument (list #'symbolp coding)))
(unless (or (null connection-type) (memq connection-type '(pipe pty)))
(signal 'wrong-type-argument (list 'symbolp connection-type)))
(signal 'wrong-type-argument (list #'symbolp connection-type)))
(unless (or (null filter) (functionp filter))
(signal 'wrong-type-argument (list 'functionp filter)))
(signal 'wrong-type-argument (list #'functionp filter)))
(unless (or (null sentinel) (functionp sentinel))
(signal 'wrong-type-argument (list 'functionp sentinel)))
(signal 'wrong-type-argument (list #'functionp sentinel)))
(unless (or (null stderr) (bufferp stderr) (stringp stderr))
(signal 'wrong-type-argument (list 'stringp stderr)))
(signal 'wrong-type-argument (list #'stringp stderr)))
(let* ((buffer
(if buffer
......@@ -1044,7 +1044,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(command
(format "cd %s; %s"
(tramp-shell-quote-argument localname)
(mapconcat 'tramp-shell-quote-argument
(mapconcat #'tramp-shell-quote-argument
(cons program args) " ")))
(tramp-process-connection-type
(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\"
(with-tramp-connection-property (tramp-get-connection-process vec) "device"
(let* ((host (tramp-file-name-host vec))
(port (tramp-file-name-port-or-default vec))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
(devices (mapcar #'cadr (tramp-adb-parse-device-names nil))))
(replace-regexp-in-string
tramp-prefix-port-format ":"
(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\"
(prog1
(unless
(zerop
(apply 'tramp-call-process vec tramp-adb-program nil t nil args))
(apply #'tramp-call-process vec tramp-adb-program nil t nil args))
(buffer-string))
(tramp-message vec 6 "%s" (buffer-string)))))
......@@ -1232,7 +1232,7 @@ the exit status is not equal 0, and t otherwise."
"Run COMMAND, check exit status, throw error if exit status not okay.
FMT and ARGS are passed to `error'."
(unless (tramp-adb-send-command-and-check vec command)
(apply 'tramp-error vec 'file-error fmt args)))
(apply #'tramp-error vec 'file-error fmt args)))
(defun tramp-adb-wait-for-output (proc &optional timeout)
"Wait for output from remote command."
......@@ -1308,12 +1308,12 @@ connection if a previous connection has died for some reason."
(list "shell")))
(p (let ((default-directory
(tramp-compat-temporary-file-directory)))
(apply 'start-process (tramp-get-connection-name vec) buf
(apply #'start-process (tramp-get-connection-name vec) buf
tramp-adb-program args)))
(prompt (md5 (concat (prin1-to-string process-environment)
(current-time-string)))))
(tramp-message
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
vec 6 "%s" (mapconcat #'identity (process-command p) " "))
;; Wait for initial prompt. On some devices, it needs an
;; initial RET, in order to get it.
(sleep-for 0.1)
......@@ -1322,7 +1322,7 @@ connection if a previous connection has died for some reason."
(unless (process-live-p p)
(tramp-error vec 'file-error "Terminated!"))
(process-put p 'vector vec)
(process-put p 'adjust-window-size-function 'ignore)
(process-put p 'adjust-window-size-function #'ignore)
(set-process-query-on-exit-flag p nil)
;; Change prompt.
......
......@@ -201,8 +201,8 @@ It must be supported by libarchive(3).")
(defconst tramp-archive-all-gvfs-methods
(cons tramp-archive-method
(let ((values (cdr (cadr (get 'tramp-gvfs-methods 'custom-type)))))
(setq values (mapcar 'last values)
values (mapcar 'car values))))
(setq values (mapcar #'last values)
values (mapcar #'car values))))
"List of all methods `tramp-gvfs-methods' offers.")
......@@ -287,8 +287,9 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
(defsubst tramp-archive-file-name-for-operation (operation &rest args)
"Like `tramp-file-name-for-operation', but for archive file name syntax."
(cl-letf (((symbol-function 'tramp-tramp-file-p) 'tramp-archive-file-name-p))
(apply 'tramp-file-name-for-operation operation args)))
(cl-letf (((symbol-function #'tramp-tramp-file-p)
#'tramp-archive-file-name-p))
(apply #'tramp-file-name-for-operation operation args)))
(defun tramp-archive-run-real-handler (operation args)
"Invoke normal file name handler for OPERATION.
......@@ -313,14 +314,14 @@ pass to the OPERATION."
(tramp-register-file-name-handlers)
(tramp-archive-run-real-handler operation args))
(let* ((filename (apply 'tramp-archive-file-name-for-operation
(let* ((filename (apply #'tramp-archive-file-name-for-operation
operation args))
(archive (tramp-archive-file-name-archive filename)))
;; The file archive could be a directory, see Bug#30293.
(if (and archive
(tramp-archive-run-real-handler
'file-directory-p (list archive)))
#'file-directory-p (list archive)))
(tramp-archive-run-real-handler operation args)
;; Now run the handler.
(let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods))
......@@ -329,7 +330,7 @@ pass to the OPERATION."
(tramp-unknown-id-integer (user-uid))
(tramp-unknown-id-string (user-login-name))
(fn (assoc operation tramp-archive-file-name-handler-alist)))
(when (eq (cdr fn) 'tramp-archive-handle-not-implemented)
(when (eq (cdr fn) #'tramp-archive-handle-not-implemented)
(setq args (cons operation args)))
(if fn
(save-match-data (apply (cdr fn) args))
......@@ -337,7 +338,7 @@ pass to the OPERATION."
;;;###autoload
(defalias
'tramp-archive-autoload-file-name-handler 'tramp-autoload-file-name-handler)
'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler)
;;;###autoload
(progn (defun tramp-register-archive-file-name-handler ()
......@@ -345,17 +346,17 @@ pass to the OPERATION."
(when tramp-archive-enabled
(add-to-list 'file-name-handler-alist
(cons (tramp-archive-autoload-file-name-regexp)
'tramp-archive-autoload-file-name-handler))
#'tramp-archive-autoload-file-name-handler))
(put 'tramp-archive-autoload-file-name-handler 'safe-magic t))))
;;;###autoload
(progn
(add-hook 'after-init-hook 'tramp-register-archive-file-name-handler)
(add-hook 'after-init-hook #'tramp-register-archive-file-name-handler)
(add-hook
'tramp-archive-unload-hook
(lambda ()
(remove-hook
'after-init-hook 'tramp-register-archive-file-name-handler))))
'after-init-hook #'tramp-register-archive-file-name-handler))))
;; In older Emacsen (prior 27.1), the autoload above does not exist.
;; So we call it again; it doesn't hurt.
......@@ -363,19 +364,19 @@ pass to the OPERATION."
;; Mark `operations' the handler is responsible for.
(put 'tramp-archive-file-name-handler 'operations
(mapcar 'car tramp-archive-file-name-handler-alist))
(mapcar #'car tramp-archive-file-name-handler-alist))
;; `tramp-archive-file-name-handler' must be placed before `url-file-handler'.
(when url-handler-mode (tramp-register-file-name-handlers))
(eval-after-load 'url-handler
'(progn
(add-hook 'url-handler-mode-hook 'tramp-register-file-name-handlers)
(add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers)
(add-hook
'tramp-archive-unload-hook
(lambda ()
(remove-hook
'url-handler-mode-hook 'tramp-register-file-name-handlers)))))
'url-handler-mode-hook #'tramp-register-file-name-handlers)))))
;; File name conversions.
......@@ -455,9 +456,9 @@ name is kept in slot `hop'"
;; Anything else. Here we call `file-local-copy', which we
;; have avoided so far.
(t (let* ((inhibit-file-name-operation 'file-local-copy)
(t (let* ((inhibit-file-name-operation #'file-local-copy)
(inhibit-file-name-handlers
(cons 'jka-compr-handler inhibit-file-name-handlers))
(cons #'jka-compr-handler inhibit-file-name-handlers))
(copy (file-local-copy archive)))
(setf (tramp-file-name-host vec) (tramp-archive-gvfs-host copy))
(puthash archive (cons vec copy) tramp-archive-hash))))
......@@ -481,14 +482,14 @@ name is kept in slot `hop'"
tramp-archive-hash)
(clrhash tramp-archive-hash))
(add-hook 'tramp-cleanup-all-connections-hook 'tramp-archive-cleanup-hash)
(add-hook 'kill-emacs-hook 'tramp-archive-cleanup-hash)
(add-hook 'tramp-cleanup-all-connections-hook #'tramp-archive-cleanup-hash)
(add-hook 'kill-emacs-hook #'tramp-archive-cleanup-hash)
(add-hook 'tramp-archive-unload-hook
(lambda ()
(remove-hook 'tramp-cleanup-all-connections-hook
'tramp-archive-cleanup-hash)
#'tramp-archive-cleanup-hash)
(remove-hook 'kill-emacs-hook
'tramp-archive-cleanup-hash)))
#'tramp-archive-cleanup-hash)))
(defsubst tramp-file-name-archive (vec)
"Extract the archive file name from VEC.
......@@ -638,7 +639,7 @@ offered."
"Generic handler for operations not implemented for file archives."
(let ((v (ignore-errors
(tramp-archive-dissect-file-name
(apply 'tramp-archive-file-name-for-operation operation args)))))
(apply #'tramp-archive-file-name-for-operation operation args)))))
(tramp-message v 10 "%s" (cons operation args))
(tramp-error
v 'file-error
......
......@@ -69,7 +69,7 @@
;;; -- Cache --
;;;###tramp-autoload
(defvar tramp-cache-data (make-hash-table :test 'equal)
(defvar tramp-cache-data (make-hash-table :test #'equal)
"Hash table for remote files properties.")
;;;###tramp-autoload
......@@ -101,7 +101,7 @@ If it doesn't exist yet, it is created and initialized with
matching entries of `tramp-connection-properties'."
(or (gethash key tramp-cache-data)
(let ((hash
(puthash key (make-hash-table :test 'equal) tramp-cache-data)))
(puthash key (make-hash-table :test #'equal) tramp-cache-data)))
(when (tramp-file-name-p key)
(dolist (elt tramp-connection-properties)
(when (string-match-p
......@@ -118,7 +118,7 @@ Returns DEFAULT if not set."
(setq file (tramp-compat-file-name-unquote file)
key (copy-tramp-file-name key))
(setf (tramp-file-name-localname key)
(tramp-run-real-handler 'directory-file-name (list file))
(tramp-run-real-handler #'directory-file-name (list file))
(tramp-file-name-hop key) nil)
(let* ((hash (tramp-get-hash-table key))
(value (when (hash-table-p hash) (gethash property hash))))
......@@ -161,7 +161,7 @@ Returns VALUE."
(setq file (tramp-compat-file-name-unquote file)
key (copy-tramp-file-name key))
(setf (tramp-file-name-localname key)
(tramp-run-real-handler 'directory-file-name (list file))
(tramp-run-real-handler #'directory-file-name (list file))
(tramp-file-name-hop key) nil)
(let ((hash (tramp-get-hash-table key)))
;; We put the timestamp there.
......@@ -184,7 +184,7 @@ Returns VALUE."
(setq file (tramp-compat-file-name-unquote file)
key (copy-tramp-file-name key))
(setf (tramp-file-name-localname key)
(tramp-run-real-handler 'directory-file-name (list file))
(tramp-run-real-handler #'directory-file-name (list file))
(tramp-file-name-hop key) nil)
(remhash property (tramp-get-hash-table key))
(tramp-message key 8 "%s %s" file property)
......@@ -196,7 +196,7 @@ Returns VALUE."
(defun tramp-flush-file-properties (key file)
"Remove all properties of FILE in the cache context of KEY."
(let* ((file (tramp-run-real-handler
'directory-file-name (list file)))
#'directory-file-name (list file)))
(truename (tramp-get-file-property key file "file-truename" nil)))
;; Unify localname. Remove hop from `tramp-file-name' structure.
(setq file (tramp-compat-file-name-unquote file)
......@@ -216,7 +216,7 @@ Returns VALUE."
Remove also properties of all files in subdirectories."
(setq directory (tramp-compat-file-name-unquote directory))
(let* ((directory (tramp-run-real-handler
'directory-file-name (list directory)))
#'directory-file-name (list directory)))
(truename (tramp-get-file-property key directory "file-truename" nil)))
(tramp-message key 8 "%s" directory)
(maphash
......@@ -369,7 +369,7 @@ used to cache connection properties of the local machine."
(when (tramp-file-name-p key)
;; (dolist
;; (slot
;; (mapcar 'car (cdr (cl-struct-slot-info 'tramp-file-name))))
;; (mapcar #'car (cdr (cl-struct-slot-info 'tramp-file-name))))
;; (when (stringp (cl-struct-slot-value 'tramp-file-name slot key))
;; (setf (cl-struct-slot-value 'tramp-file-name slot key)
;; (substring-no-properties
......
......@@ -55,9 +55,9 @@ SYNTAX can be one of the symbols `default' (default),
"Return a list of all Tramp connection buffers."
(append
(all-completions
"*tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list))))
"*tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list))))
(all-completions
"*debug tramp" (mapcar 'list (mapcar 'buffer-name (buffer-list))))))
"*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list))))))
(defun tramp-list-remote-buffers ()
"Return a list of all buffers with remote default-directory."
......@@ -85,7 +85,7 @@ When called interactively, a Tramp connection has to be selected."
;; Return nil when there is no Tramp connection.
(list
(let ((connections
(mapcar 'tramp-make-tramp-file-name (tramp-list-connections)))
(mapcar #'tramp-make-tramp-file-name (tramp-list-connections)))
name)
(when connections
......@@ -216,7 +216,7 @@ This includes password cache, file cache, connection cache, buffers."
(lambda (x)
(and x (boundp x) (cons x 'tramp-reporter-dump-variable)))
(append
(mapcar 'intern (all-completions "tramp-" obarray 'boundp))
(mapcar #'intern (all-completions "tramp-" obarray #'boundp))
;; Non-tramp variables of interest.
'(shell-prompt-pattern
backup-by-copying
......@@ -330,11 +330,11 @@ buffer in your bug report.
(sort
(append
(mapcar
'intern
#'intern
(all-completions "tramp-" (buffer-local-variables buffer)))
;; Non-tramp variables of interest.
'(connection-local-variables-alist default-directory))
'string<))
#'string<))
(reporter-dump-variable varsym elbuf))
(lisp-indent-line)
(insert ")\n"))
......@@ -412,7 +412,7 @@ please ensure that the buffers are attached to your email.\n\n"))
(kill-buffer nil)
(throw 'dont-send nil))))))
(defalias 'tramp-submit-bug 'tramp-bug)
(defalias 'tramp-submit-bug #'tramp-bug)
(add-hook 'tramp-unload-hook
(lambda () (unload-feature 'tramp-cmds 'force)))
......
......@@ -73,7 +73,7 @@ Add the extension of F, if existing."
;; `temporary-file-directory' as function is introduced with Emacs 26.1.
(defalias 'tramp-compat-temporary-file-directory-function
(if (fboundp 'temporary-file-directory)
'temporary-file-directory
#'temporary-file-directory
'tramp-handle-temporary-file-directory))
(defun tramp-compat-process-running-p (process-name)
......@@ -102,12 +102,12 @@ Add the extension of F, if existing."
;; `default-toplevel-value' has been declared in Emacs 24.4.
(unless (fboundp 'default-toplevel-value)
(defalias 'default-toplevel-value 'symbol-value))
(defalias 'default-toplevel-value #'symbol-value))
;; `file-attribute-*' are introduced in Emacs 25.1.
(if (fboundp 'file-attribute-type)
(defalias 'tramp-compat-file-attribute-type 'file-attribute-type)
(defalias 'tramp-compat-file-attribute-type #'file-attribute-type)
(defsubst tramp-compat-file-attribute-type (attributes)
"The type field in ATTRIBUTES returned by `file-attributes'.
The value is either t for directory, string (name linked to) for
......@@ -116,13 +116,13 @@ symbolic link, or nil."
(if (fboundp 'file-attribute-link-number)
(defalias 'tramp-compat-file-attribute-link-number
'file-attribute-link-number)
#'file-attribute-link-number)
(defsubst tramp-compat-file-attribute-link-number (attributes)
"Return the number of links in ATTRIBUTES returned by `file-attributes'."
(nth 1 attributes)))
(if (fboundp 'file-attribute-user-id)
(defalias 'tramp-compat-file-attribute-user-id 'file-attribute-user-id)
(defalias 'tramp-compat-file-attribute-user-id #'file-attribute-user-id)
(defsubst tramp-compat-file-attribute-user-id (attributes)
"The UID field in ATTRIBUTES returned by `file-attributes'.
This is either a string or a number. If a string value cannot be
......@@ -131,7 +131,7 @@ returned."
(nth 2 attributes)))
(if (fboundp 'file-attribute-group-id)
(defalias 'tramp-compat-file-attribute-group-id 'file-attribute-group-id)
(defalias 'tramp-compat-file-attribute-group-id #'file-attribute-group-id)
(defsubst tramp-compat-file-attribute-group-id (attributes)
"The GID field in ATTRIBUTES returned by `file-attributes'.
This is either a string or a number. If a string value cannot be
......@@ -141,7 +141,7 @@ returned."
(if (fboundp 'file-attribute-modification-time)
(defalias 'tramp-compat-file-attribute-modification-time
'file-attribute-modification-time)
#'file-attribute-modification-time)
(defsubst tramp-compat-file-attribute-modification-time (attributes)
"The modification time in ATTRIBUTES returned by `file-attributes'.
This 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'."
(nth 5 attributes)))
(if (fboundp 'file-attribute-size)
(defalias 'tramp-compat-file-attribute-size 'file-attribute-size)
(defalias 'tramp-compat-file-attribute-size #'file-attribute-size)
(defsubst tramp-compat-file-attribute-size (attributes)
"The size (in bytes) in ATTRIBUTES returned by `file-attributes'.
If 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."
(nth 7 attributes)))
(if (fboundp 'file-attribute-modes)
(defalias 'tramp-compat-file-attribute-modes 'file-attribute-modes)
(defalias 'tramp-compat-file-attribute-modes #'file-attribute-modes)
(defsubst tramp-compat-file-attribute-modes (attributes)
"The file modes in ATTRIBUTES returned by `file-attributes'.
This 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."
;; `format-message' is new in Emacs 25.1.
(unless (fboundp 'format-message)
(defalias 'format-message 'format))
(defalias 'format-message #'format))
;; `directory-name-p' is new in Emacs 25.1.
(if (fboundp 'directory-name-p)
(defalias 'tramp-compat-directory-name-p 'directory-name-p)
(defalias 'tramp-compat-directory-name-p #'directory-name-p)
(defsubst tramp-compat-directory-name-p (name)
"Return non-nil if NAME ends with a directory separator character."
(let ((len (length name))
......@@ -189,7 +189,7 @@ This is a string of ten letters or dashes as in ls -l."
;; `file-name-unquote' are introduced in Emacs 26.
(eval-and-compile
(if (fboundp 'file-local-name)
(defalias 'tramp-compat-file-local-name 'file-local-name)
(defalias 'tramp-compat-file-local-name #'file-local-name)
(defsubst tramp-compat-file-local-name (name)
"Return the local name component of NAME.
It 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
(or (file-remote-p name 'localname) name)))
(if (fboundp 'file-name-quoted-p)
(defalias 'tramp-compat-file-name-quoted-p 'file-name-quoted-p)
(defalias 'tramp-compat-file-name-quoted-p #'file-name-quoted-p)
(defsubst tramp-compat-file-name-quoted-p (name)
"Whether NAME is quoted with prefix \"/:\".
If NAME is a remote file name, check the local part of NAME."
(string-prefix-p "/:" (tramp-compat-file-local-name name))))
(if (fboundp 'file-name-quote)
(defalias 'tramp-compat-file-name-quote 'file-name-quote)
(defalias 'tramp-compat-file-name-quote #'file-name-quote)
(defsubst tramp-compat-file-name-quote (name)
"Add the quotation prefix \"/:\" to file NAME.
If 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."
(file-remote-p name) "/:" (tramp-compat-file-local-name name)))))
(if (fboundp 'file-name-unquote)
(defalias 'tramp-compat-file-name-unquote 'file-name-unquote)
(defalias 'tramp-compat-file-name-unquote #'file-name-unquote)
(defsubst tramp-compat-file-name-unquote (name)
"Remove quotation prefix \"/:\" from file NAME.
If 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."
;; `cl-struct-slot-info' has been introduced with Emacs 25.
(defmacro tramp-compat-tramp-file-name-slots ()
(if (fboundp 'cl-struct-slot-info)
'(cdr (mapcar 'car (cl-struct-slot-info 'tramp-file-name)))
'(cdr (mapcar 'car (get 'tramp-file-name 'cl-struct-slots)))))
'(cdr (mapcar #'car (cl-struct-slot-info 'tramp-file-name)))
'(cdr (mapcar #'car (get 'tramp-file-name 'cl-struct-slots)))))
;; The signature of `tramp-make-tramp-file-name' has been changed.
;; 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."
;; `exec-path' is new in Emacs 27.1.
(eval-and-compile
(if (fboundp 'exec-path)
(defalias 'tramp-compat-exec-path 'exec-path)
(defalias 'tramp-compat-exec-path #'exec-path)
(defun tramp-compat-exec-path ()
"List of directories to search programs to run in remote subprocesses."
(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."
;; `time-equal-p' has appeared in Emacs 27.1.
(if (fboundp 'time-equal-p)
(defalias 'tramp-compat-time-equal-p 'time-equal-p)
(defalias 'tramp-compat-time-equal-p #'time-equal-p)
(defsubst tramp-compat-time-equal-p (t1 t2)
"Return non-nil if time value T1 is equal to time value T2.
A 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."
;; `flatten-tree' has appeared in Emacs 27.1.
(if (fboundp 'flatten-tree)
(defalias 'tramp-compat-flatten-tree 'flatten-tree)
(defalias 'tramp-compat-flatten-tree #'flatten-tree)
(defun tramp-compat-flatten-tree (tree)
"Take TREE and \"flatten\" it."
(let (elems)
......@@ -288,7 +288,7 @@ A nil value for either argument stands for the current time."
;;; TODO:
;; * When we get rid of Emacs 24, replace "(mapconcat 'identity" by
;; * When we get rid of Emacs 24, replace "(mapconcat #'identity" by
;; "(string-join".
;;; tramp-compat.el ends here
......@@ -85,7 +85,7 @@ present for backward compatibility."
ange-ftp-completion-hook-function)
file-name-handler-alist)))))
(add-hook 'tramp-ftp-unload-hook 'tramp-ftp-enable-ange-ftp)
(add-hook 'tramp-ftp-unload-hook #'tramp-ftp-enable-ange-ftp)
;; Define FTP method ...
;;;###tramp-autoload
......@@ -138,7 +138,7 @@ pass to the OPERATION."
;; because this returns another user but the one declared in
;; "~/.netrc".
((memq operation '(file-directory-p file-exists-p))
(if (apply 'ange-ftp-hook-function operation args)
(if (apply #'ange-ftp-hook-function operation args)
(let ((v (tramp-dissect-file-name (car args) t)))
(setf (tramp-file-name-method v) tramp-ftp-method)
(tramp-set-connection-property v "started" t))
......@@ -172,7 +172,7 @@ pass to the OPERATION."
(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
(inhibit-file-name-operation operation))
(apply 'ange-ftp-hook-function operation args)))))))
(apply #'ange-ftp-hook-function operation args)))))))
;; It must be a `defsubst' in order to push the whole code into
;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
......
......@@ -68,7 +68,7 @@
;; (message
;; "%s"
;; (mapcar
;; 'car
;; #'car
;; (dbus-call-method
;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
;; tramp-gvfs-interface-mounttracker "ListMountableInfo")))
......@@ -657,7 +657,7 @@ Return nil for null BYTE-ARRAY."
(cons (tramp-gvfs-stringify-dbus-message (car message))
(tramp-gvfs-stringify-dbus-message (cdr message))))
((consp message)
(mapcar 'tramp-gvfs-stringify-dbus-message message))
(mapcar #'tramp-gvfs-stringify-dbus-message message))
((stringp message)
(format "%S" message))
(t message)))
......@@ -681,7 +681,7 @@ it is an asynchronous call, with `ignore' as callback function.
The other arguments have the same meaning as with `dbus-call-method'
or `dbus-call-method-asynchronously'."
`(let ((func (if ,synchronous
'dbus-call-method 'dbus-call-method-asynchronously))
#'dbus-call-method #'dbus-call-method-asynchronously))
(args (append (list ,bus ,service ,path ,interface ,method)
(if ,synchronous (list ,@args) (list 'ignore ,@args)))))
(tramp-dbus-function ,vec func args)))
......@@ -698,10 +698,10 @@ The call will be traced by Tramp with trace level 6."
`(when (member
,interface
(tramp-dbus-function
,vec 'dbus-introspect-get-interface-names
,vec #'dbus-introspect-get-interface-names
(list ,bus ,service ,path)))
(tramp-dbus-function
,vec 'dbus-get-all-properties (list ,bus ,service ,path ,interface))))
,vec #'dbus-get-all-properties (list ,bus ,service ,path ,interface))))
(put 'with-tramp-dbus-get-all-properties 'lisp-indent-function 1)
(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.")
(add-hook
(if (boundp 'dbus-event-error-functions)
'dbus-event-error-functions 'dbus-event-error-hooks)
'tramp-gvfs-dbus-event-error)
#'tramp-gvfs-dbus-event-error)
;; File name primitives.
......@@ -783,7 +783,7 @@ file names."
v 0 (format "%s %s to %s" msg-operation filename newname)
(unless
(apply
'tramp-gvfs-send-command v gvfs-operation
#'tramp-gvfs-send-command v gvfs-operation
(append
(and (eq op 'copy) (or keep-date preserve-uid-gid)
'("--preserve"))
......@@ -888,7 +888,7 @@ file names."
(setq name (concat (file-name-as-directory dir) name)))
;; If NAME is not a Tramp file, run the real handler.