aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2020-11-11 13:24:50 +0100
committerMichael Albinus2020-11-11 13:24:50 +0100
commit658952a57a48c3cd80d62fcf0199ab9432ef8166 (patch)
tree2b1649647f49479cd913bb88b1da0a3127ec0408
parentac1a2b216089b03c244c8e7ceb577198eb0dc2c2 (diff)
downloademacs-658952a57a48c3cd80d62fcf0199ab9432ef8166.tar.gz
emacs-658952a57a48c3cd80d62fcf0199ab9432ef8166.zip
Some minor changes to Tramp, do not merge with master
* lisp/net/tramp.el (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): * lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files): * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add _COUNT. Make the functions forward compatible. * lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Increase `max-specpdl-size' temporarily. * test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun. (tramp-test05-expand-file-name-relative): Use it.
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-gvfs.el5
-rw-r--r--lisp/net/tramp-rclone.el2
-rw-r--r--lisp/net/tramp-sh.el2
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--lisp/net/tramp.el5
-rw-r--r--test/lisp/net/tramp-tests.el23
7 files changed, 23 insertions, 18 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 0efe055b084..2f20c8d93e5 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -383,7 +383,7 @@ ARGUMENTS to pass to the OPERATION."
383 file-properties))) 383 file-properties)))
384 384
385(defun tramp-adb-handle-directory-files-and-attributes 385(defun tramp-adb-handle-directory-files-and-attributes
386 (directory &optional full match nosort id-format) 386 (directory &optional full match nosort id-format _count)
387 "Like `directory-files-and-attributes' for Tramp files." 387 "Like `directory-files-and-attributes' for Tramp files."
388 (unless (file-exists-p directory) 388 (unless (file-exists-p directory)
389 (tramp-error 389 (tramp-error
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index ddb535fea6e..e369061664a 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -2091,7 +2091,10 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
2091;; Add completion functions for AFP, DAV, DAVS, SFTP and SMB methods. 2091;; Add completion functions for AFP, DAV, DAVS, SFTP and SMB methods.
2092(when tramp-gvfs-enabled 2092(when tramp-gvfs-enabled
2093 ;; Suppress D-Bus error messages. 2093 ;; Suppress D-Bus error messages.
2094 (let (tramp-gvfs-dbus-event-vector) 2094 (let (tramp-gvfs-dbus-event-vector
2095 ;; Sometimes, it fails with "Variable binding depth exceeds
2096 ;; max-specpdl-size". Shall be fixed in Emacs 27.
2097 (max-specpdl-size (* 2 max-specpdl-size)))
2095 (zeroconf-init tramp-gvfs-zeroconf-domain) 2098 (zeroconf-init tramp-gvfs-zeroconf-domain)
2096 (if (zeroconf-list-service-types) 2099 (if (zeroconf-list-service-types)
2097 (progn 2100 (progn
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index fcbd2010a26..1567a24e272 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -300,7 +300,7 @@ file names."
300 (tramp-rclone-flush-directory-cache v))) 300 (tramp-rclone-flush-directory-cache v)))
301 301
302(defun tramp-rclone-handle-directory-files 302(defun tramp-rclone-handle-directory-files
303 (directory &optional full match nosort) 303 (directory &optional full match nosort _count)
304 "Like `directory-files' for Tramp files." 304 "Like `directory-files' for Tramp files."
305 (unless (file-exists-p directory) 305 (unless (file-exists-p directory)
306 (tramp-error 306 (tramp-error
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index df6720b99b7..4dca040aebb 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1721,7 +1721,7 @@ of."
1721;; Directory listings. 1721;; Directory listings.
1722 1722
1723(defun tramp-sh-handle-directory-files-and-attributes 1723(defun tramp-sh-handle-directory-files-and-attributes
1724 (directory &optional full match nosort id-format) 1724 (directory &optional full match nosort id-format _count)
1725 "Like `directory-files-and-attributes' for Tramp files." 1725 "Like `directory-files-and-attributes' for Tramp files."
1726 (unless id-format (setq id-format 'integer)) 1726 (unless id-format (setq id-format 'integer))
1727 (unless (file-exists-p directory) 1727 (unless (file-exists-p directory)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 902fcf4b6e3..b76308ac441 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -695,7 +695,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
695 v 'file-error "%s `%s'" (match-string 0) filename)))))) 695 v 'file-error "%s `%s'" (match-string 0) filename))))))
696 696
697(defun tramp-smb-handle-directory-files 697(defun tramp-smb-handle-directory-files
698 (directory &optional full match nosort) 698 (directory &optional full match nosort _count)
699 "Like `directory-files' for Tramp files." 699 "Like `directory-files' for Tramp files."
700 (unless (file-exists-p directory) 700 (unless (file-exists-p directory)
701 (tramp-error 701 (tramp-error
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e7432f2aa09..08bc0ffdd7d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3102,7 +3102,8 @@ User is always nil."
3102 (setq directory (substring directory 0 -1))) 3102 (setq directory (substring directory 0 -1)))
3103 directory) 3103 directory)
3104 3104
3105(defun tramp-handle-directory-files (directory &optional full match nosort) 3105(defun tramp-handle-directory-files
3106 (directory &optional full match nosort _count)
3106 "Like `directory-files' for Tramp files." 3107 "Like `directory-files' for Tramp files."
3107 (unless (file-exists-p directory) 3108 (unless (file-exists-p directory)
3108 (tramp-error 3109 (tramp-error
@@ -3121,7 +3122,7 @@ User is always nil."
3121 (if nosort result (sort result #'string<))))) 3122 (if nosort result (sort result #'string<)))))
3122 3123
3123(defun tramp-handle-directory-files-and-attributes 3124(defun tramp-handle-directory-files-and-attributes
3124 (directory &optional full match nosort id-format) 3125 (directory &optional full match nosort id-format _count)
3125 "Like `directory-files-and-attributes' for Tramp files." 3126 "Like `directory-files-and-attributes' for Tramp files."
3126 (mapcar 3127 (mapcar
3127 (lambda (x) 3128 (lambda (x)
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index cc9ccefb0df..cc65421619d 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2144,20 +2144,14 @@ properly. BODY shall not contain a timeout."
2144 "/method:host:/:/~/path/file")))) 2144 "/method:host:/:/~/path/file"))))
2145 2145
2146;; The following test is inspired by Bug#26911 and Bug#34834. They 2146;; The following test is inspired by Bug#26911 and Bug#34834. They
2147;; are rather bugs in `expand-file-name', and it fails for all Emacs 2147;; were bugs in `expand-file-name'.
2148;; versions prior 28.1. Test added for later, when they are fixed.
2149(ert-deftest tramp-test05-expand-file-name-relative () 2148(ert-deftest tramp-test05-expand-file-name-relative ()
2150 "Check `expand-file-name'." 2149 "Check `expand-file-name'."
2151 :expected-result (if (>= emacs-major-version 28) :passed :failed)
2152 (skip-unless (tramp--test-enabled)) 2150 (skip-unless (tramp--test-enabled))
2153 2151 ;; The bugs are fixed in Emacs 28.1.
2154 ;; These are the methods the test doesn't fail. 2152 (skip-unless (tramp--test-emacs28-p))
2155 (when (or (tramp--test-adb-p) (tramp--test-ange-ftp-p) (tramp--test-gvfs-p) 2153 ;; Methods with a share do not expand "/path/..".
2156 (tramp--test-rclone-p) 2154 (skip-unless (not (tramp--test-share-p)))
2157 (tramp-smb-file-name-p tramp-test-temporary-file-directory))
2158 (setf (ert-test-expected-result-type
2159 (ert-get-test 'tramp-test05-expand-file-name-relative))
2160 :passed))
2161 2155
2162 (should 2156 (should
2163 (string-equal 2157 (string-equal
@@ -5517,6 +5511,13 @@ This does not support special file names."
5517 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) 5511 (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
5518 'tramp-sh-file-name-handler)) 5512 'tramp-sh-file-name-handler))
5519 5513
5514(defun tramp--test-share-p ()
5515 "Check, whether the method needs a share."
5516 (and (tramp--test-gvfs-p)
5517 (string-match-p
5518 "^\\(afp\\|davs?\\|smb\\)$"
5519 (file-remote-p tramp-test-temporary-file-directory 'method))))
5520
5520(defun tramp--test-sudoedit-p () 5521(defun tramp--test-sudoedit-p ()
5521 "Check, whether the sudoedit method is used." 5522 "Check, whether the sudoedit method is used."
5522 (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory)) 5523 (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))