file-properties)))
(defun tramp-adb-handle-directory-files-and-attributes
- (directory &optional full match nosort id-format)
+ (directory &optional full match nosort id-format _count)
"Like `directory-files-and-attributes' for Tramp files."
(unless (file-exists-p directory)
(tramp-error
;; Add completion functions for AFP, DAV, DAVS, SFTP and SMB methods.
(when tramp-gvfs-enabled
;; Suppress D-Bus error messages.
- (let (tramp-gvfs-dbus-event-vector)
+ (let (tramp-gvfs-dbus-event-vector
+ ;; Sometimes, it fails with "Variable binding depth exceeds
+ ;; max-specpdl-size". Shall be fixed in Emacs 27.
+ (max-specpdl-size (* 2 max-specpdl-size)))
(zeroconf-init tramp-gvfs-zeroconf-domain)
(if (zeroconf-list-service-types)
(progn
(tramp-rclone-flush-directory-cache v)))
(defun tramp-rclone-handle-directory-files
- (directory &optional full match nosort)
+ (directory &optional full match nosort _count)
"Like `directory-files' for Tramp files."
(unless (file-exists-p directory)
(tramp-error
;; Directory listings.
(defun tramp-sh-handle-directory-files-and-attributes
- (directory &optional full match nosort id-format)
+ (directory &optional full match nosort id-format _count)
"Like `directory-files-and-attributes' for Tramp files."
(unless id-format (setq id-format 'integer))
(unless (file-exists-p directory)
v 'file-error "%s `%s'" (match-string 0) filename))))))
(defun tramp-smb-handle-directory-files
- (directory &optional full match nosort)
+ (directory &optional full match nosort _count)
"Like `directory-files' for Tramp files."
(unless (file-exists-p directory)
(tramp-error
(setq directory (substring directory 0 -1)))
directory)
-(defun tramp-handle-directory-files (directory &optional full match nosort)
+(defun tramp-handle-directory-files
+ (directory &optional full match nosort _count)
"Like `directory-files' for Tramp files."
(unless (file-exists-p directory)
(tramp-error
(if nosort result (sort result #'string<)))))
(defun tramp-handle-directory-files-and-attributes
- (directory &optional full match nosort id-format)
+ (directory &optional full match nosort id-format _count)
"Like `directory-files-and-attributes' for Tramp files."
(mapcar
(lambda (x)
"/method:host:/:/~/path/file"))))
;; The following test is inspired by Bug#26911 and Bug#34834. They
-;; are rather bugs in `expand-file-name', and it fails for all Emacs
-;; versions prior 28.1. Test added for later, when they are fixed.
+;; were bugs in `expand-file-name'.
(ert-deftest tramp-test05-expand-file-name-relative ()
"Check `expand-file-name'."
- :expected-result (if (>= emacs-major-version 28) :passed :failed)
(skip-unless (tramp--test-enabled))
-
- ;; These are the methods the test doesn't fail.
- (when (or (tramp--test-adb-p) (tramp--test-ange-ftp-p) (tramp--test-gvfs-p)
- (tramp--test-rclone-p)
- (tramp-smb-file-name-p tramp-test-temporary-file-directory))
- (setf (ert-test-expected-result-type
- (ert-get-test 'tramp-test05-expand-file-name-relative))
- :passed))
+ ;; The bugs are fixed in Emacs 28.1.
+ (skip-unless (tramp--test-emacs28-p))
+ ;; Methods with a share do not expand "/path/..".
+ (skip-unless (not (tramp--test-share-p)))
(should
(string-equal
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'tramp-sh-file-name-handler))
+(defun tramp--test-share-p ()
+ "Check, whether the method needs a share."
+ (and (tramp--test-gvfs-p)
+ (string-match-p
+ "^\\(afp\\|davs?\\|smb\\)$"
+ (file-remote-p tramp-test-temporary-file-directory 'method))))
+
(defun tramp--test-sudoedit-p ()
"Check, whether the sudoedit method is used."
(tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))