Commit 55cdebcf authored by Michael Albinus's avatar Michael Albinus
Browse files

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.
parent 38a86a4c
Pipeline #2071 failed with stage
in 90 minutes and 1 second
......@@ -290,6 +290,14 @@ A nil value for either argument stands for the current time."
(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))
(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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment