]> git.eshelyaron.com Git - emacs.git/commitdiff
Some minor changes to Tramp, do not merge with master
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 11 Nov 2020 12:24:50 +0000 (13:24 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 11 Nov 2020 12:24:50 +0000 (13:24 +0100)
* 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.

lisp/net/tramp-adb.el
lisp/net/tramp-gvfs.el
lisp/net/tramp-rclone.el
lisp/net/tramp-sh.el
lisp/net/tramp-smb.el
lisp/net/tramp.el
test/lisp/net/tramp-tests.el

index 0efe055b084c2ec902ce4868c85cbc3b089a090a..2f20c8d93e5ca03a2cd2754eef517ce69bd79451 100644 (file)
@@ -383,7 +383,7 @@ ARGUMENTS to pass to the OPERATION."
       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
index ddb535fea6eecb7a477b2a768c66188a38d6ad5b..e369061664aead8a465c8a0a59f6113f711268b9 100644 (file)
@@ -2091,7 +2091,10 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
 ;; 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
index fcbd2010a2666b99db1194d352a2f9c15741cba2..1567a24e272af3baeb71a593c1b2618784025aba 100644 (file)
@@ -300,7 +300,7 @@ file names."
     (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
index df6720b99b7e9709dedb40305bb09f0ef52ac81f..4dca040aebb238a15691acc0f65ddb7666ded590 100644 (file)
@@ -1721,7 +1721,7 @@ of."
 ;; 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)
index 902fcf4b6e3e12d916fca9233e6ab4adb4027ae9..b76308ac4419b082972865350d0640294c526f6e 100644 (file)
@@ -695,7 +695,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
           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
index e7432f2aa092d0915ff67480fcb9b8275ea92c18..08bc0ffdd7db43c94bfe81a797c0fa2738360863 100644 (file)
@@ -3102,7 +3102,8 @@ User is always nil."
     (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
@@ -3121,7 +3122,7 @@ User is always nil."
       (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)
index cc9ccefb0df518e4361bff777233492899c23a33..cc65421619d962838417f5cd8d0fc639bdd89253 100644 (file)
@@ -2144,20 +2144,14 @@ properly.  BODY shall not contain a timeout."
       "/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
@@ -5517,6 +5511,13 @@ This does not support special file names."
    (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))