aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2023-07-03 18:24:11 +0200
committerMichael Albinus2023-07-03 18:24:11 +0200
commitc565a6c62c2fdf79976b002299dfc9346697cb3d (patch)
treed7511d132afa52e9d2969d590a964207bb2fab52 /test
parent0b060faf2e34b24cc550580e2e86ebcb16dc9cdf (diff)
downloademacs-c565a6c62c2fdf79976b002299dfc9346697cb3d.tar.gz
emacs-c565a6c62c2fdf79976b002299dfc9346697cb3d.zip
Add user option remote-file-name-access-timeout
* doc/lispref/files.texi (Testing Accessibility): Add user option remote-file-name-access-timeout. * doc/misc/tramp.texi (Frequently Asked Questions): Explain remote-file-name-access-timeout. * etc/NEWS: Mention 'remote-file-name-access-timeout'. * lisp/files.el (remote-file-name-access-timeout): New defcustom. (remote-file-name-inhibit-auto-save-visited) (remote-file-name-inhibit-locks, remote-file-name-inhibit-cache) (remote-file-name-inhibit-delete-by-moving-to-trash): * lisp/simple.el (remote-file-name-inhibit-auto-save): Add group `tramp'. * lisp/net/tramp.el (with-tramp-timeout, with-tramp-suspended-timers): New defmacros. (tramp-dont-suspend-timers): New defvar. (tramp-handle-access-file): Implement handling of `remote-file-name-access-timeout'. (Bug#64401) (tramp-action-show-and-confirm-message, tramp-process-actions) (with-tramp-locked-connection, tramp-wait-for-regexp) (tramp-read-passwd, tramp-read-passwd-without-cache): Use the macros. * test/lisp/net/tramp-tests.el (remote-file-name-access-timeout): Declare. (tramp-test18-file-attributes): Extend test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 45bcf23f790..869bc63a544 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -81,6 +81,7 @@
81(defvar dired-copy-dereference) 81(defvar dired-copy-dereference)
82 82
83;; Declared in Emacs 30. 83;; Declared in Emacs 30.
84(defvar remote-file-name-access-timeout)
84(defvar remote-file-name-inhibit-delete-by-moving-to-trash) 85(defvar remote-file-name-inhibit-delete-by-moving-to-trash)
85 86
86;; `ert-resource-file' was introduced in Emacs 28.1. 87;; `ert-resource-file' was introduced in Emacs 28.1.
@@ -3654,6 +3655,18 @@ This tests also `access-file', `file-readable-p',
3654 attr) 3655 attr)
3655 (unwind-protect 3656 (unwind-protect
3656 (progn 3657 (progn
3658 (write-region "foo" nil tmp-name1)
3659 ;; `access-file' returns nil in case of success.
3660 (should-not (access-file tmp-name1 "error"))
3661 ;; `access-file' could use a timeout.
3662 (let ((remote-file-name-access-timeout 1))
3663 (cl-letf (((symbol-function #'file-exists-p)
3664 (lambda (_filename) (sleep-for 5))))
3665 (should-error
3666 (access-file tmp-name1 "error")
3667 :type 'file-error)))
3668 (delete-file tmp-name1)
3669
3657 ;; A sticky bit could damage the `file-ownership-preserved-p' test. 3670 ;; A sticky bit could damage the `file-ownership-preserved-p' test.
3658 (when 3671 (when
3659 (and test-file-ownership-preserved-p 3672 (and test-file-ownership-preserved-p