Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
This commit is contained in:
commit
33c585edd4
5 changed files with 37 additions and 24 deletions
|
@ -475,17 +475,19 @@ name is kept in slot `hop'"
|
|||
|
||||
(defun tramp-archive-cleanup-hash ()
|
||||
"Remove local copies of archives, used by GVFS."
|
||||
(maphash
|
||||
(lambda (key value)
|
||||
;; Unmount local copy.
|
||||
(ignore-errors
|
||||
(tramp-message (car value) 3 "Unmounting %s" (or (cdr value) key))
|
||||
(tramp-gvfs-unmount (car value)))
|
||||
;; Delete local copy.
|
||||
(ignore-errors (delete-file (cdr value)))
|
||||
(remhash key tramp-archive-hash))
|
||||
tramp-archive-hash)
|
||||
(clrhash tramp-archive-hash))
|
||||
;; Don't check for a proper method.
|
||||
(let ((non-essential t))
|
||||
(maphash
|
||||
(lambda (key value)
|
||||
;; Unmount local copy.
|
||||
(ignore-errors
|
||||
(tramp-message (car value) 3 "Unmounting %s" (or (cdr value) key))
|
||||
(tramp-gvfs-unmount (car value)))
|
||||
;; Delete local copy.
|
||||
(ignore-errors (delete-file (cdr value)))
|
||||
(remhash key tramp-archive-hash))
|
||||
tramp-archive-hash)
|
||||
(clrhash tramp-archive-hash)))
|
||||
|
||||
(add-hook 'tramp-cleanup-all-connections-hook #'tramp-archive-cleanup-hash)
|
||||
(add-hook 'kill-emacs-hook #'tramp-archive-cleanup-hash)
|
||||
|
|
|
@ -290,6 +290,14 @@ A nil value for either argument stands for the current time."
|
|||
tree))
|
||||
(nreverse elems)))))
|
||||
|
||||
;; `progress-reporter-update' got argument SUFFIX in Emacs 27.1.
|
||||
(defalias 'tramp-compat-progress-reporter-update
|
||||
(if (equal (tramp-compat-funcall 'func-arity #'progress-reporter-update)
|
||||
'(1 . 3))
|
||||
#'progress-reporter-update
|
||||
(lambda (reporter &optional value _suffix)
|
||||
(progress-reporter-update reporter value))))
|
||||
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda ()
|
||||
(unload-feature 'tramp-loaddefs 'force)
|
||||
|
|
|
@ -1928,12 +1928,12 @@ If VAR is nil, then we bind `v' to the structure and `method', `user',
|
|||
(put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body))
|
||||
(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>"))
|
||||
|
||||
(defun tramp-progress-reporter-update (reporter &optional value)
|
||||
(defun tramp-progress-reporter-update (reporter &optional value suffix)
|
||||
"Report progress of an operation for Tramp."
|
||||
(let* ((parameters (cdr reporter))
|
||||
(message (aref parameters 3)))
|
||||
(when (string-match-p message (or (current-message) ""))
|
||||
(progress-reporter-update reporter value))))
|
||||
(tramp-compat-progress-reporter-update reporter value suffix))))
|
||||
|
||||
(defmacro with-tramp-progress-reporter (vec level message &rest body)
|
||||
"Executes BODY, spinning a progress reporter with MESSAGE.
|
||||
|
@ -3865,6 +3865,8 @@ of."
|
|||
;; The descriptor must be a process object.
|
||||
(unless (processp proc)
|
||||
(tramp-error proc 'file-notify-error "Not a valid descriptor %S" proc))
|
||||
;; There might be pending output.
|
||||
(while (tramp-accept-process-output proc 0))
|
||||
(tramp-message proc 6 "Kill %S" proc)
|
||||
(delete-process proc))
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
tramp-verbose 0
|
||||
tramp-message-show-message nil)
|
||||
|
||||
(defconst auto-revert--timeout 10
|
||||
(defconst auto-revert--timeout (1+ auto-revert-interval)
|
||||
"Time to wait for a message.")
|
||||
|
||||
(defvar auto-revert--messages nil
|
||||
|
@ -140,7 +140,7 @@ This expects `auto-revert--messages' to be bound by
|
|||
(declare (indent 1))
|
||||
`(ert-deftest ,(intern (concat (symbol-name test) "-remote")) ()
|
||||
,docstring
|
||||
:tags '(:expensive-test)
|
||||
:tags '(:expensive-test :unstable)
|
||||
(let ((temporary-file-directory
|
||||
auto-revert-test-remote-temporary-file-directory)
|
||||
(auto-revert-remote-files t)
|
||||
|
@ -471,7 +471,7 @@ This expects `auto-revert--messages' to be bound by
|
|||
(file-2 (make-temp-file "global-auto-revert-test-2"))
|
||||
(file-3 (make-temp-file "global-auto-revert-test-3"))
|
||||
(file-2b (concat file-2 "-b"))
|
||||
buf-1 buf-2 buf-3)
|
||||
require-final-newline buf-1 buf-2 buf-3)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(setq buf-1 (find-file-noselect file-1))
|
||||
|
@ -503,7 +503,7 @@ This expects `auto-revert--messages' to be bound by
|
|||
(auto-revert-test--wait-for
|
||||
(lambda () (buffer-local-value
|
||||
'auto-revert-notify-watch-descriptor buf-3))
|
||||
(+ auto-revert-interval 1))
|
||||
auto-revert--timeout)
|
||||
(should (buffer-local-value
|
||||
'auto-revert-notify-watch-descriptor buf-3))
|
||||
(auto-revert-test--write-file "3-a" file-3)
|
||||
|
@ -515,8 +515,8 @@ This expects `auto-revert--messages' to be bound by
|
|||
(sleep-for 0.5)
|
||||
(should (equal (auto-revert-test--buffer-string buf-1) "1-a"))
|
||||
(auto-revert-test--write-file "1-b" file-1)
|
||||
(auto-revert-test--wait-for-buffer-text buf-1 "1-b"
|
||||
(+ auto-revert-interval 1))
|
||||
(auto-revert-test--wait-for-buffer-text
|
||||
buf-1 "1-b" auto-revert--timeout)
|
||||
(should (buffer-local-value
|
||||
'auto-revert-notify-watch-descriptor buf-1))
|
||||
|
||||
|
@ -525,8 +525,8 @@ This expects `auto-revert--messages' to be bound by
|
|||
(write-file file-2b))
|
||||
(should (equal (auto-revert-test--buffer-string buf-2) "2-a"))
|
||||
(auto-revert-test--write-file "2-b" file-2b)
|
||||
(auto-revert-test--wait-for-buffer-text buf-2 "2-b"
|
||||
(+ auto-revert-interval 1))
|
||||
(auto-revert-test--wait-for-buffer-text
|
||||
buf-2 "2-b" auto-revert--timeout)
|
||||
(should (buffer-local-value
|
||||
'auto-revert-notify-watch-descriptor buf-2)))
|
||||
|
||||
|
@ -550,7 +550,7 @@ This expects `auto-revert--messages' to be bound by
|
|||
(let* ((auto-revert-use-notify t)
|
||||
(file-1 (make-temp-file "auto-revert-test"))
|
||||
(file-2 (concat file-1 "-2"))
|
||||
(buf nil))
|
||||
require-final-newline buf)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(setq buf (find-file-noselect file-1))
|
||||
|
@ -565,7 +565,7 @@ This expects `auto-revert--messages' to be bound by
|
|||
|
||||
(auto-revert-test--write-file "C" file-2)
|
||||
(auto-revert-test--wait-for-buffer-text
|
||||
buf "C" (+ auto-revert-interval 1))
|
||||
buf "C" auto-revert--timeout)
|
||||
(should (equal (buffer-string) "C"))))
|
||||
|
||||
;; Clean up.
|
||||
|
|
|
@ -4173,7 +4173,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
|
|||
(should (numberp (process-get proc 'remote-pid)))
|
||||
(should (interrupt-process proc))
|
||||
;; Let the process accept the interrupt.
|
||||
(while (accept-process-output proc nil nil 0))
|
||||
(with-timeout (10 (tramp--test-timeout-handler))
|
||||
(while (accept-process-output proc nil nil 0)))
|
||||
(should-not (process-live-p proc))
|
||||
;; An interrupted process cannot be interrupted, again.
|
||||
(should-error (interrupt-process proc) :type 'error))
|
||||
|
|
Loading…
Add table
Reference in a new issue