diff options
| author | Michael Albinus | 2019-06-15 11:38:13 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-06-15 11:38:13 +0200 |
| commit | 55cdebcf63644dbd8cd53618438b96fe9b70022b (patch) | |
| tree | 6cfad585cda1b30edd81738747d9315754150eb8 | |
| parent | 38a86a4c490348e74ad1c395ad66176f15d1ce20 (diff) | |
| download | emacs-55cdebcf63644dbd8cd53618438b96fe9b70022b.tar.gz emacs-55cdebcf63644dbd8cd53618438b96fe9b70022b.zip | |
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.
| -rw-r--r-- | lisp/net/tramp-compat.el | 8 | ||||
| -rw-r--r-- | 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 21a819f79fd..d4380f8deb3 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." | |||
| 290 | tree)) | 290 | tree)) |
| 291 | (nreverse elems))))) | 291 | (nreverse elems))))) |
| 292 | 292 | ||
| 293 | ;; `progress-reporter-update' got argument SUFFIX in Emacs 27.1. | ||
| 294 | (defalias 'tramp-compat-progress-reporter-update | ||
| 295 | (if (equal (tramp-compat-funcall 'func-arity #'progress-reporter-update) | ||
| 296 | '(1 . 3)) | ||
| 297 | #'progress-reporter-update | ||
| 298 | (lambda (reporter &optional value _suffix) | ||
| 299 | (progress-reporter-update reporter value)))) | ||
| 300 | |||
| 293 | (add-hook 'tramp-unload-hook | 301 | (add-hook 'tramp-unload-hook |
| 294 | (lambda () | 302 | (lambda () |
| 295 | (unload-feature 'tramp-loaddefs 'force) | 303 | (unload-feature 'tramp-loaddefs 'force) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5086ceb9f3b..37b06cbe422 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', | |||
| 1928 | (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) | 1928 | (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) |
| 1929 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")) | 1929 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")) |
| 1930 | 1930 | ||
| 1931 | (defun tramp-progress-reporter-update (reporter &optional value) | 1931 | (defun tramp-progress-reporter-update (reporter &optional value suffix) |
| 1932 | "Report progress of an operation for Tramp." | 1932 | "Report progress of an operation for Tramp." |
| 1933 | (let* ((parameters (cdr reporter)) | 1933 | (let* ((parameters (cdr reporter)) |
| 1934 | (message (aref parameters 3))) | 1934 | (message (aref parameters 3))) |
| 1935 | (when (string-match-p message (or (current-message) "")) | 1935 | (when (string-match-p message (or (current-message) "")) |
| 1936 | (progress-reporter-update reporter value)))) | 1936 | (tramp-compat-progress-reporter-update reporter value suffix)))) |
| 1937 | 1937 | ||
| 1938 | (defmacro with-tramp-progress-reporter (vec level message &rest body) | 1938 | (defmacro with-tramp-progress-reporter (vec level message &rest body) |
| 1939 | "Executes BODY, spinning a progress reporter with MESSAGE. | 1939 | "Executes BODY, spinning a progress reporter with MESSAGE. |