master 1f9a492aeac 1/2: Fix 'with-tramp-progress-reporter' (bug#81455)
Michael Albinus via Mailing list for Emacs changes <[email protected]> Thu, 23 Jul 2026 09:56:20 -0400 (EDT)
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit 1f9a492aeace12c0e49cf8ac3e0b09fb8a82ddb3 Author: Stéphane Marks <[email protected]> Commit: Michael Albinus <[email protected]> Fix 'with-tramp-progress-reporter' (bug#81455) Clear stateful progress reporters like 'system-taskbar'. * lisp/net/tramp.el (with-tramp-progress-reporter): Call 'progress-reporter-done' in 'unwind-protect'. --- lisp/net/tramp.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 41dcffd8b19..b461f8b3cd1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2235,15 +2235,16 @@ without a visible progress reporter." `(if (or noninteractive inhibit-message) (progn ,@body) (tramp-message ,vec ,level "%s..." ,message) - (let ((cookie "failed") - (tm - ;; We start a pulsing progress reporter after 3 seconds. - ;; Start only when there is no other progress reporter - ;; running, and when there is a minimum level. - (when-let* ((pr (and (null tramp-inhibit-progress-reporter) - (<= ,level (min tramp-verbose 3)) - (make-progress-reporter ,message)))) - (run-at-time 3 0.1 #'tramp-progress-reporter-update pr)))) + (let* ((cookie "failed") + (pr (and (null tramp-inhibit-progress-reporter) + (<= ,level (min tramp-verbose 3)) + (make-progress-reporter ,message))) + (tm + ;; We start a pulsing progress reporter after 3 seconds. + ;; Start only when there is no other progress reporter + ;; running, and when there is a minimum level. + (when pr + (run-at-time 3 0.1 #'tramp-progress-reporter-update pr)))) (unwind-protect ;; Execute the body. (prog1 @@ -2253,7 +2254,8 @@ without a visible progress reporter." ,@body) (setq cookie "done")) ;; Stop progress reporter. - (if tm (cancel-timer tm)) + (when tm (cancel-timer tm)) + (when pr (progress-reporter-done pr)) (tramp-message ,vec ,level "%s...%s" ,message cookie))))) (defmacro with-tramp-timeout (list &rest body)