mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-19 04:10:18 -08:00
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.
This commit is contained in:
parent
ac1a2b2160
commit
658952a57a
7 changed files with 23 additions and 18 deletions
|
|
@ -383,7 +383,7 @@ ARGUMENTS to pass to the OPERATION."
|
||||||
file-properties)))
|
file-properties)))
|
||||||
|
|
||||||
(defun tramp-adb-handle-directory-files-and-attributes
|
(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."
|
"Like `directory-files-and-attributes' for Tramp files."
|
||||||
(unless (file-exists-p directory)
|
(unless (file-exists-p directory)
|
||||||
(tramp-error
|
(tramp-error
|
||||||
|
|
|
||||||
|
|
@ -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.
|
;; Add completion functions for AFP, DAV, DAVS, SFTP and SMB methods.
|
||||||
(when tramp-gvfs-enabled
|
(when tramp-gvfs-enabled
|
||||||
;; Suppress D-Bus error messages.
|
;; 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)
|
(zeroconf-init tramp-gvfs-zeroconf-domain)
|
||||||
(if (zeroconf-list-service-types)
|
(if (zeroconf-list-service-types)
|
||||||
(progn
|
(progn
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ file names."
|
||||||
(tramp-rclone-flush-directory-cache v)))
|
(tramp-rclone-flush-directory-cache v)))
|
||||||
|
|
||||||
(defun tramp-rclone-handle-directory-files
|
(defun tramp-rclone-handle-directory-files
|
||||||
(directory &optional full match nosort)
|
(directory &optional full match nosort _count)
|
||||||
"Like `directory-files' for Tramp files."
|
"Like `directory-files' for Tramp files."
|
||||||
(unless (file-exists-p directory)
|
(unless (file-exists-p directory)
|
||||||
(tramp-error
|
(tramp-error
|
||||||
|
|
|
||||||
|
|
@ -1721,7 +1721,7 @@ of."
|
||||||
;; Directory listings.
|
;; Directory listings.
|
||||||
|
|
||||||
(defun tramp-sh-handle-directory-files-and-attributes
|
(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."
|
"Like `directory-files-and-attributes' for Tramp files."
|
||||||
(unless id-format (setq id-format 'integer))
|
(unless id-format (setq id-format 'integer))
|
||||||
(unless (file-exists-p directory)
|
(unless (file-exists-p directory)
|
||||||
|
|
|
||||||
|
|
@ -695,7 +695,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
||||||
v 'file-error "%s `%s'" (match-string 0) filename))))))
|
v 'file-error "%s `%s'" (match-string 0) filename))))))
|
||||||
|
|
||||||
(defun tramp-smb-handle-directory-files
|
(defun tramp-smb-handle-directory-files
|
||||||
(directory &optional full match nosort)
|
(directory &optional full match nosort _count)
|
||||||
"Like `directory-files' for Tramp files."
|
"Like `directory-files' for Tramp files."
|
||||||
(unless (file-exists-p directory)
|
(unless (file-exists-p directory)
|
||||||
(tramp-error
|
(tramp-error
|
||||||
|
|
|
||||||
|
|
@ -3102,7 +3102,8 @@ User is always nil."
|
||||||
(setq directory (substring directory 0 -1)))
|
(setq directory (substring directory 0 -1)))
|
||||||
directory)
|
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."
|
"Like `directory-files' for Tramp files."
|
||||||
(unless (file-exists-p directory)
|
(unless (file-exists-p directory)
|
||||||
(tramp-error
|
(tramp-error
|
||||||
|
|
@ -3121,7 +3122,7 @@ User is always nil."
|
||||||
(if nosort result (sort result #'string<)))))
|
(if nosort result (sort result #'string<)))))
|
||||||
|
|
||||||
(defun tramp-handle-directory-files-and-attributes
|
(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."
|
"Like `directory-files-and-attributes' for Tramp files."
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
|
|
||||||
|
|
@ -2144,20 +2144,14 @@ properly. BODY shall not contain a timeout."
|
||||||
"/method:host:/:/~/path/file"))))
|
"/method:host:/:/~/path/file"))))
|
||||||
|
|
||||||
;; The following test is inspired by Bug#26911 and Bug#34834. They
|
;; 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
|
;; were bugs in `expand-file-name'.
|
||||||
;; versions prior 28.1. Test added for later, when they are fixed.
|
|
||||||
(ert-deftest tramp-test05-expand-file-name-relative ()
|
(ert-deftest tramp-test05-expand-file-name-relative ()
|
||||||
"Check `expand-file-name'."
|
"Check `expand-file-name'."
|
||||||
:expected-result (if (>= emacs-major-version 28) :passed :failed)
|
|
||||||
(skip-unless (tramp--test-enabled))
|
(skip-unless (tramp--test-enabled))
|
||||||
|
;; The bugs are fixed in Emacs 28.1.
|
||||||
;; These are the methods the test doesn't fail.
|
(skip-unless (tramp--test-emacs28-p))
|
||||||
(when (or (tramp--test-adb-p) (tramp--test-ange-ftp-p) (tramp--test-gvfs-p)
|
;; Methods with a share do not expand "/path/..".
|
||||||
(tramp--test-rclone-p)
|
(skip-unless (not (tramp--test-share-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))
|
|
||||||
|
|
||||||
(should
|
(should
|
||||||
(string-equal
|
(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-find-foreign-file-name-handler tramp-test-temporary-file-directory)
|
||||||
'tramp-sh-file-name-handler))
|
'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 ()
|
(defun tramp--test-sudoedit-p ()
|
||||||
"Check, whether the sudoedit method is used."
|
"Check, whether the sudoedit method is used."
|
||||||
(tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))
|
(tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue