;; 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
(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))
"/")))))
;; 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) "/"))))
"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)))
(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"))))
(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)
(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)
(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"))
(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
(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
(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))
(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)
(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)))))
"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."
(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)
(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.
(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.")
\f
(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.
(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))
(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))
;;;###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 ()
(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.
;; 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)))))
\f
;; File name conversions.
;; 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))))
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.
"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
;;; -- 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
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
(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))))
(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.
(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)
(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)
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
(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
"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."
;; 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
(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
(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"))
(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)))
;; `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)
;; `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
(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
(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
(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
(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
(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."
;; `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))
;; `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
(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."
(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."
;; `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
;; `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)))
;; `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."
;; `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)
;;; 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
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
;; 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))
(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.
;; (message
;; "%s"
;; (mapcar
-;; 'car
+;; #'car
;; (dbus-call-method
;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
;; tramp-gvfs-interface-mounttracker "ListMountableInfo")))
(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)))
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)))
`(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))
(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)
\f
;; File name primitives.
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"))
(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.
(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)
;; 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."
;; 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)
'(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))
'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))))
\f
;; File name conversions.
(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."
(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.
(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)))))
(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
(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))
(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:
;; 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:
(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)))
'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))))
(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
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."
'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))))
\f
;; File name conversions.
(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)
;; 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 ":/")
(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
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.
(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
;; 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
(setq thisstep (pop steps))
(tramp-message
v 5 "Check %s"
- (mapconcat 'identity
+ (mapconcat #'identity
(append '("") (reverse result) (list thisstep))
"/"))
(setq symlink-target
(file-attributes
(tramp-make-tramp-file-name
v
- (mapconcat 'identity
+ (mapconcat #'identity
(append '("")
(reverse result)
(list thisstep))
;; Combine list to form string.
(setq result
(if result
- (mapconcat 'identity (cons "" result) "/")
+ (mapconcat #'identity (cons "" result) "/")
"/"))
(when (string= "" result)
(setq result "/")))))
(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
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
'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
(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))
;; `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))
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))
(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.
(tramp-get-buffer v)))
(t1
(tramp-run-real-handler
- 'rename-file
+ #'rename-file
(list tmpfile localname2 ok-if-already-exists)))))
;; Save exit.
(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)))
(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
"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)) "&"))
;; 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)))
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
(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
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"
(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)))
(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
(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:
(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
(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))
(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)
(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")
(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
(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)
;; 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.
(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))
;; 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)
(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
(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))
(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))
(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)))
(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)
"%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)
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
"\\(%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)
(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)))
(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
;; 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
(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
;; 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
(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
(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
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.
"%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))
(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.
(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.
(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)))))
(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"
(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))
;; 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)
;; 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
(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
(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)
(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,
(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."
;; 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))
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.
(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"
;; 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))
(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)
(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
;; 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)
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
'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))))
;; 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
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.
;; 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))
(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) "")
(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))))))
(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
(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)
"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.
(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.
(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)
(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))
"^%s$"
(regexp-opt
(mapcar
- 'file-name-sans-extension
+ #'file-name-sans-extension
(directory-files dir nil "^tramp.+\\.elc?$"))
'paren))))
(mapatoms
(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
(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:
"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))))))
(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
(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.
(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.
(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.
(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.
(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.
(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.
(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)
(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
(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."
(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."
(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."
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)
(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
;; 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."
;; 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.
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)
(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)
(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.
;; 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
;; 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)
(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
;; 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 "/")
(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.
;; 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
(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)
;; 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)))
(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)))
(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.
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
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)
(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)
(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)))
(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)))
(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))))
(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
(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.
"%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 ()
"%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
"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)
;; 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
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))))
"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)))
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
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
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
(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
(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))
(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))))))
(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)
: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)))
(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.
(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
(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
(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))
(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))
(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)))
(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
(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'.
;; `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.
(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)
(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.
(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.
;; 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
;; 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
(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))))))
(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)))))))
(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~"
(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~"
(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~"
(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.
;; 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
(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)))
(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 ()
(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) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
(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")
;; 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))
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)))
"%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 ()
"%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 ()
"%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 ()
"%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 ()
(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.
"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: