* lisp/net/tramp-compat.el (cl-lib): Require it rather than cl.
* lisp/net/tramp-ftp.el: Don't require cl.
* lisp/net/tramp-gvfs.el: Don't require cl.
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p): Use `cl-*' macros.
* lisp/net/tramp-sh.el: Don't require cl.
(tramp-set-file-uid-gid): Use `shell-quote-argument'.
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter): Use `cl-*' macros.
* lisp/net/tramp-smb.el: Don't require cl.
(tramp-smb-read-file-entry): Use `cl-*' macros.
* lisp/net/tramp.el (cl-lib): Require it rather than cl.
(tramp-parse-file, tramp-parse-shostkeys-sknownhosts)
(tramp-parse-passwd, tramp-parse-etc-group)
(tramp-parse-putty): Use `cl-*' macros.
;;; Code:
-;; Pacify byte-compiler.
-(eval-when-compile
- (require 'cl))
-
(require 'auth-source)
(require 'advice)
+(require 'cl-lib)
(require 'custom)
(require 'format-spec)
(require 'parse-time)
;; Pacify byte-compiler.
(eval-when-compile
- (require 'cl)
(require 'custom))
(defvar ange-ftp-ftp-name-arg)
(defvar ange-ftp-ftp-name-res)
;; Pacify byte-compiler.
(eval-when-compile
- (require 'cl)
(require 'custom))
;;;###tramp-autoload
;; elements.
(while (stringp (car elt)) (setq elt (cdr elt)))
(let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string (cadr elt)))
- (mount-spec (caddr elt))
+ (mount-spec (cl-caddr elt))
(default-location (tramp-gvfs-dbus-byte-array-to-string
- (cadddr elt)))
+ (cl-cadddr elt)))
(method (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "type" (cadr mount-spec)))))
(user (tramp-gvfs-dbus-byte-array-to-string
(while (stringp (car elt)) (setq elt (cdr elt)))
(let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string
(cadr elt)))
- (mount-spec (caddr elt))
+ (mount-spec (cl-caddr elt))
(default-location (tramp-gvfs-dbus-byte-array-to-string
- (cadddr elt)))
+ (cl-cadddr elt)))
(method (tramp-gvfs-dbus-byte-array-to-string
(cadr (assoc "type" (cadr mount-spec)))))
(user (tramp-gvfs-dbus-byte-array-to-string
;; Pacify byte-compiler.
(eval-when-compile
- (require 'cl)
(require 'dired))
(declare-function dired-remove-file "dired-aux")
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
(tramp-call-process
nil "chown" nil nil nil
- (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))))
+ (format "%d:%d" uid gid) (shell-quote-argument filename)))))))
(defun tramp-remote-selinux-p (vec)
"Check, whether SELINUX is enabled on the remote host."
(when file1 (concat remote-prefix file1)))))
(setq string (replace-match "" nil nil string))
;; Remove watch when file or directory to be watched is deleted.
- (when (and (member (caadr object) '(moved deleted))
+ (when (and (member (cl-caadr object) '(moved deleted))
(string-equal file (process-get proc 'watch-name)))
(delete-process proc))
;; Usually, we would add an Emacs event now. Unfortunately,
;; `unread-command-events' does not accept several events at
;; once. Therefore, we apply the handler directly.
- (when (member (caadr object) events)
+ (when (member (cl-caadr object) events)
(tramp-compat-funcall
'file-notify-handle-event
`(file-notify ,object file-notify-callback)))))
(split-string (match-string 1 line) "," 'omit))
(match-string 3 line))))
;; Remove watch when file or directory to be watched is deleted.
- (when (member (caadr object) '(move-self delete-self ignored))
+ (when (member (cl-caadr object) '(move-self delete-self ignored))
(delete-process proc))
;; Usually, we would add an Emacs event now. Unfortunately,
;; `unread-command-events' does not accept several events at
;; once. Therefore, we apply the handler directly.
- (when (member (caadr object) events)
+ (when (member (cl-caadr object) events)
(tramp-compat-funcall
'file-notify-handle-event
`(file-notify ,object file-notify-callback)))))))
(require 'tramp)
-;; Pacify byte-compiler.
-(eval-when-compile
- (require 'cl))
-
;; Define SMB method ...
;;;###tramp-autoload
(defconst tramp-smb-method "smb"
size 0))
;; Real listing.
- (block nil
+ (cl-block nil
;; year.
(if (string-match "\\([0-9]+\\)$" line)
(setq year (string-to-number (match-string 1 line))
line (substring line 0 -5))
- (return))
+ (cl-return))
;; time.
(if (string-match "\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)$" line)
min (string-to-number (match-string 2 line))
sec (string-to-number (match-string 3 line))
line (substring line 0 -9))
- (return))
+ (cl-return))
;; day.
(if (string-match "\\([0-9]+\\)$" line)
(setq day (string-to-number (match-string 1 line))
line (substring line 0 -3))
- (return))
+ (cl-return))
;; month.
(if (string-match "\\(\\w+\\)$" line)
(setq month (match-string 1 line)
line (substring line 0 -4))
- (return))
+ (cl-return))
;; weekday.
(if (string-match "\\(\\w+\\)$" line)
(setq line (substring line 0 -5))
- (return))
+ (cl-return))
;; size.
(if (string-match "\\([0-9]+\\)$" line)
(when (string-match "\\([ADHRSV]+\\)" (substring line length))
(setq length (+ length (match-end 0))))
(setq line (substring line 0 length)))
- (return))
+ (cl-return))
;; mode: ARCH, DIR, HIDDEN, RONLY, SYSTEM, VOLID.
(if (string-match "\\([ADHRSV]+\\)?$" line)
(lambda (_x) "") " "
(concat "r" (if (string-match "R" mode) "-" "w") "x"))))
line (substring line 0 -6))
- (return))
+ (cl-return))
;; localname.
(if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-*$" line)
(setq localname (match-string 1 line))
- (return))))
+ (cl-return))))
(when (and localname mode size)
(setq mtime
(require 'tramp-compat)
;; Pacify byte-compiler.
-(eval-when-compile
- (require 'cl))
+(require 'cl-lib)
(defvar auto-save-file-name-transforms)
(defvar eshell-path-env)
(defvar ls-lisp-use-insert-directory-program)
;; internal data structure. Convenience functions for internal
;; data structure.
-;; The basic structure for remote file names. We use a list,
-;; otherwise the test in `tramp-cache-data' fails.
+;; The basic structure for remote file names. We use a list :type,
+;; otherwise the persistent data are not read in tramp-cache.el.
(cl-defstruct (tramp-file-name (:type list) :named)
method user domain host port localname hop)
(with-temp-buffer
(insert-file-contents filename)
(goto-char (point-min))
- (loop while (not (eobp)) collect (funcall function))))))
+ (cl-loop while (not (eobp)) collect (funcall function))))))
;;;###tramp-autoload
(defun tramp-parse-rhosts (filename)
;; `default-directory' is remote.
(let* ((default-directory (tramp-compat-temporary-file-directory))
(files (and (file-directory-p dirname) (directory-files dirname))))
- (loop for f in files
- when (and (not (string-match "^\\.\\.?$" f)) (string-match regexp f))
- collect (list nil (match-string 1 f)))))
+ (cl-loop
+ for f in files
+ when (and (not (string-match "^\\.\\.?$" f)) (string-match regexp f))
+ collect (list nil (match-string 1 f)))))
;;;###tramp-autoload
(defun tramp-parse-shostkeys (dirname)
(with-temp-buffer
(when (zerop (tramp-call-process nil "getent" nil t nil "passwd"))
(goto-char (point-min))
- (loop while (not (eobp)) collect
- (tramp-parse-etc-group-group))))
+ (cl-loop while (not (eobp)) collect
+ (tramp-parse-etc-group-group))))
(tramp-parse-file filename 'tramp-parse-passwd-group))))
(defun tramp-parse-passwd-group ()
(with-temp-buffer
(when (zerop (tramp-call-process nil "getent" nil t nil "group"))
(goto-char (point-min))
- (loop while (not (eobp)) collect
- (tramp-parse-etc-group-group))))
+ (cl-loop while (not (eobp)) collect
+ (tramp-parse-etc-group-group))))
(tramp-parse-file filename 'tramp-parse-etc-group-group))))
(defun tramp-parse-etc-group-group ()
(when (zerop (tramp-call-process
nil "reg" nil t nil "query" registry-or-dirname))
(goto-char (point-min))
- (loop while (not (eobp)) collect
- (tramp-parse-putty-group registry-or-dirname)))))
+ (cl-loop while (not (eobp)) collect
+ (tramp-parse-putty-group registry-or-dirname)))))
;; UNIX case.
(tramp-parse-shostkeys-sknownhosts
registry-or-dirname (concat "^\\(" tramp-host-regexp "\\)$"))))