diff options
| author | Lars Hansen | 2006-11-24 19:14:46 +0000 |
|---|---|---|
| committer | Lars Hansen | 2006-11-24 19:14:46 +0000 |
| commit | 6b2633cced4610dc2697ca5b2e7fa918a2b315ea (patch) | |
| tree | 112e9c684a041cca350f29694616b7a6588b23aa | |
| parent | 3559aa8b6bb7848a1a48ca4fbaff6f848e9dbea7 (diff) | |
| download | emacs-6b2633cced4610dc2697ca5b2e7fa918a2b315ea.tar.gz emacs-6b2633cced4610dc2697ca5b2e7fa918a2b315ea.zip | |
(tramp-default-method): Under Windows, change from plink to pscp.
(tramp-copy-failed-regexp, tramp-action-copy-failed): Add.
(tramp-actions-copy-out-of-band): Add pair (tramp-copy-failed-regexp tramp-action-copy-failed).
(tramp-action-out-of-band): Move "Permission denied" handling to tramp-action-copy-failed.
(tramp-do-copy-or-rename-file-out-of-band): unwind-protect killing of process buffer.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 37 |
2 files changed, 37 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5f0c9aa9bb..9a4c4001f29 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2006-11-24 Lars Hansen <larsh@soem.dk> | ||
| 2 | * net/tramp.el (tramp-default-method): Under Windows, change from | ||
| 3 | plink to pscp. | ||
| 4 | (tramp-copy-failed-regexp, tramp-action-copy-failed): Add. | ||
| 5 | (tramp-actions-copy-out-of-band): Add pair (tramp-copy-failed-regexp | ||
| 6 | tramp-action-copy-failed). | ||
| 7 | (tramp-action-out-of-band): Move "Permission denied" handling to | ||
| 8 | tramp-action-copy-failed. | ||
| 9 | (tramp-do-copy-or-rename-file-out-of-band): unwind-protect killing of | ||
| 10 | process buffer. | ||
| 11 | |||
| 1 | 2006-11-24 Stefan Monnier <monnier@iro.umontreal.ca> | 12 | 2006-11-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 13 | ||
| 3 | * pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of | 14 | * pgg-pgp.el (pgg-pgp-process-region): Change `args' from a list of |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3c6733e6dfa..1ee7ca03dc5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -673,8 +673,8 @@ various functions for details." | |||
| 673 | 673 | ||
| 674 | (defcustom tramp-default-method | 674 | (defcustom tramp-default-method |
| 675 | (if (and (fboundp 'executable-find) | 675 | (if (and (fboundp 'executable-find) |
| 676 | (executable-find "plink")) | 676 | (executable-find "pscp")) |
| 677 | "plink" | 677 | "pscp" |
| 678 | "scp") | 678 | "scp") |
| 679 | "*Default method to use for transferring files. | 679 | "*Default method to use for transferring files. |
| 680 | See `tramp-methods' for possibilities. | 680 | See `tramp-methods' for possibilities. |
| @@ -943,6 +943,17 @@ be ignored safely." | |||
| 943 | :group 'tramp | 943 | :group 'tramp |
| 944 | :type 'regexp) | 944 | :type 'regexp) |
| 945 | 945 | ||
| 946 | (defcustom tramp-copy-failed-regexp | ||
| 947 | (concat "\\(.+: " | ||
| 948 | (regexp-opt '("Permission denied" | ||
| 949 | "not a regular file" | ||
| 950 | "is a directory" | ||
| 951 | "No such file or directory") t) | ||
| 952 | "\\)\\s-*") | ||
| 953 | "Regular expression matching copy problems in (s)cp operations." | ||
| 954 | :group 'tramp | ||
| 955 | :type 'regexp) | ||
| 956 | |||
| 946 | (defcustom tramp-process-alive-regexp | 957 | (defcustom tramp-process-alive-regexp |
| 947 | "" | 958 | "" |
| 948 | "Regular expression indicating a process has finished. | 959 | "Regular expression indicating a process has finished. |
| @@ -1340,6 +1351,7 @@ corresponding PATTERN matches, the ACTION function is called." | |||
| 1340 | (defcustom tramp-actions-copy-out-of-band | 1351 | (defcustom tramp-actions-copy-out-of-band |
| 1341 | '((tramp-password-prompt-regexp tramp-action-password) | 1352 | '((tramp-password-prompt-regexp tramp-action-password) |
| 1342 | (tramp-wrong-passwd-regexp tramp-action-permission-denied) | 1353 | (tramp-wrong-passwd-regexp tramp-action-permission-denied) |
| 1354 | (tramp-copy-failed-regexp tramp-action-copy-failed) | ||
| 1343 | (tramp-process-alive-regexp tramp-action-out-of-band)) | 1355 | (tramp-process-alive-regexp tramp-action-out-of-band)) |
| 1344 | "List of pattern/action pairs. | 1356 | "List of pattern/action pairs. |
| 1345 | This list is used for copying/renaming with out-of-band methods. | 1357 | This list is used for copying/renaming with out-of-band methods. |
| @@ -3174,12 +3186,13 @@ be a local filename. The method used must be an out-of-band method." | |||
| 3174 | (message "Transferring %s to %s..." filename newname) | 3186 | (message "Transferring %s to %s..." filename newname) |
| 3175 | 3187 | ||
| 3176 | ;; Use rcp-like program for file transfer. | 3188 | ;; Use rcp-like program for file transfer. |
| 3177 | (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf | 3189 | (unwind-protect |
| 3178 | copy-program copy-args))) | 3190 | (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf |
| 3179 | (tramp-set-process-query-on-exit-flag p nil) | 3191 | copy-program copy-args))) |
| 3180 | (tramp-process-actions p multi-method method user host | 3192 | (tramp-set-process-query-on-exit-flag p nil) |
| 3181 | tramp-actions-copy-out-of-band)) | 3193 | (tramp-process-actions p multi-method method user host |
| 3182 | (kill-buffer trampbuf) | 3194 | tramp-actions-copy-out-of-band)) |
| 3195 | (kill-buffer trampbuf)) | ||
| 3183 | (message "Transferring %s to %s...done" filename newname) | 3196 | (message "Transferring %s to %s...done" filename newname) |
| 3184 | 3197 | ||
| 3185 | ;; Set the mode. | 3198 | ;; Set the mode. |
| @@ -5353,6 +5366,11 @@ Returns nil if none was found, else the command is returned." | |||
| 5353 | (kill-process p) | 5366 | (kill-process p) |
| 5354 | (throw 'tramp-action 'permission-denied)) | 5367 | (throw 'tramp-action 'permission-denied)) |
| 5355 | 5368 | ||
| 5369 | (defun tramp-action-copy-failed (p multi-method method user host) | ||
| 5370 | "Signal copy failed." | ||
| 5371 | (kill-process p) | ||
| 5372 | (error "%s" (match-string 1))) | ||
| 5373 | |||
| 5356 | (defun tramp-action-yesno (p multi-method method user host) | 5374 | (defun tramp-action-yesno (p multi-method method user host) |
| 5357 | "Ask the user for confirmation using `yes-or-no-p'. | 5375 | "Ask the user for confirmation using `yes-or-no-p'. |
| 5358 | Send \"yes\" to remote process on confirmation, abort otherwise. | 5376 | Send \"yes\" to remote process on confirmation, abort otherwise. |
| @@ -5409,9 +5427,6 @@ The terminal type can be configured with `tramp-terminal-type'." | |||
| 5409 | (tramp-message 10 "'set mode' error ignored.") | 5427 | (tramp-message 10 "'set mode' error ignored.") |
| 5410 | (tramp-message 9 "Process has finished.") | 5428 | (tramp-message 9 "Process has finished.") |
| 5411 | (throw 'tramp-action 'ok)) | 5429 | (throw 'tramp-action 'ok)) |
| 5412 | (goto-char (point-min)) | ||
| 5413 | (when (re-search-forward "^.cp.?: \\(.+: Permission denied.?\\)$" nil t) | ||
| 5414 | (error "Remote host: %s" (match-string 1))) | ||
| 5415 | (tramp-message 9 "Process has died.") | 5430 | (tramp-message 9 "Process has died.") |
| 5416 | (throw 'tramp-action 'process-died))) | 5431 | (throw 'tramp-action 'process-died))) |
| 5417 | (t nil))) | 5432 | (t nil))) |