diff options
| author | Michael Albinus | 2010-04-10 17:51:46 +0200 |
|---|---|---|
| committer | Michael Albinus | 2010-04-10 17:51:46 +0200 |
| commit | b6bbb65e3624abc6435c4166f8c073e6b1646f30 (patch) | |
| tree | 9cfbb3e422536632735b2cda9420e70a9150e3ad | |
| parent | 456b348e68af37d700c399a4a645155abe19af3a (diff) | |
| download | emacs-b6bbb65e3624abc6435c4166f8c073e6b1646f30.tar.gz emacs-b6bbb65e3624abc6435c4166f8c073e6b1646f30.zip | |
* net/tramp.el (tramp-do-copy-or-rename-file): Add progress reporter.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1177e458b83..102ae6c37fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2010-04-10 Michael Albinus <michael.albinus@gmx.de> | 1 | 2010-04-10 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 2 | ||
| 3 | * net/tramp.el (tramp-do-copy-or-rename-file): Add progress reporter. | ||
| 4 | |||
| 5 | 2010-04-10 Michael Albinus <michael.albinus@gmx.de> | ||
| 6 | |||
| 3 | Synchronize with Tramp repository. | 7 | Synchronize with Tramp repository. |
| 4 | 8 | ||
| 5 | * net/tramp.el (tramp-completion-function-alist) | 9 | * net/tramp.el (tramp-completion-function-alist) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index dc7c90581f9..c1caeb7d15b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3524,7 +3524,8 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." | |||
| 3524 | (unless (memq op '(copy rename)) | 3524 | (unless (memq op '(copy rename)) |
| 3525 | (error "Unknown operation `%s', must be `copy' or `rename'" op)) | 3525 | (error "Unknown operation `%s', must be `copy' or `rename'" op)) |
| 3526 | (let ((t1 (tramp-tramp-file-p filename)) | 3526 | (let ((t1 (tramp-tramp-file-p filename)) |
| 3527 | (t2 (tramp-tramp-file-p newname))) | 3527 | (t2 (tramp-tramp-file-p newname)) |
| 3528 | pr tm) | ||
| 3528 | 3529 | ||
| 3529 | (when (and (not ok-if-already-exists) (file-exists-p newname)) | 3530 | (when (and (not ok-if-already-exists) (file-exists-p newname)) |
| 3530 | (with-parsed-tramp-file-name (if t1 filename newname) nil | 3531 | (with-parsed-tramp-file-name (if t1 filename newname) nil |
| @@ -3534,7 +3535,16 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." | |||
| 3534 | (with-parsed-tramp-file-name (if t1 filename newname) nil | 3535 | (with-parsed-tramp-file-name (if t1 filename newname) nil |
| 3535 | (tramp-message v 0 "Transferring %s to %s..." filename newname)) | 3536 | (tramp-message v 0 "Transferring %s to %s..." filename newname)) |
| 3536 | 3537 | ||
| 3537 | (prog1 | 3538 | ;; We start a pulsing progress reporter. Introduced in Emacs 24.1. |
| 3539 | (when (> (nth 7 (file-attributes filename)) tramp-copy-size-limit) | ||
| 3540 | (condition-case nil | ||
| 3541 | (setq pr (funcall | ||
| 3542 | 'make-progress-reporter | ||
| 3543 | (format "Transferring %s to %s..." filename newname)) | ||
| 3544 | tm (run-at-time 0 0.1 'progress-reporter-update pr)) | ||
| 3545 | (error nil))) | ||
| 3546 | |||
| 3547 | (unwind-protect | ||
| 3538 | (cond | 3548 | (cond |
| 3539 | ;; Both are Tramp files. | 3549 | ;; Both are Tramp files. |
| 3540 | ((and t1 t2) | 3550 | ((and t1 t2) |
| @@ -3604,6 +3614,8 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." | |||
| 3604 | (tramp-flush-file-property v (file-name-directory localname)) | 3614 | (tramp-flush-file-property v (file-name-directory localname)) |
| 3605 | (tramp-flush-file-property v localname))) | 3615 | (tramp-flush-file-property v localname))) |
| 3606 | 3616 | ||
| 3617 | ;; Stop progress reporter. | ||
| 3618 | (if tm (cancel-timer tm)) | ||
| 3607 | (with-parsed-tramp-file-name (if t1 filename newname) nil | 3619 | (with-parsed-tramp-file-name (if t1 filename newname) nil |
| 3608 | (tramp-message v 0 "Transferring %s to %s...done" filename newname))))) | 3620 | (tramp-message v 0 "Transferring %s to %s...done" filename newname))))) |
| 3609 | 3621 | ||
| @@ -8569,7 +8581,6 @@ Only works for Bourne-like shells." | |||
| 8569 | ;; * Remove unneeded parameters from methods. | 8581 | ;; * Remove unneeded parameters from methods. |
| 8570 | ;; * Make it work for different encodings, and for different file name | 8582 | ;; * Make it work for different encodings, and for different file name |
| 8571 | ;; encodings, too. (Daniel Pittman) | 8583 | ;; encodings, too. (Daniel Pittman) |
| 8572 | ;; * Progress reports while copying files. (Michael Kifer) | ||
| 8573 | ;; * Don't search for perl5 and perl. Instead, only search for perl and | 8584 | ;; * Don't search for perl5 and perl. Instead, only search for perl and |
| 8574 | ;; then look if it's the right version (with `perl -v'). | 8585 | ;; then look if it's the right version (with `perl -v'). |
| 8575 | ;; * When editing a remote CVS controlled file as a different user, VC | 8586 | ;; * When editing a remote CVS controlled file as a different user, VC |