emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 55cdebc: Make Tramp compatible to recent progress-r


From: Michael Albinus
Subject: [Emacs-diffs] master 55cdebc: Make Tramp compatible to recent progress-reporter-update
Date: Sat, 15 Jun 2019 05:38:21 -0400 (EDT)

branch: master
commit 55cdebcf63644dbd8cd53618438b96fe9b70022b
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Make Tramp compatible to recent progress-reporter-update
    
    * lisp/net/tramp-compat.el (tramp-compat-progress-reporter-update):
    New defalias.
    
    * lisp/net/tramp.el (tramp-progress-reporter-update): Add optional SUFFIX.
---
 lisp/net/tramp-compat.el | 8 ++++++++
 lisp/net/tramp.el        | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

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 5086ceb..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.



reply via email to

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