emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 33c585e 2/2: Merge branch 'master' of git.savannah.


From: Eli Zaretskii
Subject: [Emacs-diffs] master 33c585e 2/2: Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Date: Sat, 15 Jun 2019 06:16:37 -0400 (EDT)

branch: master
commit 33c585edd4e228ea24f0d3924571c7d950079073
Merge: 2a364d8 e186705
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
---
 lisp/net/tramp-archive.el     | 24 +++++++++++++-----------
 lisp/net/tramp-compat.el      |  8 ++++++++
 lisp/net/tramp.el             |  6 ++++--
 test/lisp/autorevert-tests.el | 20 ++++++++++----------
 test/lisp/net/tramp-tests.el  |  3 ++-
 5 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index e6ae73a..d7f9966 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -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)
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 21a819f..d4380f8 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -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)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 76eb03b..37b06cb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -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))
 
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index f21fb86..37301ff 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -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.
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index b9868ff..c9ae4d8 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]