mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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.
This commit is contained in:
parent
4927f94792
commit
a80e10458a
15 changed files with 354 additions and 349 deletions
|
|
@ -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.
|
||||
(if (not (tramp-tramp-file-p name))
|
||||
(tramp-run-real-handler 'expand-file-name (list name nil))
|
||||
(tramp-run-real-handler #'expand-file-name (list name nil))
|
||||
;; Dissect NAME.
|
||||
(with-parsed-tramp-file-name name nil
|
||||
;; If there is a default location, expand tilde.
|
||||
|
|
@ -907,7 +907,7 @@ file names."
|
|||
(tramp-error
|
||||
v 'file-error
|
||||
"Cannot expand tilde in file `%s'" name))
|
||||
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
|
||||
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
|
||||
(setq localname (concat "/" localname)))
|
||||
;; We do not pass "/..".
|
||||
(if (string-match-p "^\\(afp\\|davs?\\|smb\\)$" method)
|
||||
|
|
@ -921,7 +921,7 @@ file names."
|
|||
;; No tilde characters in file name, do normal
|
||||
;; `expand-file-name' (this does "/./" and "/../").
|
||||
(tramp-make-tramp-file-name
|
||||
v (tramp-run-real-handler 'expand-file-name (list localname))))))
|
||||
v (tramp-run-real-handler #'expand-file-name (list localname))))))
|
||||
|
||||
(defun tramp-gvfs-get-directory-attributes (directory)
|
||||
"Return GVFS attributes association list of all files in DIRECTORY."
|
||||
|
|
@ -935,7 +935,7 @@ file names."
|
|||
;; Send command.
|
||||
(tramp-gvfs-send-command
|
||||
v "gvfs-ls" "-h" "-n" "-a"
|
||||
(mapconcat 'identity tramp-gvfs-file-attributes ",")
|
||||
(mapconcat #'identity tramp-gvfs-file-attributes ",")
|
||||
(tramp-gvfs-url-file-name directory))
|
||||
;; Parse output.
|
||||
(with-current-buffer (tramp-get-connection-buffer v)
|
||||
|
|
@ -1170,20 +1170,20 @@ If FILE-SYSTEM is non-nil, return file system attributes."
|
|||
'(created changed changes-done-hint moved deleted))
|
||||
((memq 'attribute-change flags) '(attribute-changed))))
|
||||
(p (apply
|
||||
'start-process
|
||||
#'start-process
|
||||
"gvfs-monitor" (generate-new-buffer " *gvfs-monitor*")
|
||||
`("gio" "monitor" ,(tramp-gvfs-url-file-name file-name)))))
|
||||
(if (not (processp p))
|
||||
(tramp-error
|
||||
v 'file-notify-error "Monitoring not supported for `%s'" file-name)
|
||||
(tramp-message
|
||||
v 6 "Run `%s', %S" (mapconcat 'identity (process-command p) " ") p)
|
||||
v 6 "Run `%s', %S" (mapconcat #'identity (process-command p) " ") p)
|
||||
(process-put p 'vector v)
|
||||
(process-put p 'events events)
|
||||
(process-put p 'watch-name localname)
|
||||
(process-put p 'adjust-window-size-function 'ignore)
|
||||
(process-put p 'adjust-window-size-function #'ignore)
|
||||
(set-process-query-on-exit-flag p nil)
|
||||
(set-process-filter p 'tramp-gvfs-monitor-process-filter)
|
||||
(set-process-filter p #'tramp-gvfs-monitor-process-filter)
|
||||
;; There might be an error if the monitor is not supported.
|
||||
;; Give the filter a chance to read the output.
|
||||
(while (tramp-accept-process-output p 0))
|
||||
|
|
@ -1305,7 +1305,7 @@ file-notify events."
|
|||
'rename filename newname ok-if-already-exists
|
||||
'keep-date 'preserve-uid-gid)
|
||||
(tramp-run-real-handler
|
||||
'rename-file (list filename newname ok-if-already-exists))))
|
||||
#'rename-file (list filename newname ok-if-already-exists))))
|
||||
|
||||
|
||||
;; File name conversions.
|
||||
|
|
@ -1514,20 +1514,20 @@ file-notify events."
|
|||
(dbus-register-signal
|
||||
:session nil tramp-gvfs-path-mounttracker
|
||||
tramp-gvfs-interface-mounttracker "mounted"
|
||||
'tramp-gvfs-handler-mounted-unmounted)
|
||||
#'tramp-gvfs-handler-mounted-unmounted)
|
||||
(dbus-register-signal
|
||||
:session nil tramp-gvfs-path-mounttracker
|
||||
tramp-gvfs-interface-mounttracker "Mounted"
|
||||
'tramp-gvfs-handler-mounted-unmounted)
|
||||
#'tramp-gvfs-handler-mounted-unmounted)
|
||||
|
||||
(dbus-register-signal
|
||||
:session nil tramp-gvfs-path-mounttracker
|
||||
tramp-gvfs-interface-mounttracker "unmounted"
|
||||
'tramp-gvfs-handler-mounted-unmounted)
|
||||
#'tramp-gvfs-handler-mounted-unmounted)
|
||||
(dbus-register-signal
|
||||
:session nil tramp-gvfs-path-mounttracker
|
||||
tramp-gvfs-interface-mounttracker "Unmounted"
|
||||
'tramp-gvfs-handler-mounted-unmounted))
|
||||
#'tramp-gvfs-handler-mounted-unmounted))
|
||||
|
||||
(defun tramp-gvfs-connection-mounted-p (vec)
|
||||
"Check, whether the location is already mounted."
|
||||
|
|
@ -1782,22 +1782,22 @@ connection if a previous connection has died for some reason."
|
|||
(dbus-register-method
|
||||
:session dbus-service-emacs object-path
|
||||
tramp-gvfs-interface-mountoperation "askPassword"
|
||||
'tramp-gvfs-handler-askpassword)
|
||||
#'tramp-gvfs-handler-askpassword)
|
||||
(dbus-register-method
|
||||
:session dbus-service-emacs object-path
|
||||
tramp-gvfs-interface-mountoperation "AskPassword"
|
||||
'tramp-gvfs-handler-askpassword)
|
||||
#'tramp-gvfs-handler-askpassword)
|
||||
|
||||
;; There could be a callback of "askQuestion" when adding
|
||||
;; fingerprints or checking certificates.
|
||||
(dbus-register-method
|
||||
:session dbus-service-emacs object-path
|
||||
tramp-gvfs-interface-mountoperation "askQuestion"
|
||||
'tramp-gvfs-handler-askquestion)
|
||||
#'tramp-gvfs-handler-askquestion)
|
||||
(dbus-register-method
|
||||
:session dbus-service-emacs object-path
|
||||
tramp-gvfs-interface-mountoperation "AskQuestion"
|
||||
'tramp-gvfs-handler-askquestion)
|
||||
#'tramp-gvfs-handler-askquestion)
|
||||
|
||||
;; The call must be asynchronously, because of the "askPassword"
|
||||
;; or "askQuestion" callbacks.
|
||||
|
|
@ -1880,7 +1880,7 @@ is applied, and it returns t if the return code is zero."
|
|||
(with-current-buffer (tramp-get-connection-buffer vec)
|
||||
(tramp-gvfs-maybe-open-connection vec)
|
||||
(erase-buffer)
|
||||
(or (zerop (apply 'tramp-call-process vec command nil t nil args))
|
||||
(or (zerop (apply #'tramp-call-process vec command nil t nil args))
|
||||
;; Remove information about mounted connection.
|
||||
(and (tramp-flush-file-properties vec "/") nil)))))
|
||||
|
||||
|
|
@ -1897,9 +1897,9 @@ VEC is used only for traces."
|
|||
(dolist
|
||||
(object-path
|
||||
(mapcar
|
||||
'car
|
||||
#'car
|
||||
(tramp-dbus-function
|
||||
vec 'dbus-get-all-managed-objects
|
||||
vec #'dbus-get-all-managed-objects
|
||||
`(:session ,tramp-goa-service ,tramp-goa-path))))
|
||||
(let* ((account-properties
|
||||
(with-tramp-dbus-get-all-properties vec
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ special handling of `substitute-in-file-name'."
|
|||
(pop props) (pop props))))))
|
||||
|
||||
(add-hook 'rfn-eshadow-setup-minibuffer-hook
|
||||
'tramp-rfn-eshadow-setup-minibuffer)
|
||||
#'tramp-rfn-eshadow-setup-minibuffer)
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda ()
|
||||
(remove-hook 'rfn-eshadow-setup-minibuffer-hook
|
||||
'tramp-rfn-eshadow-setup-minibuffer)))
|
||||
#'tramp-rfn-eshadow-setup-minibuffer)))
|
||||
|
||||
(defun tramp-rfn-eshadow-update-overlay-regexp ()
|
||||
(format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format))
|
||||
|
|
@ -104,11 +104,11 @@ been set up by `rfn-eshadow-setup-minibuffer'."
|
|||
(rfn-eshadow-update-overlay))))))))
|
||||
|
||||
(add-hook 'rfn-eshadow-update-overlay-hook
|
||||
'tramp-rfn-eshadow-update-overlay)
|
||||
#'tramp-rfn-eshadow-update-overlay)
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda ()
|
||||
(remove-hook 'rfn-eshadow-update-overlay-hook
|
||||
'tramp-rfn-eshadow-update-overlay)))
|
||||
#'tramp-rfn-eshadow-update-overlay)))
|
||||
|
||||
;;; Integration of eshell.el:
|
||||
|
||||
|
|
@ -120,20 +120,20 @@ been set up by `rfn-eshadow-setup-minibuffer'."
|
|||
;; Use `path-separator' as it does eshell.
|
||||
(setq eshell-path-env
|
||||
(mapconcat
|
||||
'identity (butlast (tramp-compat-exec-path)) path-separator)))
|
||||
#'identity (butlast (tramp-compat-exec-path)) path-separator)))
|
||||
|
||||
(eval-after-load "esh-util"
|
||||
'(progn
|
||||
(add-hook 'eshell-mode-hook
|
||||
'tramp-eshell-directory-change)
|
||||
#'tramp-eshell-directory-change)
|
||||
(add-hook 'eshell-directory-change-hook
|
||||
'tramp-eshell-directory-change)
|
||||
#'tramp-eshell-directory-change)
|
||||
(add-hook 'tramp-integration-unload-hook
|
||||
(lambda ()
|
||||
(remove-hook 'eshell-mode-hook
|
||||
'tramp-eshell-directory-change)
|
||||
#'tramp-eshell-directory-change)
|
||||
(remove-hook 'eshell-directory-change-hook
|
||||
'tramp-eshell-directory-change)))))
|
||||
#'tramp-eshell-directory-change)))))
|
||||
|
||||
;;; Integration of recentf.el:
|
||||
|
||||
|
|
@ -160,15 +160,15 @@ NAME must be equal to `tramp-current-connection'."
|
|||
(eval-after-load "recentf"
|
||||
'(progn
|
||||
(add-hook 'tramp-cleanup-connection-hook
|
||||
'tramp-recentf-cleanup)
|
||||
#'tramp-recentf-cleanup)
|
||||
(add-hook 'tramp-cleanup-all-connections-hook
|
||||
'tramp-recentf-cleanup-all)
|
||||
#'tramp-recentf-cleanup-all)
|
||||
(add-hook 'tramp-integration-unload-hook
|
||||
(lambda ()
|
||||
(remove-hook 'tramp-cleanup-connection-hook
|
||||
'tramp-recentf-cleanup)
|
||||
#'tramp-recentf-cleanup)
|
||||
(remove-hook 'tramp-cleanup-all-connections-hook
|
||||
'tramp-recentf-cleanup-all)))))
|
||||
#'tramp-recentf-cleanup-all)))))
|
||||
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda () (unload-feature 'tramp-integration 'force)))
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ file names."
|
|||
'copy filename newname ok-if-already-exists keep-date
|
||||
preserve-uid-gid preserve-extended-attributes)
|
||||
(tramp-run-real-handler
|
||||
'copy-file
|
||||
#'copy-file
|
||||
(list filename newname ok-if-already-exists keep-date
|
||||
preserve-uid-gid preserve-extended-attributes))))
|
||||
|
||||
|
|
@ -314,7 +314,7 @@ file names."
|
|||
(when full
|
||||
(let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v))))
|
||||
(remote (funcall (if (tramp-compat-file-name-quoted-p directory)
|
||||
'tramp-compat-file-name-quote 'identity)
|
||||
#'tramp-compat-file-name-quote #'identity)
|
||||
(file-remote-p directory))))
|
||||
(setq result
|
||||
(mapcar
|
||||
|
|
@ -328,7 +328,7 @@ file names."
|
|||
result)))
|
||||
(setq result (cons item result))))
|
||||
;; Return result.
|
||||
(if nosort result (sort result 'string<))))))
|
||||
(if nosort result (sort result #'string<))))))
|
||||
|
||||
(defun tramp-rclone-handle-file-attributes (filename &optional id-format)
|
||||
"Like `file-attributes' for Tramp files."
|
||||
|
|
@ -436,7 +436,7 @@ file names."
|
|||
'rename filename newname ok-if-already-exists
|
||||
'keep-date 'preserve-uid-gid)
|
||||
(tramp-run-real-handler
|
||||
'rename-file (list filename newname ok-if-already-exists))))
|
||||
#'rename-file (list filename newname ok-if-already-exists))))
|
||||
|
||||
|
||||
;; File name conversions.
|
||||
|
|
@ -500,7 +500,7 @@ file names."
|
|||
(let ((quoted (tramp-compat-file-name-quoted-p localname))
|
||||
(localname (tramp-compat-file-name-unquote localname)))
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(if (file-name-absolute-p localname)
|
||||
(substring localname 1) localname)
|
||||
|
|
@ -560,7 +560,7 @@ connection if a previous connection has died for some reason."
|
|||
;; DESTINATION of `tramp-call-process'.
|
||||
(unless (tramp-rclone-mounted-p vec)
|
||||
(apply
|
||||
'tramp-call-process
|
||||
#'tramp-call-process
|
||||
vec tramp-rclone-program nil 0 nil
|
||||
(delq nil
|
||||
`("mount" ,(concat host ":/")
|
||||
|
|
@ -591,7 +591,7 @@ connection if a previous connection has died for some reason."
|
|||
(erase-buffer)
|
||||
(let ((flags (tramp-get-method-parameter
|
||||
vec (intern (format "tramp-%s-args" (car args))))))
|
||||
(apply 'tramp-call-process
|
||||
(apply #'tramp-call-process
|
||||
vec tramp-rclone-program nil t nil (append args flags)))))
|
||||
|
||||
(add-hook 'tramp-unload-hook
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
|
|||
component is used as the target of the symlink."
|
||||
(if (not (tramp-tramp-file-p (expand-file-name linkname)))
|
||||
(tramp-run-real-handler
|
||||
'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
#'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
|
||||
(with-parsed-tramp-file-name linkname nil
|
||||
;; If TARGET is a Tramp name, use just the localname component.
|
||||
|
|
@ -1044,7 +1044,7 @@ component is used as the target of the symlink."
|
|||
|
||||
(let ((ln (tramp-get-remote-ln v))
|
||||
(cwd (tramp-run-real-handler
|
||||
'file-name-directory (list localname))))
|
||||
#'file-name-directory (list localname))))
|
||||
(unless ln
|
||||
(tramp-error
|
||||
v 'file-error
|
||||
|
|
@ -1088,7 +1088,7 @@ component is used as the target of the symlink."
|
|||
;; 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
|
||||
|
|
@ -1136,7 +1136,7 @@ component is used as the target of the symlink."
|
|||
(setq thisstep (pop steps))
|
||||
(tramp-message
|
||||
v 5 "Check %s"
|
||||
(mapconcat 'identity
|
||||
(mapconcat #'identity
|
||||
(append '("") (reverse result) (list thisstep))
|
||||
"/"))
|
||||
(setq symlink-target
|
||||
|
|
@ -1144,7 +1144,7 @@ component is used as the target of the symlink."
|
|||
(file-attributes
|
||||
(tramp-make-tramp-file-name
|
||||
v
|
||||
(mapconcat 'identity
|
||||
(mapconcat #'identity
|
||||
(append '("")
|
||||
(reverse result)
|
||||
(list thisstep))
|
||||
|
|
@ -1176,7 +1176,7 @@ component is used as the target of the symlink."
|
|||
;; Combine list to form string.
|
||||
(setq result
|
||||
(if result
|
||||
(mapconcat 'identity (cons "" result) "/")
|
||||
(mapconcat #'identity (cons "" result) "/")
|
||||
"/"))
|
||||
(when (string= "" result)
|
||||
(setq result "/")))))
|
||||
|
|
@ -1379,7 +1379,7 @@ component is used as the target of the symlink."
|
|||
(error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
|
||||
(buffer-name)))
|
||||
(if time-list
|
||||
(tramp-run-real-handler 'set-visited-file-modtime (list time-list))
|
||||
(tramp-run-real-handler #'set-visited-file-modtime (list time-list))
|
||||
(let ((f (buffer-file-name))
|
||||
coding-system-used)
|
||||
(with-parsed-tramp-file-name f nil
|
||||
|
|
@ -1389,7 +1389,7 @@ component is used as the target of the symlink."
|
|||
tramp-time-doesnt-exist)))
|
||||
(setq coding-system-used last-coding-system-used)
|
||||
(if (not (tramp-compat-time-equal-p modtime tramp-time-dont-know))
|
||||
(tramp-run-real-handler 'set-visited-file-modtime (list modtime))
|
||||
(tramp-run-real-handler #'set-visited-file-modtime (list modtime))
|
||||
(progn
|
||||
(tramp-send-command
|
||||
v
|
||||
|
|
@ -1961,7 +1961,7 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
|
|||
'rename filename newname ok-if-already-exists
|
||||
'keep-time 'preserve-uid-gid)
|
||||
(tramp-run-real-handler
|
||||
'rename-file (list filename newname ok-if-already-exists))))
|
||||
#'rename-file (list filename newname ok-if-already-exists))))
|
||||
|
||||
(defun tramp-do-copy-or-rename-file
|
||||
(op filename newname &optional ok-if-already-exists keep-date
|
||||
|
|
@ -1996,7 +1996,7 @@ file names."
|
|||
(file-attributes (file-truename filename))))
|
||||
;; `file-extended-attributes' exists since Emacs 24.4.
|
||||
(attributes (and preserve-extended-attributes
|
||||
(apply 'file-extended-attributes (list filename)))))
|
||||
(apply #'file-extended-attributes (list filename)))))
|
||||
|
||||
(with-parsed-tramp-file-name (if t1 filename newname) nil
|
||||
(when (and (not ok-if-already-exists) (file-exists-p newname))
|
||||
|
|
@ -2069,7 +2069,7 @@ file names."
|
|||
;; `set-file-extended-attributes' exists since Emacs 24.4.
|
||||
(when attributes
|
||||
(ignore-errors
|
||||
(apply 'set-file-extended-attributes (list newname attributes))))
|
||||
(apply #'set-file-extended-attributes (list newname attributes))))
|
||||
|
||||
;; In case of `rename', we must flush the cache of the source file.
|
||||
(when (and t1 (eq op 'rename))
|
||||
|
|
@ -2193,7 +2193,8 @@ the uid and gid from FILENAME."
|
|||
localname1 localname2 ok-if-already-exists
|
||||
keep-date preserve-uid-gid)
|
||||
(tramp-run-real-handler
|
||||
'rename-file (list localname1 localname2 ok-if-already-exists))))
|
||||
#'rename-file
|
||||
(list localname1 localname2 ok-if-already-exists))))
|
||||
|
||||
;; We can do it directly with `tramp-send-command'
|
||||
((and (file-readable-p (concat prefix localname1))
|
||||
|
|
@ -2238,7 +2239,7 @@ the uid and gid from FILENAME."
|
|||
(copy-file
|
||||
localname1 tmpfile t keep-date preserve-uid-gid)
|
||||
(tramp-run-real-handler
|
||||
'rename-file (list localname1 tmpfile t)))
|
||||
#'rename-file (list localname1 tmpfile t)))
|
||||
;; We must change the ownership as local user.
|
||||
;; Since this does not work reliable, we also
|
||||
;; give read permissions.
|
||||
|
|
@ -2260,7 +2261,7 @@ the uid and gid from FILENAME."
|
|||
(tramp-get-buffer v)))
|
||||
(t1
|
||||
(tramp-run-real-handler
|
||||
'rename-file
|
||||
#'rename-file
|
||||
(list tmpfile localname2 ok-if-already-exists)))))
|
||||
|
||||
;; Save exit.
|
||||
|
|
@ -2309,8 +2310,8 @@ The method used must be an out-of-band method."
|
|||
(setq source (funcall
|
||||
(if (and (file-directory-p filename)
|
||||
(not (file-exists-p newname)))
|
||||
'file-name-as-directory
|
||||
'identity)
|
||||
#'file-name-as-directory
|
||||
#'identity)
|
||||
(if t1
|
||||
(tramp-make-copy-program-file-name v)
|
||||
(tramp-unquote-shell-quote-argument filename)))
|
||||
|
|
@ -2364,7 +2365,7 @@ The method used must be an out-of-band method."
|
|||
(mapcar
|
||||
(lambda (x)
|
||||
(setq x (mapcar (lambda (y) (format-spec y spec)) x))
|
||||
(unless (member "" x) (mapconcat 'identity x " ")))
|
||||
(unless (member "" x) (mapconcat #'identity x " ")))
|
||||
(tramp-get-method-parameter v 'tramp-copy-env)))
|
||||
|
||||
remote-copy-program
|
||||
|
|
@ -2394,7 +2395,7 @@ The method used must be an out-of-band method."
|
|||
"Cannot find remote listener: %s" remote-copy-program))
|
||||
(setq remote-copy-program
|
||||
(mapconcat
|
||||
'identity
|
||||
#'identity
|
||||
(append
|
||||
(list remote-copy-program) remote-copy-args
|
||||
(list (if t1 (concat "<" source) (concat ">" target)) "&"))
|
||||
|
|
@ -2440,7 +2441,7 @@ The method used must be an out-of-band method."
|
|||
;; copying of large files can last longer than 60 secs.
|
||||
(let* ((command
|
||||
(mapconcat
|
||||
'identity (append (list copy-program) copy-args)
|
||||
#'identity (append (list copy-program) copy-args)
|
||||
" "))
|
||||
(p (let ((default-directory
|
||||
(tramp-compat-temporary-file-directory)))
|
||||
|
|
@ -2450,7 +2451,7 @@ The method used must be an out-of-band method."
|
|||
command))))
|
||||
(tramp-message orig-vec 6 "%s" command)
|
||||
(process-put p 'vector orig-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)
|
||||
|
||||
;; We must adapt `tramp-local-end-of-line' for
|
||||
|
|
@ -2593,12 +2594,12 @@ The method used must be an out-of-band method."
|
|||
(setq switches (delete "--dired" switches)))
|
||||
(when wildcard
|
||||
(setq wildcard (tramp-run-real-handler
|
||||
'file-name-nondirectory (list localname)))
|
||||
#'file-name-nondirectory (list localname)))
|
||||
(setq localname (tramp-run-real-handler
|
||||
'file-name-directory (list localname))))
|
||||
#'file-name-directory (list localname))))
|
||||
(unless (or full-directory-p (member "-d" switches))
|
||||
(setq switches (append switches '("-d"))))
|
||||
(setq switches (mapconcat 'tramp-shell-quote-argument switches " "))
|
||||
(setq switches (mapconcat #'tramp-shell-quote-argument switches " "))
|
||||
(when wildcard
|
||||
(setq switches (concat switches " " wildcard)))
|
||||
(tramp-message
|
||||
|
|
@ -2620,10 +2621,10 @@ The method used must be an out-of-band method."
|
|||
v
|
||||
(format "cd %s" (tramp-shell-quote-argument
|
||||
(tramp-run-real-handler
|
||||
'file-name-directory (list localname))))
|
||||
#'file-name-directory (list localname))))
|
||||
"Couldn't `cd %s'"
|
||||
(tramp-shell-quote-argument
|
||||
(tramp-run-real-handler 'file-name-directory (list localname))))
|
||||
(tramp-run-real-handler #'file-name-directory (list localname))))
|
||||
(tramp-send-command
|
||||
v
|
||||
(format "%s %s %s 2>/dev/null"
|
||||
|
|
@ -2632,11 +2633,11 @@ The method used must be an out-of-band method."
|
|||
(if (or wildcard
|
||||
(zerop (length
|
||||
(tramp-run-real-handler
|
||||
'file-name-nondirectory (list localname)))))
|
||||
#'file-name-nondirectory (list localname)))))
|
||||
""
|
||||
(tramp-shell-quote-argument
|
||||
(tramp-run-real-handler
|
||||
'file-name-nondirectory (list localname)))))))
|
||||
#'file-name-nondirectory (list localname)))))))
|
||||
|
||||
(save-restriction
|
||||
(let ((beg (point)))
|
||||
|
|
@ -2720,10 +2721,10 @@ the result will be a local, non-Tramp, file name."
|
|||
(setq name (concat (file-name-as-directory dir) name)))
|
||||
;; If connection is not established yet, run the real handler.
|
||||
(if (not (tramp-connectable-p name))
|
||||
(tramp-run-real-handler 'expand-file-name (list name nil))
|
||||
(tramp-run-real-handler #'expand-file-name (list name nil))
|
||||
;; Dissect NAME.
|
||||
(with-parsed-tramp-file-name name nil
|
||||
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
|
||||
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
|
||||
(setq localname (concat "~/" localname)))
|
||||
;; Tilde expansion if necessary. This needs a shell which
|
||||
;; groks tilde expansion! The function `tramp-find-shell' is
|
||||
|
|
@ -2761,7 +2762,7 @@ the result will be a local, non-Tramp, file name."
|
|||
(tramp-make-tramp-file-name
|
||||
v (tramp-drop-volume-letter
|
||||
(tramp-run-real-handler
|
||||
'expand-file-name (list localname))))))))
|
||||
#'expand-file-name (list localname))))))))
|
||||
|
||||
;;; Remote commands:
|
||||
|
||||
|
|
@ -2792,25 +2793,25 @@ the result will be a local, non-Tramp, file name."
|
|||
(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
|
||||
|
|
@ -2864,15 +2865,16 @@ the result will be a local, non-Tramp, file name."
|
|||
(if uenv
|
||||
(format
|
||||
"unset %s &&"
|
||||
(mapconcat 'tramp-shell-quote-argument uenv " "))
|
||||
(mapconcat
|
||||
#'tramp-shell-quote-argument uenv " "))
|
||||
"")
|
||||
(if heredoc (format "<<'%s'" tramp-end-of-heredoc) "")
|
||||
(if tmpstderr (format "2>'%s'" tmpstderr) "")
|
||||
(mapconcat 'tramp-shell-quote-argument env " ")
|
||||
(mapconcat #'tramp-shell-quote-argument env " ")
|
||||
(if heredoc
|
||||
(format "%s\n(\n%s\n) </dev/tty\n%s"
|
||||
program (car args) tramp-end-of-heredoc)
|
||||
(mapconcat 'tramp-shell-quote-argument
|
||||
(mapconcat #'tramp-shell-quote-argument
|
||||
(cons program args) " ")))))
|
||||
(tramp-process-connection-type
|
||||
(or (null program) tramp-process-connection-type))
|
||||
|
|
@ -2985,7 +2987,7 @@ the result will be a local, non-Tramp, file name."
|
|||
(with-parsed-tramp-file-name default-directory nil
|
||||
(let (command env uenv 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) " "))
|
||||
;; We use as environment the difference to toplevel `process-environment'.
|
||||
(dolist (elt process-environment)
|
||||
|
|
@ -2999,12 +3001,12 @@ the result will be a local, non-Tramp, file name."
|
|||
(setq command
|
||||
(format
|
||||
"env %s %s"
|
||||
(mapconcat 'tramp-shell-quote-argument env " ") command)))
|
||||
(mapconcat #'tramp-shell-quote-argument env " ") command)))
|
||||
(when uenv
|
||||
(setq command
|
||||
(format
|
||||
"unset %s && %s"
|
||||
(mapconcat 'tramp-shell-quote-argument uenv " ") command)))
|
||||
(mapconcat #'tramp-shell-quote-argument uenv " ") command)))
|
||||
;; Determine input.
|
||||
(if (null infile)
|
||||
(setq input "/dev/null")
|
||||
|
|
@ -3216,7 +3218,8 @@ the result will be a local, non-Tramp, file name."
|
|||
(file-writable-p localname)))))
|
||||
;; Short track: if we are on the local host, we can run directly.
|
||||
(tramp-run-real-handler
|
||||
'write-region (list start end localname append 'no-message lockname))
|
||||
#'write-region
|
||||
(list start end localname append 'no-message lockname))
|
||||
|
||||
(let* ((modes (save-excursion (tramp-default-file-modes filename)))
|
||||
;; We use this to save the value of
|
||||
|
|
@ -3252,7 +3255,7 @@ the result will be a local, non-Tramp, file name."
|
|||
(tramp-find-file-name-coding-system-alist filename tmpfile)))
|
||||
(condition-case err
|
||||
(tramp-run-real-handler
|
||||
'write-region
|
||||
#'write-region
|
||||
(list start end tmpfile append 'no-message lockname))
|
||||
((error quit)
|
||||
(setq tramp-temp-buffer-file-name nil)
|
||||
|
|
@ -3466,7 +3469,7 @@ the result will be a local, non-Tramp, file name."
|
|||
;; Here we collect only file names, which need an operation.
|
||||
(tramp-with-demoted-errors
|
||||
v "Error in 1st pass of `vc-registered': %s"
|
||||
(tramp-run-real-handler 'vc-registered (list file)))
|
||||
(tramp-run-real-handler #'vc-registered (list file)))
|
||||
(tramp-message v 10 "\n%s" tramp-vc-registered-file-names)
|
||||
|
||||
;; Send just one command, in order to fill the cache.
|
||||
|
|
@ -3489,7 +3492,7 @@ the result will be a local, non-Tramp, file name."
|
|||
(format
|
||||
"tramp_vc_registered_read_file_names <<'%s'\n%s\n%s\n"
|
||||
tramp-end-of-heredoc
|
||||
(mapconcat 'tramp-shell-quote-argument
|
||||
(mapconcat #'tramp-shell-quote-argument
|
||||
tramp-vc-registered-file-names
|
||||
"\n")
|
||||
tramp-end-of-heredoc))
|
||||
|
|
@ -3529,7 +3532,7 @@ the result will be a local, non-Tramp, file name."
|
|||
;; Run.
|
||||
(tramp-with-demoted-errors
|
||||
v "Error in 2nd pass of `vc-registered': %s"
|
||||
(tramp-run-real-handler 'vc-registered (list file))))))))
|
||||
(tramp-run-real-handler #'vc-registered (list file))))))))
|
||||
|
||||
;;;###tramp-autoload
|
||||
(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."
|
|||
(save-match-data
|
||||
(let ((filename
|
||||
(tramp-replace-environment-variables
|
||||
(apply 'tramp-file-name-for-operation operation args)))
|
||||
(apply #'tramp-file-name-for-operation operation args)))
|
||||
(fn (assoc operation tramp-sh-file-name-handler-alist)))
|
||||
(with-parsed-tramp-file-name filename nil
|
||||
(cond
|
||||
|
|
@ -3581,7 +3584,7 @@ Fall back to normal file name handler if no Tramp handler exists."
|
|||
(cond
|
||||
;; "inotifywait".
|
||||
((setq command (tramp-get-remote-inotifywait v))
|
||||
(setq filter 'tramp-sh-inotifywait-process-filter
|
||||
(setq filter #'tramp-sh-inotifywait-process-filter
|
||||
events
|
||||
(cond
|
||||
((and (memq 'change flags) (memq 'attribute-change flags))
|
||||
|
|
@ -3601,7 +3604,7 @@ Fall back to normal file name handler if no Tramp handler exists."
|
|||
(split-string events "," 'omit))))
|
||||
;; "gio monitor".
|
||||
((setq command (tramp-get-remote-gio-monitor v))
|
||||
(setq filter 'tramp-sh-gio-monitor-process-filter
|
||||
(setq filter #'tramp-sh-gio-monitor-process-filter
|
||||
events
|
||||
(cond
|
||||
((and (memq 'change flags) (memq 'attribute-change flags))
|
||||
|
|
@ -3630,7 +3633,7 @@ Fall back to normal file name handler if no Tramp handler exists."
|
|||
(file-remote-p file-name))))
|
||||
;; Start process.
|
||||
(setq p (apply
|
||||
'start-file-process
|
||||
#'start-file-process
|
||||
(file-name-nondirectory command)
|
||||
(generate-new-buffer
|
||||
(format " *%s*" (file-name-nondirectory command)))
|
||||
|
|
@ -3640,8 +3643,8 @@ Fall back to normal file name handler if no Tramp handler exists."
|
|||
(tramp-error
|
||||
v 'file-notify-error
|
||||
"`%s' failed to start on remote host"
|
||||
(mapconcat 'identity sequence " "))
|
||||
(tramp-message v 6 "Run `%s', %S" (mapconcat 'identity sequence " ") p)
|
||||
(mapconcat #'identity sequence " "))
|
||||
(tramp-message v 6 "Run `%s', %S" (mapconcat #'identity sequence " ") p)
|
||||
(process-put p 'vector v)
|
||||
;; Needed for process filter.
|
||||
(process-put p 'events events)
|
||||
|
|
@ -3942,7 +3945,7 @@ This function expects to be in the right *tramp* buffer."
|
|||
"%s\n%s"))
|
||||
progname progname progname
|
||||
tramp-end-of-heredoc
|
||||
(mapconcat 'identity dirlist "\n")
|
||||
(mapconcat #'identity dirlist "\n")
|
||||
tramp-end-of-heredoc))
|
||||
(goto-char (point-max))
|
||||
(when (search-backward "tramp_executable " nil t)
|
||||
|
|
@ -3961,7 +3964,7 @@ whether it exists and if so, it is added to the environment
|
|||
variable PATH."
|
||||
(let ((command
|
||||
(format "PATH=%s; export PATH"
|
||||
(mapconcat 'identity (tramp-get-remote-path vec) ":")))
|
||||
(mapconcat #'identity (tramp-get-remote-path vec) ":")))
|
||||
(pipe-buf
|
||||
(or (with-tramp-connection-property vec "pipe-buf"
|
||||
(tramp-send-command-and-read
|
||||
|
|
@ -4154,7 +4157,7 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
|
|||
"\\(%s\\|%s\\)\\'" shell-prompt-pattern tramp-shell-prompt-pattern))
|
||||
(error
|
||||
(delete-process proc)
|
||||
(apply 'tramp-error-with-buffer
|
||||
(apply #'tramp-error-with-buffer
|
||||
(tramp-get-connection-buffer vec) vec 'file-error error-args)))))
|
||||
|
||||
(defun tramp-open-connection-setup-interactive-shell (proc vec)
|
||||
|
|
@ -4304,7 +4307,7 @@ process to set up. VEC specifies the connection."
|
|||
(append `(,(tramp-get-remote-locale vec))
|
||||
(copy-sequence tramp-remote-process-environment))))
|
||||
(setq item (split-string item "=" 'omit))
|
||||
(setcdr item (mapconcat 'identity (cdr item) "="))
|
||||
(setcdr item (mapconcat #'identity (cdr item) "="))
|
||||
(if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
|
||||
(push (format "%s %s" (car item) (cdr item)) vars)
|
||||
(push (car item) unset)))
|
||||
|
|
@ -4314,12 +4317,12 @@ process to set up. VEC specifies the connection."
|
|||
(format
|
||||
"while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s"
|
||||
tramp-end-of-heredoc
|
||||
(mapconcat 'identity vars "\n")
|
||||
(mapconcat #'identity vars "\n")
|
||||
tramp-end-of-heredoc)
|
||||
t))
|
||||
(when unset
|
||||
(tramp-send-command
|
||||
vec (format "unset %s" (mapconcat 'identity unset " ")) t)))))
|
||||
vec (format "unset %s" (mapconcat #'identity unset " ")) t)))))
|
||||
|
||||
;; Old text from documentation of tramp-methods:
|
||||
;; Using a uuencode/uudecode inline method is discouraged, please use one
|
||||
|
|
@ -4581,9 +4584,9 @@ Goes through the list `tramp-inline-compress-commands'."
|
|||
;; the pipe symbol be quoted if they use forward
|
||||
;; slashes as directory separators.
|
||||
(mapconcat
|
||||
'shell-quote-argument (split-string compress) " ")
|
||||
#'shell-quote-argument (split-string compress) " ")
|
||||
(mapconcat
|
||||
'shell-quote-argument (split-string decompress) " "))
|
||||
#'shell-quote-argument (split-string decompress) " "))
|
||||
nil nil))
|
||||
(throw 'next nil))
|
||||
(tramp-message
|
||||
|
|
@ -4871,7 +4874,7 @@ connection if a previous connection has died for some reason."
|
|||
(p (let ((default-directory
|
||||
(tramp-compat-temporary-file-directory)))
|
||||
(apply
|
||||
'start-process
|
||||
#'start-process
|
||||
(tramp-get-connection-name vec)
|
||||
(tramp-get-connection-buffer vec)
|
||||
(if tramp-encoding-command-interactive
|
||||
|
|
@ -4882,12 +4885,12 @@ connection if a previous connection has died for some reason."
|
|||
;; Set sentinel and query flag. Initialize variables.
|
||||
(set-process-sentinel p 'tramp-process-sentinel)
|
||||
(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)
|
||||
(setq tramp-current-connection (cons vec (current-time)))
|
||||
|
||||
(tramp-message
|
||||
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
|
||||
vec 6 "%s" (mapconcat #'identity (process-command p) " "))
|
||||
|
||||
;; Check whether process is alive.
|
||||
(tramp-barf-if-no-shell-prompt
|
||||
|
|
@ -4964,7 +4967,7 @@ connection if a previous connection has died for some reason."
|
|||
(mapcar
|
||||
(lambda (x)
|
||||
(setq x (mapcar (lambda (y) (format-spec y spec)) x))
|
||||
(unless (member "" x) (mapconcat 'identity x " ")))
|
||||
(unless (member "" x) (mapconcat #'identity x " ")))
|
||||
login-env))
|
||||
(while login-env
|
||||
(setq command
|
||||
|
|
@ -4993,7 +4996,7 @@ connection if a previous connection has died for some reason."
|
|||
(mapconcat
|
||||
(lambda (x)
|
||||
(setq x (mapcar (lambda (y) (format-spec y spec)) x))
|
||||
(unless (member "" x) (mapconcat 'identity x " ")))
|
||||
(unless (member "" x) (mapconcat #'identity x " ")))
|
||||
login-args " ")
|
||||
;; Local shell could be a Windows COMSPEC. It
|
||||
;; 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."
|
|||
Similar to `tramp-send-command-and-check' but accepts two more arguments
|
||||
FMT and ARGS which are passed to `error'."
|
||||
(or (tramp-send-command-and-check vec command)
|
||||
(apply 'tramp-error vec 'file-error fmt args)))
|
||||
(apply #'tramp-error vec 'file-error fmt args)))
|
||||
|
||||
(defun tramp-send-command-and-read (vec command &optional noerror marker)
|
||||
"Run COMMAND and return the output, which must be a Lisp expression.
|
||||
|
|
@ -5342,11 +5345,11 @@ Nonexistent directories are removed from spec."
|
|||
"%s %s %s 'echo %s \\\"$PATH\\\"'"
|
||||
(tramp-get-method-parameter vec 'tramp-remote-shell)
|
||||
(mapconcat
|
||||
'identity
|
||||
#'identity
|
||||
(tramp-get-method-parameter vec 'tramp-remote-shell-login)
|
||||
" ")
|
||||
(mapconcat
|
||||
'identity
|
||||
#'identity
|
||||
(tramp-get-method-parameter vec 'tramp-remote-shell-args)
|
||||
" ")
|
||||
(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."
|
|||
(tramp-get-remote-python vec)
|
||||
(if (equal id-format 'integer)
|
||||
"import os; print (os.getuid())"
|
||||
"import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')"))))
|
||||
"import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')"))))
|
||||
|
||||
(defun tramp-get-remote-uid (vec id-format)
|
||||
"The uid of the remote connection VEC, in ID-FORMAT.
|
||||
|
|
@ -5730,7 +5733,7 @@ ID-FORMAT valid values are `string' and `integer'."
|
|||
(tramp-get-remote-python vec)
|
||||
(if (equal id-format 'integer)
|
||||
"import os; print (os.getgid())"
|
||||
"import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')"))))
|
||||
"import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')"))))
|
||||
|
||||
(defun tramp-get-remote-gid (vec id-format)
|
||||
"The gid of the remote connection VEC, in ID-FORMAT.
|
||||
|
|
@ -5819,14 +5822,14 @@ function cell is returned to be applied on a buffer."
|
|||
(let ((coding-system-for-write 'binary)
|
||||
(coding-system-for-read 'binary))
|
||||
(apply
|
||||
'tramp-call-process-region ',vec (point-min) (point-max)
|
||||
#'tramp-call-process-region ',vec (point-min) (point-max)
|
||||
(car (split-string ,compress)) t t nil
|
||||
(cdr (split-string ,compress)))))
|
||||
`(lambda (beg end)
|
||||
(let ((coding-system-for-write 'binary)
|
||||
(coding-system-for-read 'binary))
|
||||
(apply
|
||||
'tramp-call-process-region ',vec beg end
|
||||
#'tramp-call-process-region ',vec beg end
|
||||
(car (split-string ,compress)) t t nil
|
||||
(cdr (split-string ,compress))))
|
||||
(,coding (point-min) (point-max)))))
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ call, letting the SMB client use the default one."
|
|||
|
||||
(defconst tramp-smb-errors
|
||||
(mapconcat
|
||||
'identity
|
||||
#'identity
|
||||
`(;; Connection error / timeout / unknown command.
|
||||
"Connection\\( to \\S-+\\)? failed"
|
||||
"Read from server failed, maybe it closed the connection"
|
||||
|
|
@ -405,7 +405,7 @@ pass to the OPERATION."
|
|||
(if copy-contents
|
||||
;; We must do it file-wise.
|
||||
(tramp-run-real-handler
|
||||
'copy-directory (list dirname newname keep-date parents copy-contents))
|
||||
#'copy-directory (list dirname newname keep-date parents copy-contents))
|
||||
|
||||
(setq dirname (expand-file-name dirname)
|
||||
newname (expand-file-name newname))
|
||||
|
|
@ -511,15 +511,15 @@ pass to the OPERATION."
|
|||
;; password can be handled.
|
||||
(let* ((default-directory tmpdir)
|
||||
(p (apply
|
||||
'start-process
|
||||
#'start-process
|
||||
(tramp-get-connection-name v)
|
||||
(tramp-get-connection-buffer v)
|
||||
tramp-smb-program args)))
|
||||
|
||||
(tramp-message
|
||||
v 6 "%s" (mapconcat 'identity (process-command p) " "))
|
||||
v 6 "%s" (mapconcat #'identity (process-command p) " "))
|
||||
(process-put p 'vector v)
|
||||
(process-put p 'adjust-window-size-function 'ignore)
|
||||
(process-put p 'adjust-window-size-function #'ignore)
|
||||
(set-process-query-on-exit-flag p nil)
|
||||
(tramp-process-actions p v nil tramp-smb-actions-with-tar)
|
||||
|
||||
|
|
@ -552,7 +552,7 @@ pass to the OPERATION."
|
|||
;; We must do it file-wise.
|
||||
(t
|
||||
(tramp-run-real-handler
|
||||
'copy-directory (list dirname newname keep-date parents)))))))))
|
||||
#'copy-directory (list dirname newname keep-date parents)))))))))
|
||||
|
||||
(defun tramp-smb-handle-copy-file
|
||||
(filename newname &optional ok-if-already-exists keep-date
|
||||
|
|
@ -670,7 +670,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
(defun tramp-smb-handle-directory-files
|
||||
(directory &optional full match nosort)
|
||||
"Like `directory-files' for Tramp files."
|
||||
(let ((result (mapcar 'directory-file-name
|
||||
(let ((result (mapcar #'directory-file-name
|
||||
(file-name-all-completions "" directory))))
|
||||
;; Discriminate with regexp.
|
||||
(when match
|
||||
|
|
@ -685,7 +685,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
(lambda (x) (format "%s/%s" directory x))
|
||||
result)))
|
||||
;; Sort them if necessary.
|
||||
(unless nosort (setq result (sort result 'string-lessp)))
|
||||
(unless nosort (setq result (sort result #'string-lessp)))
|
||||
result))
|
||||
|
||||
(defun tramp-smb-handle-expand-file-name (name &optional dir)
|
||||
|
|
@ -697,7 +697,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
(setq name (concat (file-name-as-directory dir) name)))
|
||||
;; If NAME is not a Tramp file, run the real handler.
|
||||
(if (not (tramp-tramp-file-p name))
|
||||
(tramp-run-real-handler 'expand-file-name (list name nil))
|
||||
(tramp-run-real-handler #'expand-file-name (list name nil))
|
||||
;; Dissect NAME.
|
||||
(with-parsed-tramp-file-name name nil
|
||||
;; 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."
|
|||
(match-string 1 localname))
|
||||
nil nil localname)))
|
||||
;; Make the file name absolute.
|
||||
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
|
||||
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
|
||||
(setq localname (concat "/" localname)))
|
||||
;; No tilde characters in file name, do normal
|
||||
;; `expand-file-name' (this does "/./" and "/../").
|
||||
(tramp-make-tramp-file-name
|
||||
v (tramp-run-real-handler 'expand-file-name (list localname))))))
|
||||
v (tramp-run-real-handler #'expand-file-name (list localname))))))
|
||||
|
||||
(defun tramp-smb-action-get-acl (proc vec)
|
||||
"Read ACL data from connection buffer."
|
||||
|
|
@ -772,15 +772,15 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
;; Use an asynchronous process. By this, password can
|
||||
;; be handled.
|
||||
(let ((p (apply
|
||||
'start-process
|
||||
#'start-process
|
||||
(tramp-get-connection-name v)
|
||||
(tramp-get-connection-buffer v)
|
||||
tramp-smb-acl-program args)))
|
||||
|
||||
(tramp-message
|
||||
v 6 "%s" (mapconcat 'identity (process-command p) " "))
|
||||
v 6 "%s" (mapconcat #'identity (process-command p) " "))
|
||||
(process-put p 'vector v)
|
||||
(process-put p 'adjust-window-size-function 'ignore)
|
||||
(process-put p 'adjust-window-size-function #'ignore)
|
||||
(set-process-query-on-exit-flag p nil)
|
||||
(tramp-process-actions p v nil tramp-smb-actions-get-acl)
|
||||
(when (> (point-max) (point-min))
|
||||
|
|
@ -1163,7 +1163,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
|
|||
component is used as the target of the symlink."
|
||||
(if (not (tramp-tramp-file-p (expand-file-name linkname)))
|
||||
(tramp-run-real-handler
|
||||
'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
#'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
|
||||
(with-parsed-tramp-file-name linkname nil
|
||||
;; If TARGET is a Tramp name, use just the localname component.
|
||||
|
|
@ -1262,7 +1262,7 @@ component is used as the target of the symlink."
|
|||
(setq outbuf (current-buffer))))
|
||||
|
||||
;; Construct command.
|
||||
(setq command (mapconcat 'identity (cons program args) " ")
|
||||
(setq command (mapconcat #'identity (cons program args) " ")
|
||||
command (if input
|
||||
(format
|
||||
"get-content %s | & %s"
|
||||
|
|
@ -1426,15 +1426,15 @@ component is used as the target of the symlink."
|
|||
;; Use an asynchronous process. By this, password can
|
||||
;; be handled.
|
||||
(let ((p (apply
|
||||
'start-process
|
||||
#'start-process
|
||||
(tramp-get-connection-name v)
|
||||
(tramp-get-connection-buffer v)
|
||||
tramp-smb-acl-program args)))
|
||||
|
||||
(tramp-message
|
||||
v 6 "%s" (mapconcat 'identity (process-command p) " "))
|
||||
v 6 "%s" (mapconcat #'identity (process-command p) " "))
|
||||
(process-put p 'vector v)
|
||||
(process-put p 'adjust-window-size-function 'ignore)
|
||||
(process-put p 'adjust-window-size-function #'ignore)
|
||||
(set-process-query-on-exit-flag p nil)
|
||||
(tramp-process-actions p v nil tramp-smb-actions-set-acl)
|
||||
(goto-char (point-max))
|
||||
|
|
@ -1476,7 +1476,7 @@ component is used as the target of the symlink."
|
|||
(get-buffer-create buffer)
|
||||
;; BUFFER can be nil. We use a temporary buffer.
|
||||
(generate-new-buffer tramp-temp-buffer-name)))
|
||||
(command (mapconcat 'identity (cons program args) " "))
|
||||
(command (mapconcat #'identity (cons program args) " "))
|
||||
(bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
|
||||
(name1 name)
|
||||
(i 0)
|
||||
|
|
@ -1531,7 +1531,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
|
|||
(concat (file-remote-p filename)
|
||||
(replace-match "\\1" nil nil localname)))))
|
||||
(condition-case nil
|
||||
(tramp-run-real-handler 'substitute-in-file-name (list filename))
|
||||
(tramp-run-real-handler #'substitute-in-file-name (list filename))
|
||||
(error filename))))
|
||||
|
||||
(defun tramp-smb-handle-write-region
|
||||
|
|
@ -1558,7 +1558,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
|
|||
;; modtime data to be clobbered from the temp file. We call
|
||||
;; `set-visited-file-modtime' ourselves later on.
|
||||
(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 "Moving tmp file %s to %s" tmpfile filename)
|
||||
|
|
@ -1974,9 +1974,9 @@ If ARGUMENT is non-nil, use it as argument for
|
|||
args))))
|
||||
|
||||
(tramp-message
|
||||
vec 6 "%s" (mapconcat 'identity (process-command p) " "))
|
||||
vec 6 "%s" (mapconcat #'identity (process-command p) " "))
|
||||
(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)
|
||||
|
||||
(condition-case err
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ absolute file names."
|
|||
'copy filename newname ok-if-already-exists keep-date
|
||||
preserve-uid-gid preserve-extended-attributes)
|
||||
(tramp-run-real-handler
|
||||
'copy-file
|
||||
#'copy-file
|
||||
(list filename newname ok-if-already-exists keep-date
|
||||
preserve-uid-gid preserve-extended-attributes))))
|
||||
|
||||
|
|
@ -542,7 +542,7 @@ the result will be a local, non-Tramp, file name."
|
|||
;; 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
|
||||
|
|
@ -601,7 +601,7 @@ of the symlink. If TARGET is a Tramp file, only the localname
|
|||
component is used as the target of the symlink."
|
||||
(if (not (tramp-tramp-file-p (expand-file-name linkname)))
|
||||
(tramp-run-real-handler
|
||||
'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
#'make-symbolic-link (list target linkname ok-if-already-exists))
|
||||
|
||||
(with-parsed-tramp-file-name linkname nil
|
||||
;; If TARGET is a Tramp name, use just the localname component.
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ the form (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP)."
|
|||
;; Unless `tramp-syntax' is `simplified', we need a method.
|
||||
(when (and (not (zerop (length tramp-postfix-method-format)))
|
||||
(zerop (length method)))
|
||||
(signal 'wrong-type-argument (list 'stringp method)))
|
||||
(signal 'wrong-type-argument (list #'stringp method)))
|
||||
(concat tramp-prefix-format hop
|
||||
(unless (zerop (length tramp-postfix-method-format))
|
||||
(concat method tramp-postfix-method-format))
|
||||
|
|
@ -1746,7 +1746,7 @@ applicable)."
|
|||
(when (<= level tramp-verbose)
|
||||
;; Display only when there is a minimum level.
|
||||
(when (and tramp-message-show-message (<= level 3))
|
||||
(apply 'message
|
||||
(apply #'message
|
||||
(concat
|
||||
(cond
|
||||
((= level 0) "")
|
||||
|
|
@ -1771,7 +1771,7 @@ applicable)."
|
|||
(setq vec-or-proc (process-get vec-or-proc 'vector))))
|
||||
;; Do it.
|
||||
(when (tramp-file-name-p vec-or-proc)
|
||||
(apply 'tramp-debug-message
|
||||
(apply #'tramp-debug-message
|
||||
vec-or-proc
|
||||
(concat (format "(%d) # " level) fmt-string)
|
||||
arguments))))))
|
||||
|
|
@ -1822,7 +1822,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
|
|||
(and buf (with-current-buffer buf
|
||||
(tramp-dissect-file-name default-directory))))))
|
||||
(unwind-protect
|
||||
(apply 'tramp-error vec-or-proc signal fmt-string arguments)
|
||||
(apply #'tramp-error vec-or-proc signal fmt-string arguments)
|
||||
;; Save exit.
|
||||
(when (and buf
|
||||
tramp-message-show-message
|
||||
|
|
@ -1834,7 +1834,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
|
|||
(let ((enable-recursive-minibuffers t))
|
||||
;; `tramp-error' does not show messages. So we must do it
|
||||
;; ourselves.
|
||||
(apply 'message fmt-string arguments)
|
||||
(apply #'message fmt-string arguments)
|
||||
;; Show buffer.
|
||||
(pop-to-buffer buf)
|
||||
(discard-input)
|
||||
|
|
@ -1848,7 +1848,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
|
|||
"Signal a pilot error."
|
||||
(unwind-protect
|
||||
(apply
|
||||
'tramp-error vec-or-proc
|
||||
#'tramp-error vec-or-proc
|
||||
;; `user-error' has appeared in Emacs 24.3.
|
||||
(if (fboundp 'user-error) 'user-error 'error) fmt-string arguments)
|
||||
;; Save exit.
|
||||
|
|
@ -1860,7 +1860,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
|
|||
(current-message))
|
||||
(let ((enable-recursive-minibuffers t))
|
||||
;; `tramp-error' does not show messages. So we must do it ourselves.
|
||||
(apply 'message fmt-string arguments)
|
||||
(apply #'message fmt-string arguments)
|
||||
(discard-input)
|
||||
(sit-for 30)
|
||||
;; Reset timestamp. It would be wrong after waiting for a while.
|
||||
|
|
@ -1991,7 +1991,7 @@ letter into the file name. This function removes it."
|
|||
(save-match-data
|
||||
(funcall
|
||||
(if (tramp-compat-file-name-quoted-p name)
|
||||
'tramp-compat-file-name-quote 'identity)
|
||||
#'tramp-compat-file-name-quote #'identity)
|
||||
(let ((name (tramp-compat-file-name-unquote name)))
|
||||
(if (string-match "\\`[a-zA-Z]:/" name)
|
||||
(replace-match "/" nil t name)
|
||||
|
|
@ -2274,7 +2274,7 @@ preventing reentrant calls of Tramp.")
|
|||
(defun tramp-file-name-handler (operation &rest args)
|
||||
"Invoke Tramp file name handler.
|
||||
Falls back to normal file name handler if no Tramp file name handler exists."
|
||||
(let ((filename (apply 'tramp-file-name-for-operation operation args)))
|
||||
(let ((filename (apply #'tramp-file-name-for-operation operation args)))
|
||||
(if (tramp-tramp-file-p filename)
|
||||
(save-match-data
|
||||
(setq filename (tramp-replace-environment-variables filename))
|
||||
|
|
@ -2419,7 +2419,7 @@ remote file names."
|
|||
"^%s$"
|
||||
(regexp-opt
|
||||
(mapcar
|
||||
'file-name-sans-extension
|
||||
#'file-name-sans-extension
|
||||
(directory-files dir nil "^tramp.+\\.elc?$"))
|
||||
'paren))))
|
||||
(mapatoms
|
||||
|
|
@ -2453,7 +2453,7 @@ remote file names."
|
|||
(put 'tramp-completion-file-name-handler 'safe-magic t)
|
||||
;; Mark `operations' the handler is responsible for.
|
||||
(put 'tramp-completion-file-name-handler 'operations
|
||||
(mapcar 'car tramp-completion-file-name-handler-alist))
|
||||
(mapcar #'car tramp-completion-file-name-handler-alist))
|
||||
|
||||
(when (bound-and-true-p tramp-archive-enabled)
|
||||
(add-to-list 'file-name-handler-alist
|
||||
|
|
@ -2516,7 +2516,7 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
|
|||
(string-prefix-p "tramp-" (symbol-name (cdr fnh))))
|
||||
(setq file-name-handler-alist (delq fnh file-name-handler-alist))))))
|
||||
|
||||
(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
|
||||
(add-hook 'tramp-unload-hook #'tramp-unload-file-name-handlers)
|
||||
|
||||
;;; File name handler functions for completion mode:
|
||||
|
||||
|
|
@ -2621,7 +2621,7 @@ not in completion mode."
|
|||
"Like `file-name-completion' for Tramp files."
|
||||
(try-completion
|
||||
filename
|
||||
(mapcar 'list (file-name-all-completions filename directory))
|
||||
(mapcar #'list (file-name-all-completions filename directory))
|
||||
(when (and predicate
|
||||
(tramp-connectable-p (expand-file-name filename directory)))
|
||||
(lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
|
||||
|
|
@ -2739,7 +2739,7 @@ remote host and localname (filename on remote host)."
|
|||
(and method
|
||||
(string-match-p (concat "^" (regexp-quote partial-method)) method)
|
||||
(tramp-completion-make-tramp-file-name method nil nil nil)))
|
||||
(mapcar 'car tramp-methods)))
|
||||
(mapcar #'car tramp-methods)))
|
||||
|
||||
;; Compares partial user and host names with possible completions.
|
||||
(defun tramp-get-completion-user-host
|
||||
|
|
@ -2828,7 +2828,7 @@ User is always nil."
|
|||
(defun tramp-parse-rhosts (filename)
|
||||
"Return a list of (user host) tuples allowed to access.
|
||||
Either user or host may be nil."
|
||||
(tramp-parse-file filename 'tramp-parse-rhosts-group))
|
||||
(tramp-parse-file filename #'tramp-parse-rhosts-group))
|
||||
|
||||
(defun tramp-parse-rhosts-group ()
|
||||
"Return a (user host) tuple allowed to access.
|
||||
|
|
@ -2846,7 +2846,7 @@ Either user or host may be nil."
|
|||
(defun tramp-parse-shosts (filename)
|
||||
"Return a list of (user host) tuples allowed to access.
|
||||
User is always nil."
|
||||
(tramp-parse-file filename 'tramp-parse-shosts-group))
|
||||
(tramp-parse-file filename #'tramp-parse-shosts-group))
|
||||
|
||||
(defun tramp-parse-shosts-group ()
|
||||
"Return a (user host) tuple allowed to access.
|
||||
|
|
@ -2856,7 +2856,7 @@ User is always nil."
|
|||
(defun tramp-parse-sconfig (filename)
|
||||
"Return a list of (user host) tuples allowed to access.
|
||||
User is always nil."
|
||||
(tramp-parse-file filename 'tramp-parse-sconfig-group))
|
||||
(tramp-parse-file filename #'tramp-parse-sconfig-group))
|
||||
|
||||
(defun tramp-parse-sconfig-group ()
|
||||
"Return a (user host) tuple allowed to access.
|
||||
|
|
@ -2895,7 +2895,7 @@ User is always nil."
|
|||
(defun tramp-parse-hosts (filename)
|
||||
"Return a list of (user host) tuples allowed to access.
|
||||
User is always nil."
|
||||
(tramp-parse-file filename 'tramp-parse-hosts-group))
|
||||
(tramp-parse-file filename #'tramp-parse-hosts-group))
|
||||
|
||||
(defun tramp-parse-hosts-group ()
|
||||
"Return a (user host) tuple allowed to access.
|
||||
|
|
@ -2913,7 +2913,7 @@ Host is always \"localhost\"."
|
|||
(goto-char (point-min))
|
||||
(cl-loop while (not (eobp)) collect
|
||||
(tramp-parse-etc-group-group))))
|
||||
(tramp-parse-file filename 'tramp-parse-passwd-group))))
|
||||
(tramp-parse-file filename #'tramp-parse-passwd-group))))
|
||||
|
||||
(defun tramp-parse-passwd-group ()
|
||||
"Return a (user host) tuple allowed to access.
|
||||
|
|
@ -2935,7 +2935,7 @@ Host is always \"localhost\"."
|
|||
(goto-char (point-min))
|
||||
(cl-loop while (not (eobp)) collect
|
||||
(tramp-parse-etc-group-group))))
|
||||
(tramp-parse-file filename 'tramp-parse-etc-group-group))))
|
||||
(tramp-parse-file filename #'tramp-parse-etc-group-group))))
|
||||
|
||||
(defun tramp-parse-etc-group-group ()
|
||||
"Return a (group host) tuple allowed to access.
|
||||
|
|
@ -3048,7 +3048,7 @@ User is always nil."
|
|||
(when (or (null match) (string-match-p match item))
|
||||
(push (if full (concat directory item) item)
|
||||
result)))
|
||||
(if nosort result (sort result 'string<)))))
|
||||
(if nosort result (sort result #'string<)))))
|
||||
|
||||
(defun tramp-handle-directory-files-and-attributes
|
||||
(directory &optional full match nosort id-format)
|
||||
|
|
@ -3074,10 +3074,10 @@ User is always nil."
|
|||
(setq name (concat (file-name-as-directory dir) name)))
|
||||
;; If NAME is not a Tramp file, run the real handler.
|
||||
(if (not (tramp-tramp-file-p name))
|
||||
(tramp-run-real-handler 'expand-file-name (list name nil))
|
||||
(tramp-run-real-handler #'expand-file-name (list name nil))
|
||||
;; Dissect NAME.
|
||||
(with-parsed-tramp-file-name name nil
|
||||
(unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
|
||||
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
|
||||
(setq localname (concat "/" localname)))
|
||||
;; Do normal `expand-file-name' (this does "/./" and "/../").
|
||||
;; `default-directory' is bound, because on Windows there would
|
||||
|
|
@ -3085,7 +3085,7 @@ User is always nil."
|
|||
(let ((default-directory (tramp-compat-temporary-file-directory)))
|
||||
(tramp-make-tramp-file-name
|
||||
v (tramp-drop-volume-letter
|
||||
(tramp-run-real-handler 'expand-file-name (list localname))))))))
|
||||
(tramp-run-real-handler #'expand-file-name (list localname))))))))
|
||||
|
||||
(defun tramp-handle-file-accessible-directory-p (filename)
|
||||
"Like `file-accessible-directory-p' for Tramp files."
|
||||
|
|
@ -3106,7 +3106,7 @@ User is always nil."
|
|||
(when (string-equal
|
||||
(file-remote-p (expand-file-name filename1))
|
||||
(file-remote-p (expand-file-name filename2)))
|
||||
(tramp-run-real-handler 'file-equal-p (list filename1 filename2))))
|
||||
(tramp-run-real-handler #'file-equal-p (list filename1 filename2))))
|
||||
|
||||
(defun tramp-handle-file-exists-p (filename)
|
||||
"Like `file-exists-p' for Tramp files."
|
||||
|
|
@ -3120,7 +3120,7 @@ User is always nil."
|
|||
(when (string-equal
|
||||
(file-remote-p (expand-file-name filename))
|
||||
(file-remote-p (expand-file-name directory)))
|
||||
(tramp-run-real-handler 'file-in-directory-p (list filename directory))))
|
||||
(tramp-run-real-handler #'file-in-directory-p (list filename directory))))
|
||||
|
||||
(defun tramp-handle-file-local-copy (filename)
|
||||
"Like `file-local-copy' for Tramp files."
|
||||
|
|
@ -3152,7 +3152,7 @@ User is always nil."
|
|||
v (or (and (zerop (length (tramp-file-name-localname v)))
|
||||
(not (tramp-connectable-p file)))
|
||||
(tramp-run-real-handler
|
||||
'file-name-as-directory
|
||||
#'file-name-as-directory
|
||||
(list (tramp-file-name-localname v)))))))
|
||||
|
||||
(defun tramp-handle-file-name-case-insensitive-p (filename)
|
||||
|
|
@ -3217,7 +3217,7 @@ User is always nil."
|
|||
(try-completion
|
||||
filename (file-name-all-completions filename directory)
|
||||
(lambda (x)
|
||||
(when (funcall (or predicate 'identity) (expand-file-name x directory))
|
||||
(when (funcall (or predicate #'identity) (expand-file-name x directory))
|
||||
(not
|
||||
(and
|
||||
completion-ignored-extensions
|
||||
|
|
@ -3238,13 +3238,13 @@ User is always nil."
|
|||
;; nil, mark also the localname part of `v' as nil.
|
||||
(tramp-make-tramp-file-name
|
||||
v (or (tramp-run-real-handler
|
||||
'file-name-directory (list (tramp-file-name-localname v)))
|
||||
#'file-name-directory (list (tramp-file-name-localname v)))
|
||||
'noloc))))
|
||||
|
||||
(defun tramp-handle-file-name-nondirectory (file)
|
||||
"Like `file-name-nondirectory' but aware of Tramp files."
|
||||
(with-parsed-tramp-file-name file nil
|
||||
(tramp-run-real-handler 'file-name-nondirectory (list localname))))
|
||||
(tramp-run-real-handler #'file-name-nondirectory (list localname))))
|
||||
|
||||
(defun tramp-handle-file-newer-than-file-p (file1 file2)
|
||||
"Like `file-newer-than-file-p' for Tramp files."
|
||||
|
|
@ -3301,7 +3301,7 @@ User is always nil."
|
|||
;; Preserve trailing "/".
|
||||
(funcall
|
||||
(if (string-equal (file-name-nondirectory filename) "")
|
||||
'file-name-as-directory 'identity)
|
||||
#'file-name-as-directory #'identity)
|
||||
(let ((result (expand-file-name filename))
|
||||
(numchase 0)
|
||||
;; Don't make the following value larger than necessary.
|
||||
|
|
@ -3324,7 +3324,7 @@ User is always nil."
|
|||
v2
|
||||
(funcall
|
||||
(if (tramp-compat-file-name-quoted-p v2-localname)
|
||||
'tramp-compat-file-name-quote 'identity)
|
||||
#'tramp-compat-file-name-quote #'identity)
|
||||
|
||||
(if (stringp symlink-target)
|
||||
(if (file-remote-p symlink-target)
|
||||
|
|
@ -3366,7 +3366,7 @@ User is always nil."
|
|||
(cdr x))))
|
||||
tramp-backup-directory-alist)
|
||||
backup-directory-alist)))
|
||||
(tramp-run-real-handler 'find-backup-file-name (list filename)))))
|
||||
(tramp-run-real-handler #'find-backup-file-name (list filename)))))
|
||||
|
||||
(defun tramp-handle-insert-directory
|
||||
(filename switches &optional wildcard full-directory-p)
|
||||
|
|
@ -3384,7 +3384,7 @@ User is always nil."
|
|||
(require 'ls-lisp)
|
||||
(let (ls-lisp-use-insert-directory-program start)
|
||||
(tramp-run-real-handler
|
||||
'insert-directory
|
||||
#'insert-directory
|
||||
(list filename switches wildcard full-directory-p))
|
||||
;; `ls-lisp' always returns full listings. We must remove
|
||||
;; superfluous parts.
|
||||
|
|
@ -3426,7 +3426,7 @@ User is always nil."
|
|||
;; run directly.
|
||||
(setq result
|
||||
(tramp-run-real-handler
|
||||
'insert-file-contents
|
||||
#'insert-file-contents
|
||||
(list localname visit beg end replace)))
|
||||
|
||||
;; When we shall insert only a part of the file, we
|
||||
|
|
@ -3561,7 +3561,7 @@ support symbolic links."
|
|||
;; This is needed prior Emacs 26.1, where TARGET has also be
|
||||
;; checked for a file name handler.
|
||||
(tramp-run-real-handler
|
||||
'make-symbolic-link (list target linkname ok-if-already-exists))))
|
||||
#'make-symbolic-link (list target linkname ok-if-already-exists))))
|
||||
|
||||
(defun tramp-handle-shell-command
|
||||
(command &optional output-buffer error-buffer)
|
||||
|
|
@ -3619,18 +3619,18 @@ support symbolic links."
|
|||
(if (and (not current-buffer-p) (integerp asynchronous))
|
||||
(prog1
|
||||
;; Run the process.
|
||||
(setq p (apply 'start-file-process "*Async Shell*" buffer args))
|
||||
(setq p (apply #'start-file-process "*Async Shell*" buffer args))
|
||||
;; Display output.
|
||||
(with-current-buffer output-buffer
|
||||
(display-buffer output-buffer '(nil (allow-no-window . t)))
|
||||
(setq mode-line-process '(":%s"))
|
||||
(shell-mode)
|
||||
(set-process-sentinel p 'shell-command-sentinel)
|
||||
(set-process-sentinel p #'shell-command-sentinel)
|
||||
(set-process-filter p 'comint-output-filter)))
|
||||
|
||||
(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
|
||||
|
|
@ -3685,7 +3685,7 @@ support symbolic links."
|
|||
;; We must disable cygwin-mount file name
|
||||
;; handlers and alike.
|
||||
(tramp-run-real-handler
|
||||
'substitute-in-file-name (list localname))))))))
|
||||
#'substitute-in-file-name (list localname))))))))
|
||||
;; "/m:h:~" does not work for completion. We use "/m:h:~/".
|
||||
(if (and (stringp localname) (string-equal "~" localname))
|
||||
(concat filename "/")
|
||||
|
|
@ -3709,7 +3709,7 @@ support symbolic links."
|
|||
(file-attributes (buffer-file-name)))
|
||||
tramp-time-doesnt-exist))))
|
||||
(unless (tramp-compat-time-equal-p time-list tramp-time-dont-know)
|
||||
(tramp-run-real-handler 'set-visited-file-modtime (list time-list))))
|
||||
(tramp-run-real-handler #'set-visited-file-modtime (list time-list))))
|
||||
|
||||
(defun tramp-handle-verify-visited-file-modtime (&optional buf)
|
||||
"Like `verify-visited-file-modtime' for Tramp files.
|
||||
|
|
@ -3762,7 +3762,7 @@ of."
|
|||
;; modtime data to be clobbered from the temp file. We call
|
||||
;; `set-visited-file-modtime' ourselves later on.
|
||||
(tramp-run-real-handler
|
||||
'write-region (list start end tmpfile append 'no-message lockname))
|
||||
#'write-region (list start end tmpfile append 'no-message lockname))
|
||||
(condition-case nil
|
||||
(rename-file tmpfile filename 'ok-if-already-exists)
|
||||
(error
|
||||
|
|
@ -3929,7 +3929,7 @@ The terminal type can be configured with `tramp-terminal-type'."
|
|||
(throw 'tramp-action 'ok))
|
||||
((or (and (memq (process-status proc) '(stop exit))
|
||||
(not (zerop (process-exit-status proc))))
|
||||
(memq (process-status proc) '(signal)))
|
||||
(eq (process-status proc) 'signal))
|
||||
;; `scp' could have copied correctly, but set modes could have failed.
|
||||
;; This can be ignored.
|
||||
(with-current-buffer (process-buffer proc)
|
||||
|
|
@ -4157,7 +4157,7 @@ the remote host use line-endings as defined in the variable
|
|||
;; Replace "\n" by `tramp-rsh-end-of-line'.
|
||||
(setq string
|
||||
(mapconcat
|
||||
'identity (split-string string "\n") tramp-rsh-end-of-line))
|
||||
#'identity (split-string string "\n") tramp-rsh-end-of-line))
|
||||
(unless (or (string= string "")
|
||||
(string-equal (substring string -1) tramp-rsh-end-of-line))
|
||||
(setq string (concat string tramp-rsh-end-of-line)))
|
||||
|
|
@ -4328,7 +4328,7 @@ If FILENAME is remote, a file name handler is called."
|
|||
|
||||
(let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid)))
|
||||
(if handler
|
||||
(funcall handler 'tramp-set-file-uid-gid filename uid gid)
|
||||
(funcall handler #'tramp-set-file-uid-gid filename uid gid)
|
||||
;; On W32 "chown" does not work.
|
||||
(unless (memq system-type '(ms-dos windows-nt))
|
||||
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
|
||||
|
|
@ -4543,7 +4543,7 @@ this file, if that variable is non-nil."
|
|||
(tramp-compat-file-name-unquote (buffer-file-name)))
|
||||
tramp-auto-save-directory))))
|
||||
;; Run plain `make-auto-save-file-name'.
|
||||
(tramp-run-real-handler 'make-auto-save-file-name nil)))
|
||||
(tramp-run-real-handler #'make-auto-save-file-name nil)))
|
||||
|
||||
(defun tramp-subst-strs-in-string (alist string)
|
||||
"Replace all occurrences of the string FROM with TO in STRING.
|
||||
|
|
@ -4588,12 +4588,12 @@ are written with verbosity of 6."
|
|||
output error result)
|
||||
(tramp-message
|
||||
vec 6 "`%s %s' %s %s"
|
||||
program (mapconcat 'identity args " ") infile destination)
|
||||
program (mapconcat #'identity args " ") infile destination)
|
||||
(condition-case err
|
||||
(with-temp-buffer
|
||||
(setq result
|
||||
(apply
|
||||
'call-process program infile (or destination t) display args))
|
||||
#'call-process program infile (or destination t) display args))
|
||||
;; `result' could also be an error string.
|
||||
(when (stringp result)
|
||||
(setq error result
|
||||
|
|
@ -4620,12 +4620,12 @@ are written with verbosity of 6."
|
|||
result)
|
||||
(tramp-message
|
||||
vec 6 "`%s %s' %s %s %s %s"
|
||||
program (mapconcat 'identity args " ") start end delete buffer)
|
||||
program (mapconcat #'identity args " ") start end delete buffer)
|
||||
(condition-case err
|
||||
(progn
|
||||
(setq result
|
||||
(apply
|
||||
'call-process-region
|
||||
#'call-process-region
|
||||
start end program delete buffer display args))
|
||||
;; `result' could also be an error string.
|
||||
(when (stringp result)
|
||||
|
|
@ -4648,11 +4648,11 @@ verbosity of 6."
|
|||
(vec (or vec (car tramp-current-connection)))
|
||||
result)
|
||||
(if args
|
||||
(tramp-message vec 6 "%s %s" program (mapconcat 'identity args " "))
|
||||
(tramp-message vec 6 "%s %s" program (mapconcat #'identity args " "))
|
||||
(tramp-message vec 6 "%s" program))
|
||||
(setq result
|
||||
(condition-case err
|
||||
(apply 'process-lines program args)
|
||||
(apply #'process-lines program args)
|
||||
(error
|
||||
(tramp-error vec (car err) (cdr err)))))
|
||||
(tramp-message vec 6 "%s" result)
|
||||
|
|
@ -4838,7 +4838,7 @@ Only works for Bourne-like shells."
|
|||
(defun tramp-unload-tramp ()
|
||||
"Discard Tramp from loading remote files."
|
||||
(interactive)
|
||||
;; ange-ftp settings must be enabled.
|
||||
;; ange-ftp settings must be re-enabled.
|
||||
(tramp-compat-funcall 'tramp-ftp-enable-ange-ftp)
|
||||
;; Maybe it's not loaded yet.
|
||||
(ignore-errors (unload-feature 'tramp 'force)))
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ the origin of the temporary TMPFILE, have no write permissions."
|
|||
(if (file-regular-p tmpfile)
|
||||
(delete-file tmpfile)
|
||||
(mapc
|
||||
'tramp-archive--test-delete
|
||||
#'tramp-archive--test-delete
|
||||
(directory-files tmpfile 'full directory-files-no-dot-files-regexp))
|
||||
(delete-directory tmpfile)))
|
||||
|
||||
|
|
@ -662,7 +662,7 @@ This tests also `access-file', `file-readable-p' and `file-regular-p'."
|
|||
(dolist (elt attr)
|
||||
(should (equal (file-attributes (car elt)) (cdr elt))))
|
||||
(setq attr (directory-files-and-attributes tmp-name nil "^b"))
|
||||
(should (equal (mapcar 'car attr) '("bar"))))
|
||||
(should (equal (mapcar #'car attr) '("bar"))))
|
||||
|
||||
;; Cleanup.
|
||||
(tramp-archive-cleanup-hash))))
|
||||
|
|
@ -752,14 +752,14 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
|
|||
(should-not (file-name-completion "a" tmp-name))
|
||||
(should
|
||||
(equal
|
||||
(file-name-completion "b" tmp-name 'file-directory-p) "bar/"))
|
||||
(file-name-completion "b" tmp-name #'file-directory-p) "bar/"))
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "fo" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "fo" tmp-name) #'string-lessp)
|
||||
'("foo.hrd" "foo.lnk" "foo.txt")))
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "b" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "b" tmp-name) #'string-lessp)
|
||||
'("bar/" "baz.tar")))
|
||||
(should-not (file-name-all-completions "a" tmp-name))
|
||||
;; `completion-regexp-list' restricts the completion to
|
||||
|
|
@ -770,7 +770,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
|
|||
(equal (file-name-completion "" tmp-name) "ba"))
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "" tmp-name) #'string-lessp)
|
||||
'("bar/" "baz.tar")))))
|
||||
|
||||
;; Cleanup.
|
||||
|
|
@ -859,7 +859,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
|
|||
"%s -batch -Q -L %s --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument (format code file)))))))))
|
||||
|
||||
(ert-deftest tramp-archive-test44-delay-load ()
|
||||
|
|
@ -896,7 +896,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
|
|||
"%s -batch -Q -L %s --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument
|
||||
(format
|
||||
code tae tramp-archive-test-file-archive
|
||||
|
|
@ -958,7 +958,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
|
|||
"Run all tests for \\[tramp-archive]."
|
||||
(interactive "p")
|
||||
(funcall
|
||||
(if interactive 'ert-run-tests-interactively 'ert-run-tests-batch)
|
||||
(if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
|
||||
"^tramp-archive"))
|
||||
|
||||
(provide 'tramp-archive-tests)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
;; Beautify batch mode.
|
||||
(when noninteractive
|
||||
;; Suppress nasty messages.
|
||||
(fset 'shell-command-sentinel 'ignore)
|
||||
(fset #'shell-command-sentinel #'ignore)
|
||||
;; We do not want to be interrupted.
|
||||
(eval-after-load 'tramp-gvfs
|
||||
'(fset 'tramp-gvfs-handler-askquestion
|
||||
|
|
@ -149,7 +149,7 @@ If LOCAL is non-nil, a local file name is returned.
|
|||
If QUOTED is non-nil, the local part of the file name is quoted.
|
||||
The temporary file is not created."
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(make-temp-name "tramp-test")
|
||||
(if local temporary-file-directory tramp-test-temporary-file-directory))))
|
||||
|
|
@ -185,7 +185,7 @@ properly. BODY shall not contain a timeout."
|
|||
"Emit a message into ERT *Messages*."
|
||||
(tramp--test-instrument-test-case 0
|
||||
(apply
|
||||
'tramp-message
|
||||
#'tramp-message
|
||||
(tramp-dissect-file-name tramp-test-temporary-file-directory) 0
|
||||
fmt-string arguments)))
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ properly. BODY shall not contain a timeout."
|
|||
tramp-default-user-alist
|
||||
tramp-default-host-alist
|
||||
;; Suppress check for multihops.
|
||||
(tramp-cache-data (make-hash-table :test 'equal))
|
||||
(tramp-cache-data (make-hash-table :test #'equal))
|
||||
(tramp-connection-properties '((nil "login-program" t))))
|
||||
;; Expand `tramp-default-user' and `tramp-default-host'.
|
||||
(should (string-equal
|
||||
|
|
@ -844,7 +844,7 @@ properly. BODY shall not contain a timeout."
|
|||
tramp-default-user-alist
|
||||
tramp-default-host-alist
|
||||
;; Suppress check for multihops.
|
||||
(tramp-cache-data (make-hash-table :test 'equal))
|
||||
(tramp-cache-data (make-hash-table :test #'equal))
|
||||
(tramp-connection-properties '((nil "login-program" t)))
|
||||
(syntax tramp-syntax))
|
||||
(unwind-protect
|
||||
|
|
@ -1168,7 +1168,7 @@ properly. BODY shall not contain a timeout."
|
|||
tramp-default-user-alist
|
||||
tramp-default-host-alist
|
||||
;; Suppress check for multihops.
|
||||
(tramp-cache-data (make-hash-table :test 'equal))
|
||||
(tramp-cache-data (make-hash-table :test #'equal))
|
||||
(tramp-connection-properties '((nil "login-program" t)))
|
||||
(syntax tramp-syntax))
|
||||
(unwind-protect
|
||||
|
|
@ -2759,7 +2759,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
|
|||
(tmp-name4 (expand-file-name "bar" tmp-name2))
|
||||
(tramp-test-temporary-file-directory
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
tramp-test-temporary-file-directory))
|
||||
buffer)
|
||||
(unwind-protect
|
||||
|
|
@ -2936,7 +2936,7 @@ This tests also `access-file', `file-readable-p',
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(car attr))
|
||||
(file-remote-p (file-truename tmp-name1) 'localname)))
|
||||
(delete-file tmp-name2))
|
||||
|
|
@ -3028,7 +3028,7 @@ They might differ only in access time."
|
|||
(tramp--test-file-attributes-equal-p
|
||||
(file-attributes (car elt)) (cdr elt)))))
|
||||
(setq attr (directory-files-and-attributes tmp-name2 nil "^b"))
|
||||
(should (equal (mapcar 'car attr) '("bar" "boz"))))
|
||||
(should (equal (mapcar #'car attr) '("bar" "boz"))))
|
||||
|
||||
;; Cleanup.
|
||||
(ignore-errors (delete-directory tmp-name1 'recursive))))))
|
||||
|
|
@ -3100,7 +3100,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
(file-remote-p tmp-name1 'localname))
|
||||
(file-symlink-p tmp-name2)))
|
||||
(when (tramp--test-expensive-test)
|
||||
|
|
@ -3109,7 +3109,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
:type 'file-already-exists))
|
||||
(when (tramp--test-expensive-test)
|
||||
;; A number means interactive case.
|
||||
(cl-letf (((symbol-function 'yes-or-no-p) 'ignore))
|
||||
(cl-letf (((symbol-function 'yes-or-no-p) #'ignore))
|
||||
(should-error
|
||||
(make-symbolic-link tmp-name1 tmp-name2 0)
|
||||
:type 'file-already-exists)))
|
||||
|
|
@ -3118,14 +3118,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
(file-remote-p tmp-name1 'localname))
|
||||
(file-symlink-p tmp-name2))))
|
||||
(make-symbolic-link tmp-name1 tmp-name2 'ok-if-already-exists)
|
||||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
(file-remote-p tmp-name1 'localname))
|
||||
(file-symlink-p tmp-name2)))
|
||||
;; 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'."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
(file-remote-p tmp-name1 'localname))
|
||||
(file-symlink-p tmp-name2)))
|
||||
;; `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'."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
(file-remote-p tmp-name1 'localname))
|
||||
(file-symlink-p tmp-name5)))
|
||||
;; `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'."
|
|||
(add-name-to-file tmp-name1 tmp-name2)
|
||||
:type 'file-already-exists)
|
||||
;; A number means interactive case.
|
||||
(cl-letf (((symbol-function 'yes-or-no-p) 'ignore))
|
||||
(cl-letf (((symbol-function 'yes-or-no-p) #'ignore))
|
||||
(should-error
|
||||
(add-name-to-file tmp-name1 tmp-name2 0)
|
||||
:type 'file-already-exists))
|
||||
|
|
@ -3239,7 +3239,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(delete-file tmp-name2)
|
||||
(make-symbolic-link
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-unquote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-unquote #'identity)
|
||||
"/penguin:motd:")
|
||||
tmp-name2)
|
||||
(should (file-symlink-p tmp-name2))
|
||||
|
|
@ -3328,7 +3328,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(let* ((dir1
|
||||
(directory-file-name
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
tramp-test-temporary-file-directory)))
|
||||
(dir2 (file-name-as-directory dir1)))
|
||||
(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'."
|
|||
(should-not (file-name-completion "a" tmp-name))
|
||||
(should
|
||||
(equal
|
||||
(file-name-completion "b" tmp-name 'file-directory-p) "boz/"))
|
||||
(file-name-completion "b" tmp-name #'file-directory-p) "boz/"))
|
||||
(should
|
||||
(equal (file-name-all-completions "fo" tmp-name) '("foo")))
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "b" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "b" tmp-name) #'string-lessp)
|
||||
'("bold" "boz/")))
|
||||
(should-not (file-name-all-completions "a" tmp-name))
|
||||
;; `completion-regexp-list' restricts the completion to
|
||||
|
|
@ -3724,7 +3724,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(equal (file-name-completion "" tmp-name) "bo"))
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "" tmp-name) #'string-lessp)
|
||||
'("bold" "boz/"))))
|
||||
;; `file-name-completion' ignores file names that end in
|
||||
;; any string in `completion-ignored-extensions'.
|
||||
|
|
@ -3739,7 +3739,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
;; `file-name-all-completions' is not affected.
|
||||
(should
|
||||
(equal
|
||||
(sort (file-name-all-completions "" tmp-name) 'string-lessp)
|
||||
(sort (file-name-all-completions "" tmp-name) #'string-lessp)
|
||||
'("../" "./" "bold" "boz/" "foo" "foo.ext")))))
|
||||
|
||||
;; Cleanup.
|
||||
|
|
@ -4288,7 +4288,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(with-current-buffer (get-buffer-create "*shell*")
|
||||
(ignore-errors (kill-process (current-buffer)))
|
||||
(should-not explicit-shell-file-name)
|
||||
(call-interactively 'shell)
|
||||
(call-interactively #'shell)
|
||||
(should explicit-shell-file-name)))
|
||||
|
||||
(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'."
|
|||
(car (last (with-no-warnings (exec-path))))
|
||||
(file-remote-p default-directory 'localname)))
|
||||
;; The shell "sh" shall always exist.
|
||||
(should (apply 'executable-find '("sh" remote)))
|
||||
(should (apply #'executable-find '("sh" remote)))
|
||||
;; Since the last element in `exec-path' is the current
|
||||
;; directory, an executable file in that directory will be
|
||||
;; found.
|
||||
|
|
@ -4326,11 +4326,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(should
|
||||
(string-equal
|
||||
(apply
|
||||
'executable-find `(,(file-name-nondirectory tmp-name) remote))
|
||||
#'executable-find `(,(file-name-nondirectory tmp-name) remote))
|
||||
(file-remote-p tmp-name 'localname)))
|
||||
(should-not
|
||||
(apply
|
||||
'executable-find
|
||||
#'executable-find
|
||||
`(,(concat (file-name-nondirectory tmp-name) "foo") remote))))
|
||||
|
||||
;; Cleanup.
|
||||
|
|
@ -4375,7 +4375,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
;; We make a super long `tramp-remote-path'.
|
||||
(make-directory tmp-name)
|
||||
(should (file-directory-p tmp-name))
|
||||
(while (< (length (mapconcat 'identity orig-exec-path ":")) 5000)
|
||||
(while (< (length (mapconcat #'identity orig-exec-path ":")) 5000)
|
||||
(let ((dir (make-temp-file (file-name-as-directory tmp-name) 'dir)))
|
||||
(should (file-directory-p dir))
|
||||
(setq tramp-remote-path
|
||||
|
|
@ -4391,9 +4391,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
;; Ignore trailing newline.
|
||||
(substring (shell-command-to-string "echo $PATH") nil -1)
|
||||
;; The last element of `exec-path' is `exec-directory'.
|
||||
(mapconcat 'identity (butlast orig-exec-path) ":")))
|
||||
(mapconcat #'identity (butlast orig-exec-path) ":")))
|
||||
;; The shell "sh" shall always exist.
|
||||
(should (apply 'executable-find '("sh" remote))))
|
||||
(should (apply #'executable-find '("sh" remote))))
|
||||
|
||||
;; Cleanup.
|
||||
(tramp-cleanup-connection
|
||||
|
|
@ -4509,7 +4509,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(string-equal
|
||||
(make-auto-save-file-name)
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(format "#%s#" (file-name-nondirectory tmp-name1))
|
||||
tramp-test-temporary-file-directory))))))
|
||||
|
|
@ -4583,7 +4583,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(find-backup-file-name tmp-name1)
|
||||
(list
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(format "%s~" (file-name-nondirectory tmp-name1))
|
||||
tramp-test-temporary-file-directory)))))))
|
||||
|
|
@ -4597,7 +4597,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(find-backup-file-name tmp-name1)
|
||||
(list
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(format
|
||||
"%s~"
|
||||
|
|
@ -4625,7 +4625,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(find-backup-file-name tmp-name1)
|
||||
(list
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(format
|
||||
"%s~"
|
||||
|
|
@ -4654,7 +4654,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(find-backup-file-name tmp-name1)
|
||||
(list
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(expand-file-name
|
||||
(format
|
||||
"%s~"
|
||||
|
|
@ -4863,7 +4863,7 @@ This requires restrictions of file name syntax."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(car (file-attributes file3)))
|
||||
(file-remote-p (file-truename file1) 'localname)))
|
||||
;; Check file contents.
|
||||
|
|
@ -4875,10 +4875,10 @@ This requires restrictions of file name syntax."
|
|||
;; Check file names.
|
||||
(should (equal (directory-files
|
||||
tmp-name1 nil directory-files-no-dot-files-regexp)
|
||||
(sort (copy-sequence files) 'string-lessp)))
|
||||
(sort (copy-sequence files) #'string-lessp)))
|
||||
(should (equal (directory-files
|
||||
tmp-name2 nil directory-files-no-dot-files-regexp)
|
||||
(sort (copy-sequence files) 'string-lessp)))
|
||||
(sort (copy-sequence files) #'string-lessp)))
|
||||
|
||||
;; `substitute-in-file-name' could return different
|
||||
;; values. For `adb', there could be strange file
|
||||
|
|
@ -4938,7 +4938,7 @@ This requires restrictions of file name syntax."
|
|||
(should
|
||||
(string-equal
|
||||
(funcall
|
||||
(if quoted 'tramp-compat-file-name-quote 'identity)
|
||||
(if quoted #'tramp-compat-file-name-quote #'identity)
|
||||
(cadr (car (directory-files-and-attributes
|
||||
file1 nil (regexp-quote elt1)))))
|
||||
(file-remote-p (file-truename file2) 'localname)))
|
||||
|
|
@ -5024,9 +5024,9 @@ This requires restrictions of file name syntax."
|
|||
(unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]")
|
||||
"{foo}bar{baz}")))
|
||||
;; Simplify test in order to speed up.
|
||||
(apply 'tramp--test-check-files
|
||||
(apply #'tramp--test-check-files
|
||||
(if (tramp--test-expensive-test)
|
||||
files (list (mapconcat 'identity files ""))))))
|
||||
files (list (mapconcat #'identity files ""))))))
|
||||
|
||||
;; These tests are inspired by Bug#17238.
|
||||
(ert-deftest tramp-test40-special-characters ()
|
||||
|
|
@ -5108,7 +5108,7 @@ Use the `ls' command."
|
|||
(file-name-coding-system
|
||||
(coding-system-change-eol-conversion utf8 'unix)))
|
||||
(apply
|
||||
'tramp--test-check-files
|
||||
#'tramp--test-check-files
|
||||
(append
|
||||
(list
|
||||
(unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
|
||||
|
|
@ -5252,7 +5252,7 @@ process sentinels. They shall not disturb each other."
|
|||
|
||||
(with-timeout
|
||||
(tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))
|
||||
(define-key special-event-map [sigusr1] 'tramp--test-timeout-handler)
|
||||
(define-key special-event-map [sigusr1] #'tramp--test-timeout-handler)
|
||||
(let* (;; For the watchdog.
|
||||
(default-directory (expand-file-name temporary-file-directory))
|
||||
(shell-file-name "/bin/sh")
|
||||
|
|
@ -5287,8 +5287,8 @@ process sentinels. They shall not disturb each other."
|
|||
;; We must distinguish due to performance reasons.
|
||||
(timer-operation
|
||||
(cond
|
||||
((tramp--test-mock-p) 'vc-registered)
|
||||
(t 'file-attributes)))
|
||||
((tramp--test-mock-p) #'vc-registered)
|
||||
(t #'file-attributes)))
|
||||
;; This is when all timers start. We check inside the
|
||||
;; timer function, that we don't exceed timeout.
|
||||
(timer-start (current-time))
|
||||
|
|
@ -5414,7 +5414,7 @@ process sentinels. They shall not disturb each other."
|
|||
tmp-name nil directory-files-no-dot-files-regexp)))
|
||||
|
||||
;; Cleanup.
|
||||
(define-key special-event-map [sigusr1] 'ignore)
|
||||
(define-key special-event-map [sigusr1] #'ignore)
|
||||
(ignore-errors (quit-process watchdog))
|
||||
(dolist (buf buffers)
|
||||
(ignore-errors (delete-process (get-buffer-process buf)))
|
||||
|
|
@ -5440,7 +5440,7 @@ process sentinels. They shall not disturb each other."
|
|||
"%s -batch -Q -L %s --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument code)))))))
|
||||
|
||||
(ert-deftest tramp-test44-delay-load ()
|
||||
|
|
@ -5473,7 +5473,7 @@ process sentinels. They shall not disturb each other."
|
|||
"%s -batch -Q -L %s --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument (format code tm)))))))))
|
||||
|
||||
(ert-deftest tramp-test44-recursive-load ()
|
||||
|
|
@ -5497,7 +5497,7 @@ process sentinels. They shall not disturb each other."
|
|||
"%s -batch -Q -L %s --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument code))))))))
|
||||
|
||||
(ert-deftest tramp-test44-remote-load-path ()
|
||||
|
|
@ -5526,7 +5526,7 @@ process sentinels. They shall not disturb each other."
|
|||
"%s -batch -Q -L %s -l tramp-sh --eval %s"
|
||||
(shell-quote-argument
|
||||
(expand-file-name invocation-name invocation-directory))
|
||||
(mapconcat 'shell-quote-argument load-path " -L ")
|
||||
(mapconcat #'shell-quote-argument load-path " -L ")
|
||||
(shell-quote-argument code)))))))
|
||||
|
||||
(ert-deftest tramp-test45-unload ()
|
||||
|
|
@ -5554,7 +5554,7 @@ Since it unloads Tramp, it shall be the last test to run."
|
|||
(all-completions
|
||||
"tramp" (delq 'tramp-tests (delq 'tramp-archive-tests features))))
|
||||
;; `file-name-handler-alist' must be clean.
|
||||
(should-not (all-completions "tramp" (mapcar 'cdr file-name-handler-alist)))
|
||||
(should-not (all-completions "tramp" (mapcar #'cdr file-name-handler-alist)))
|
||||
;; There shouldn't be left a bound symbol, except buffer-local
|
||||
;; variables, and autoload functions. We do not regard our test
|
||||
;; symbols, and the Tramp unload hooks.
|
||||
|
|
@ -5589,7 +5589,8 @@ Since it unloads Tramp, it shall be the last test to run."
|
|||
"Run all tests for \\[tramp]."
|
||||
(interactive "p")
|
||||
(funcall
|
||||
(if interactive 'ert-run-tests-interactively 'ert-run-tests-batch) "^tramp"))
|
||||
(if interactive
|
||||
#'ert-run-tests-interactively #'ert-run-tests-batch) "^tramp"))
|
||||
|
||||
;; TODO:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue