diff options
| author | Michael Albinus | 2005-01-16 13:18:31 +0000 |
|---|---|---|
| committer | Michael Albinus | 2005-01-16 13:18:31 +0000 |
| commit | 01917a18b40405b2cb7eaf279e8db13875c9c5be (patch) | |
| tree | 387f0176ba4ab98141ed1d41ff8fe03dd74577eb | |
| parent | 50af5100a6e0234668d100ca5d4cb3479436b8c0 (diff) | |
| download | emacs-01917a18b40405b2cb7eaf279e8db13875c9c5be.tar.gz emacs-01917a18b40405b2cb7eaf279e8db13875c9c5be.zip | |
Sync with Tramp 2.0.47.
| -rw-r--r-- | lisp/ChangeLog | 46 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 57 | ||||
| -rw-r--r-- | lisp/net/tramp-util.el | 68 | ||||
| -rw-r--r-- | lisp/net/tramp-vc.el | 9 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 88 | ||||
| -rw-r--r-- | lisp/net/trampver.el | 2 | ||||
| -rw-r--r-- | man/ChangeLog | 7 | ||||
| -rw-r--r-- | man/tramp.texi | 32 | ||||
| -rw-r--r-- | man/trampver.texi | 2 |
9 files changed, 233 insertions, 78 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1def811c5c5..d3ee155e0fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,49 @@ | |||
| 1 | 2005-01-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | Sync with Tramp 2.0.47. | ||
| 4 | |||
| 5 | * tramp.el (tramp-operation-not-permitted-regexp) New defcustom, | ||
| 6 | catching keep-date problems in cp/scp operations. | ||
| 7 | (tramp-handle-copy-file): Don't call `set-file-modes' | ||
| 8 | unconditionally. Specialized functions should know better what is | ||
| 9 | necessary. This improves performance a little bit, and the | ||
| 10 | functions could catch errors with `cp -p' and `scp -p'. | ||
| 11 | (tramp-do-copy-or-rename-file-via-buffer) | ||
| 12 | (tramp-do-copy-or-rename-file-out-of-band): Call `set-file-modes' | ||
| 13 | when appropriate. | ||
| 14 | (tramp-do-copy-or-rename-file-directly): Mask `cp -p' error. Call | ||
| 15 | `set-file-modes' when appropriate. | ||
| 16 | (tramp-action-out-of-band): Mask `scp -p' error. Reported by Isak | ||
| 17 | Johnsson <isak@hypergene.com> | ||
| 18 | (tramp-get-buffer, tramp-get-debug-buffer): Discard the undo list | ||
| 19 | of both Tramp buffer and debug buffer. Reported by Joakim Verona | ||
| 20 | <joakim@verona.se> | ||
| 21 | (tramp-file-name-for-operation): Mark `shell-command' as magic for | ||
| 22 | Emacs only. | ||
| 23 | |||
| 24 | * tramp-util.el (tramp-minor-mode): New minor mode. Add it to | ||
| 25 | `find-file-hooks' and `dired-mode-hook'. | ||
| 26 | (tramp-minor-mode-map): Respective map. Add remapping for | ||
| 27 | `compile' and `recompile'. | ||
| 28 | (tramp-remap-command, tramp-recompile): New defuns. | ||
| 29 | (tramp-compile): Enable `tramp-minor-mode' and `compilation-mode' | ||
| 30 | in buffer "*Compilation*". Call the commands asynchronously. | ||
| 31 | |||
| 32 | * tramp-vc.el (tramp-vc-do-command, tramp-vc-do-command-new) | ||
| 33 | (tramp-vc-simple-command): Call `tramp-handle-shell-command' but | ||
| 34 | `shell-command', because it isn't magic in XEmacs. Reported by | ||
| 35 | Adrian Aichner <adrian@xemacs.org>. | ||
| 36 | |||
| 37 | * tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for | ||
| 38 | `substitute-in-file-name. | ||
| 39 | (tramp-smb-handle-substitute-in-file-name): New defun. | ||
| 40 | (tramp-smb-advice-PC-do-completion): Delete advice. | ||
| 41 | |||
| 42 | 2005-01-16 Kai Grossjohann <kgrossjo@eu.uu.net> | ||
| 43 | |||
| 44 | * tramp.el (tramp-wait-for-output): Fix typo in echo processing. | ||
| 45 | Fix error in deleting region. | ||
| 46 | |||
| 1 | 2005-01-15 Richard M. Stallman <rms@gnu.org> | 47 | 2005-01-15 Richard M. Stallman <rms@gnu.org> |
| 2 | 48 | ||
| 3 | * emacs-lisp/lisp-mnt.el (lm-with-file): Use Lisp mode in temp buffer. | 49 | * emacs-lisp/lisp-mnt.el (lm-with-file): Use Lisp mode in temp buffer. |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index d0a7cf7b65f..6fa0433a574 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -172,7 +172,7 @@ This variable is local to each buffer.") | |||
| 172 | (set-file-modes . tramp-smb-not-handled) | 172 | (set-file-modes . tramp-smb-not-handled) |
| 173 | (set-visited-file-modtime . tramp-smb-not-handled) | 173 | (set-visited-file-modtime . tramp-smb-not-handled) |
| 174 | (shell-command . tramp-smb-not-handled) | 174 | (shell-command . tramp-smb-not-handled) |
| 175 | ;; `substitute-in-file-name' performed by default handler | 175 | (substitute-in-file-name . tramp-smb-handle-substitute-in-file-name) |
| 176 | (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) | 176 | (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) |
| 177 | (vc-registered . tramp-smb-not-handled) | 177 | (vc-registered . tramp-smb-not-handled) |
| 178 | (verify-visited-file-modtime . tramp-smb-not-handled) | 178 | (verify-visited-file-modtime . tramp-smb-not-handled) |
| @@ -617,6 +617,13 @@ WILDCARD and FULL-DIRECTORY-P are not handled." | |||
| 617 | 617 | ||
| 618 | (delete-file filename)) | 618 | (delete-file filename)) |
| 619 | 619 | ||
| 620 | (defun tramp-smb-handle-substitute-in-file-name (filename) | ||
| 621 | "Like `handle-substitute-in-file-name' for tramp files. | ||
| 622 | Catches errors for shares like \"C$/\", which are common in Microsoft Windows." | ||
| 623 | (condition-case nil | ||
| 624 | (tramp-run-real-handler 'substitute-in-file-name (list filename)) | ||
| 625 | (error filename))) | ||
| 626 | |||
| 620 | (defun tramp-smb-handle-write-region | 627 | (defun tramp-smb-handle-write-region |
| 621 | (start end filename &optional append visit lockname confirm) | 628 | (start end filename &optional append visit lockname confirm) |
| 622 | "Like `write-region' for tramp files." | 629 | "Like `write-region' for tramp files." |
| @@ -1084,54 +1091,6 @@ Return the difference in the format of a time value." | |||
| 1084 | (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) | 1091 | (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) |
| 1085 | 1092 | ||
| 1086 | 1093 | ||
| 1087 | ;; `PC-do-completion' touches the returning "$$" by `substitute-in-file-name'. | ||
| 1088 | ;; Must be corrected. | ||
| 1089 | |||
| 1090 | (defadvice PC-do-completion (around tramp-smb-advice-PC-do-completion) | ||
| 1091 | "Changes \"$\" back to \"$$\" in minibuffer." | ||
| 1092 | (if (funcall PC-completion-as-file-name-predicate) | ||
| 1093 | |||
| 1094 | (progn | ||
| 1095 | ;; Substitute file names | ||
| 1096 | (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21 | ||
| 1097 | (funcall 'minibuffer-prompt-end)) | ||
| 1098 | (point-min))) | ||
| 1099 | (end (point-max)) | ||
| 1100 | (str (substitute-in-file-name (buffer-substring beg end)))) | ||
| 1101 | (delete-region beg end) | ||
| 1102 | (insert str) | ||
| 1103 | (ad-set-arg 2 (point))) | ||
| 1104 | |||
| 1105 | ;; Do `PC-do-completion' without substitution | ||
| 1106 | (let* (save) | ||
| 1107 | (fset 'save (symbol-function 'substitute-in-file-name)) | ||
| 1108 | (unwind-protect | ||
| 1109 | (progn | ||
| 1110 | (fset 'substitute-in-file-name (symbol-function 'identity)) | ||
| 1111 | ad-do-it) | ||
| 1112 | (fset 'substitute-in-file-name (symbol-function 'save)))) | ||
| 1113 | |||
| 1114 | ;; Expand "$" | ||
| 1115 | (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21 | ||
| 1116 | (funcall 'minibuffer-prompt-end)) | ||
| 1117 | (point-min))) | ||
| 1118 | (end (point-max)) | ||
| 1119 | (str (buffer-substring beg end))) | ||
| 1120 | (delete-region beg end) | ||
| 1121 | (insert (if (string-match "\\(\\$\\)\\(/\\|$\\)" str) | ||
| 1122 | (replace-match "$$" nil nil str 1) | ||
| 1123 | str)))) | ||
| 1124 | |||
| 1125 | ;; No file names. Behave unchanged. | ||
| 1126 | ad-do-it)) | ||
| 1127 | |||
| 1128 | ;; Activate advice. Recent Emacsen don't need that. | ||
| 1129 | (when (functionp 'PC-do-completion) | ||
| 1130 | (condition-case nil | ||
| 1131 | (substitute-in-file-name "C$/") | ||
| 1132 | (error | ||
| 1133 | (ad-activate 'PC-do-completion)))) | ||
| 1134 | |||
| 1135 | (provide 'tramp-smb) | 1094 | (provide 'tramp-smb) |
| 1136 | 1095 | ||
| 1137 | ;;; TODO: | 1096 | ;;; TODO: |
diff --git a/lisp/net/tramp-util.el b/lisp/net/tramp-util.el index 2d828d27c51..1cd7f14dcd6 100644 --- a/lisp/net/tramp-util.el +++ b/lisp/net/tramp-util.el | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | ;;; -*- coding: iso-2022-7bit; -*- | 1 | ;;; -*- coding: iso-2022-7bit; -*- |
| 2 | ;;; tramp-util.el --- Misc utility functions to use with Tramp | 2 | ;;; tramp-util.el --- Misc utility functions to use with Tramp |
| 3 | 3 | ||
| 4 | ;; Copyright (C) 2001 Free Software Foundation, Inc. | 4 | ;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | 6 | ;; Author: kai.grossjohann@gmx.net |
| 7 | ;; Keywords: comm, extensions, processes | 7 | ;; Keywords: comm, extensions, processes |
| 8 | 8 | ||
| 9 | ;; This file is free software; you can redistribute it and/or modify | 9 | ;; This file is free software; you can redistribute it and/or modify |
| @@ -32,6 +32,60 @@ | |||
| 32 | (require 'compile) | 32 | (require 'compile) |
| 33 | (require 'tramp) | 33 | (require 'tramp) |
| 34 | 34 | ||
| 35 | ;; Define a Tramp minor mode. It's intention is to redefine some keys for Tramp | ||
| 36 | ;; specific functions, like compilation. | ||
| 37 | ;; The key remapping works since Emacs 21.4 only. Unknown for XEmacs. | ||
| 38 | |||
| 39 | (when (fboundp 'define-minor-mode) | ||
| 40 | |||
| 41 | (defvar tramp-minor-mode-map (make-sparse-keymap) | ||
| 42 | "Keymap for Tramp minor mode.") | ||
| 43 | |||
| 44 | (define-minor-mode tramp-minor-mode "Tramp minor mode for utility functions." | ||
| 45 | :group 'tramp | ||
| 46 | :global nil | ||
| 47 | :init-value nil | ||
| 48 | :lighter " Tramp" | ||
| 49 | :keymap tramp-minor-mode-map | ||
| 50 | (setq tramp-minor-mode | ||
| 51 | (and tramp-minor-mode (tramp-tramp-file-p default-directory)))) | ||
| 52 | |||
| 53 | (add-hook 'find-file-hooks 'tramp-minor-mode t) | ||
| 54 | (add-hook 'dired-mode-hook 'tramp-minor-mode t) | ||
| 55 | |||
| 56 | (defun tramp-remap-command (old-command new-command) | ||
| 57 | "Replaces bindings of OLD-COMMAND by NEW-COMMAND. | ||
| 58 | If remapping functionality for keymaps is defined, this happens for all | ||
| 59 | bindings. Otherwise, only bindings active during invocation are taken | ||
| 60 | into account. XEmacs menubar bindings are not changed by this." | ||
| 61 | (if (functionp 'command-remapping) | ||
| 62 | ;; Emacs 21.4 | ||
| 63 | (eval | ||
| 64 | `(define-key tramp-minor-mode-map [remap ,old-command] new-command)) | ||
| 65 | ;; previous Emacs 21 versions. | ||
| 66 | (mapcar | ||
| 67 | '(lambda (x) | ||
| 68 | (define-key tramp-minor-mode-map x new-command)) | ||
| 69 | (where-is-internal old-command)))) | ||
| 70 | |||
| 71 | (tramp-remap-command 'compile 'tramp-compile) | ||
| 72 | (tramp-remap-command 'recompile 'tramp-recompile) | ||
| 73 | |||
| 74 | ;; XEmacs has an own mimic for menu entries | ||
| 75 | (when (fboundp 'add-menu-button) | ||
| 76 | (funcall 'add-menu-button | ||
| 77 | '("Tools" "Compile") | ||
| 78 | ["Compile..." | ||
| 79 | (command-execute (if tramp-minor-mode 'tramp-compile 'compile)) | ||
| 80 | :active (fboundp 'compile)]) | ||
| 81 | (funcall 'add-menu-button | ||
| 82 | '("Tools" "Compile") | ||
| 83 | ["Repeat Compilation" | ||
| 84 | (command-execute (if tramp-minor-mode 'tramp-recompile 'recompile)) | ||
| 85 | :active (fboundp 'compile)]))) | ||
| 86 | |||
| 87 | ;; Utility functions. | ||
| 88 | |||
| 35 | (defun tramp-compile (command) | 89 | (defun tramp-compile (command) |
| 36 | "Compile on remote host." | 90 | "Compile on remote host." |
| 37 | (interactive | 91 | (interactive |
| @@ -49,6 +103,16 @@ | |||
| 49 | (setq default-directory d))) | 103 | (setq default-directory d))) |
| 50 | (tramp-handle-shell-command command (get-buffer "*Compilation*")) | 104 | (tramp-handle-shell-command command (get-buffer "*Compilation*")) |
| 51 | (pop-to-buffer (get-buffer "*Compilation*")) | 105 | (pop-to-buffer (get-buffer "*Compilation*")) |
| 106 | (tramp-minor-mode 1) | ||
| 107 | (compilation-minor-mode 1)) | ||
| 108 | |||
| 109 | (defun tramp-recompile () | ||
| 110 | "Re-compile on remote host." | ||
| 111 | (interactive) | ||
| 112 | (save-some-buffers (not compilation-ask-about-save) nil) | ||
| 113 | (tramp-handle-shell-command compile-command (get-buffer "*Compilation*")) | ||
| 114 | (pop-to-buffer (get-buffer "*Compilation*")) | ||
| 115 | (tramp-minor-mode 1) | ||
| 52 | (compilation-minor-mode 1)) | 116 | (compilation-minor-mode 1)) |
| 53 | 117 | ||
| 54 | (provide 'tramp-util) | 118 | (provide 'tramp-util) |
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el index 3cc54eda650..c2a9ae737df 100644 --- a/lisp/net/tramp-vc.el +++ b/lisp/net/tramp-vc.el | |||
| @@ -130,7 +130,8 @@ See `vc-do-command' for more information." | |||
| 130 | (save-excursion | 130 | (save-excursion |
| 131 | (save-window-excursion | 131 | (save-window-excursion |
| 132 | ;; Actually execute remote command | 132 | ;; Actually execute remote command |
| 133 | (shell-command | 133 | ;; `shell-command' cannot be used; it isn't magic in XEmacs. |
| 134 | (tramp-handle-shell-command | ||
| 134 | (mapconcat 'tramp-shell-quote-argument | 135 | (mapconcat 'tramp-shell-quote-argument |
| 135 | (cons command squeezed) " ") t) | 136 | (cons command squeezed) " ") t) |
| 136 | ;;(tramp-wait-for-output) | 137 | ;;(tramp-wait-for-output) |
| @@ -190,7 +191,8 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." | |||
| 190 | (let ((w32-quote-process-args t)) | 191 | (let ((w32-quote-process-args t)) |
| 191 | (when (eq okstatus 'async) | 192 | (when (eq okstatus 'async) |
| 192 | (message "Tramp doesn't do async commands, running synchronously.")) | 193 | (message "Tramp doesn't do async commands, running synchronously.")) |
| 193 | (setq status (shell-command | 194 | ;; `shell-command' cannot be used; it isn't magic in XEmacs. |
| 195 | (setq status (tramp-handle-shell-command | ||
| 194 | (mapconcat 'tramp-shell-quote-argument | 196 | (mapconcat 'tramp-shell-quote-argument |
| 195 | (cons command squeezed) " ") t)) | 197 | (cons command squeezed) " ") t)) |
| 196 | (when (or (not (integerp status)) | 198 | (when (or (not (integerp status)) |
| @@ -285,7 +287,8 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." | |||
| 285 | (save-excursion | 287 | (save-excursion |
| 286 | (save-window-excursion | 288 | (save-window-excursion |
| 287 | ;; Actually execute remote command | 289 | ;; Actually execute remote command |
| 288 | (shell-command | 290 | ;; `shell-command' cannot be used; it isn't magic in XEmacs. |
| 291 | (tramp-handle-shell-command | ||
| 289 | (mapconcat 'tramp-shell-quote-argument | 292 | (mapconcat 'tramp-shell-quote-argument |
| 290 | (append (list command) args (list localname)) " ") | 293 | (append (list command) args (list localname)) " ") |
| 291 | (get-buffer-create"*vc-info*")) | 294 | (get-buffer-create"*vc-info*")) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 34572e98674..90bc30744c7 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*- | 1 | ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*- |
| 2 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol | 2 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
| 3 | 3 | ||
| 4 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | 4 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: kai.grossjohann@gmx.net | 6 | ;; Author: kai.grossjohann@gmx.net |
| 7 | ;; Keywords: comm, processes | 7 | ;; Keywords: comm, processes |
| @@ -912,6 +912,15 @@ The answer will be provided by `tramp-action-terminal', which see." | |||
| 912 | :group 'tramp | 912 | :group 'tramp |
| 913 | :type 'regexp) | 913 | :type 'regexp) |
| 914 | 914 | ||
| 915 | (defcustom tramp-operation-not-permitted-regexp | ||
| 916 | (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" | ||
| 917 | (regexp-opt '("Operation not permitted") t)) | ||
| 918 | "Regular expression matching keep-date problems in (s)cp operations. | ||
| 919 | Copying has been performed successfully already, so this message can | ||
| 920 | be ignored safely." | ||
| 921 | :group 'tramp | ||
| 922 | :type 'regexp) | ||
| 923 | |||
| 915 | (defcustom tramp-process-alive-regexp | 924 | (defcustom tramp-process-alive-regexp |
| 916 | "" | 925 | "" |
| 917 | "Regular expression indicating a process has finished. | 926 | "Regular expression indicating a process has finished. |
| @@ -2500,7 +2509,7 @@ if the remote host can't provide the modtime." | |||
| 2500 | (fa2 (file-attributes file2))) | 2509 | (fa2 (file-attributes file2))) |
| 2501 | (if (and (not (equal (nth 5 fa1) '(0 0))) | 2510 | (if (and (not (equal (nth 5 fa1) '(0 0))) |
| 2502 | (not (equal (nth 5 fa2) '(0 0)))) | 2511 | (not (equal (nth 5 fa2) '(0 0)))) |
| 2503 | (< 0 (tramp-time-diff (nth 5 fa1) (nth 5 fa2))) | 2512 | (> 0 (tramp-time-diff (nth 5 fa2) (nth 5 fa1))) |
| 2504 | ;; If one of them is the dont-know value, then we can | 2513 | ;; If one of them is the dont-know value, then we can |
| 2505 | ;; still try to run a shell command on the remote host. | 2514 | ;; still try to run a shell command on the remote host. |
| 2506 | ;; However, this only works if both files are Tramp | 2515 | ;; However, this only works if both files are Tramp |
| @@ -2822,10 +2831,8 @@ if the remote host can't provide the modtime." | |||
| 2822 | ;; At least one file a tramp file? | 2831 | ;; At least one file a tramp file? |
| 2823 | (if (or (tramp-tramp-file-p filename) | 2832 | (if (or (tramp-tramp-file-p filename) |
| 2824 | (tramp-tramp-file-p newname)) | 2833 | (tramp-tramp-file-p newname)) |
| 2825 | (let ((modes (file-modes filename))) | 2834 | (tramp-do-copy-or-rename-file |
| 2826 | (tramp-do-copy-or-rename-file | 2835 | 'copy filename newname ok-if-already-exists keep-date) |
| 2827 | 'copy filename newname ok-if-already-exists keep-date) | ||
| 2828 | (set-file-modes newname modes)) | ||
| 2829 | (tramp-run-real-handler | 2836 | (tramp-run-real-handler |
| 2830 | 'copy-file | 2837 | 'copy-file |
| 2831 | (list filename newname ok-if-already-exists keep-date)))) | 2838 | (list filename newname ok-if-already-exists keep-date)))) |
| @@ -2973,8 +2980,9 @@ KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." | |||
| 2973 | (when keep-date | 2980 | (when keep-date |
| 2974 | (when (and (not (null modtime)) | 2981 | (when (and (not (null modtime)) |
| 2975 | (not (equal modtime '(0 0)))) | 2982 | (not (equal modtime '(0 0)))) |
| 2976 | (tramp-touch newname modtime)) | 2983 | (tramp-touch newname modtime))) |
| 2977 | (set-file-modes newname (file-modes filename)))) | 2984 | ;; Set the mode. |
| 2985 | (set-file-modes newname (file-modes filename))) | ||
| 2978 | ;; If the operation was `rename', delete the original file. | 2986 | ;; If the operation was `rename', delete the original file. |
| 2979 | (unless (eq op 'copy) | 2987 | (unless (eq op 'copy) |
| 2980 | (delete-file filename)))) | 2988 | (delete-file filename)))) |
| @@ -2994,15 +3002,34 @@ If KEEP-DATE is non-nil, preserve the time stamp when copying." | |||
| 2994 | "Unknown operation `%s', must be `copy' or `rename'" | 3002 | "Unknown operation `%s', must be `copy' or `rename'" |
| 2995 | op))))) | 3003 | op))))) |
| 2996 | (save-excursion | 3004 | (save-excursion |
| 2997 | (tramp-barf-unless-okay | 3005 | (tramp-send-command |
| 2998 | multi-method method user host | 3006 | multi-method method user host |
| 2999 | (format "%s %s %s" | 3007 | (format "%s %s %s" |
| 3000 | cmd | 3008 | cmd |
| 3001 | (tramp-shell-quote-argument localname1) | 3009 | (tramp-shell-quote-argument localname1) |
| 3002 | (tramp-shell-quote-argument localname2)) | 3010 | (tramp-shell-quote-argument localname2))) |
| 3003 | nil 'file-error | 3011 | (tramp-wait-for-output) |
| 3004 | "Copying directly failed, see buffer `%s' for details." | 3012 | (goto-char (point-min)) |
| 3005 | (buffer-name))))) | 3013 | (unless |
| 3014 | (or | ||
| 3015 | (and (eq op 'copy) keep-date | ||
| 3016 | ;; Mask cp -f error. | ||
| 3017 | (re-search-forward tramp-operation-not-permitted-regexp nil t)) | ||
| 3018 | (zerop (tramp-send-command-and-check | ||
| 3019 | multi-method method user host nil nil))) | ||
| 3020 | (pop-to-buffer (current-buffer)) | ||
| 3021 | (signal 'file-error | ||
| 3022 | (format "Copying directly failed, see buffer `%s' for details." | ||
| 3023 | (buffer-name))))) | ||
| 3024 | ;; Set the mode. | ||
| 3025 | ;; CCC: Maybe `chmod --reference=localname1 localname2' could be used | ||
| 3026 | ;; where available? | ||
| 3027 | (unless (or (eq op 'rename) keep-date) | ||
| 3028 | (set-file-modes | ||
| 3029 | (tramp-make-tramp-file-name multi-method method user host localname2) | ||
| 3030 | (file-modes | ||
| 3031 | (tramp-make-tramp-file-name | ||
| 3032 | multi-method method user host localname1)))))) | ||
| 3006 | 3033 | ||
| 3007 | (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date) | 3034 | (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date) |
| 3008 | "Invoke rcp program to copy. | 3035 | "Invoke rcp program to copy. |
| @@ -3122,7 +3149,11 @@ be a local filename. The method used must be an out-of-band method." | |||
| 3122 | tramp-actions-copy-out-of-band)) | 3149 | tramp-actions-copy-out-of-band)) |
| 3123 | (kill-buffer trampbuf) | 3150 | (kill-buffer trampbuf) |
| 3124 | (tramp-message | 3151 | (tramp-message |
| 3125 | 5 "Transferring %s to file %s...done" filename newname)) | 3152 | 5 "Transferring %s to file %s...done" filename newname) |
| 3153 | |||
| 3154 | ;; Set the mode. | ||
| 3155 | (unless keep-date | ||
| 3156 | (set-file-modes newname (file-modes filename)))) | ||
| 3126 | 3157 | ||
| 3127 | ;; If the operation was `rename', delete the original file. | 3158 | ;; If the operation was `rename', delete the original file. |
| 3128 | (unless (eq op 'copy) | 3159 | (unless (eq op 'copy) |
| @@ -4074,7 +4105,9 @@ ARGS are the arguments OPERATION has been called with." | |||
| 4074 | (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) | 4105 | (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) |
| 4075 | ; COMMAND | 4106 | ; COMMAND |
| 4076 | ((member operation | 4107 | ((member operation |
| 4077 | (list 'dired-call-process 'shell-command | 4108 | (list 'dired-call-process-command |
| 4109 | ; Emacs only | ||
| 4110 | 'shell | ||
| 4078 | ; Post Emacs 21.3 only | 4111 | ; Post Emacs 21.3 only |
| 4079 | 'process-file | 4112 | 'process-file |
| 4080 | ; XEmacs only | 4113 | ; XEmacs only |
| @@ -4908,7 +4941,10 @@ USER the array of user names, HOST the array of host names." | |||
| 4908 | 4941 | ||
| 4909 | (defun tramp-get-buffer (multi-method method user host) | 4942 | (defun tramp-get-buffer (multi-method method user host) |
| 4910 | "Get the connection buffer to be used for USER at HOST using METHOD." | 4943 | "Get the connection buffer to be used for USER at HOST using METHOD." |
| 4911 | (get-buffer-create (tramp-buffer-name multi-method method user host))) | 4944 | (with-current-buffer |
| 4945 | (get-buffer-create (tramp-buffer-name multi-method method user host)) | ||
| 4946 | (setq buffer-undo-list t) | ||
| 4947 | (current-buffer))) | ||
| 4912 | 4948 | ||
| 4913 | (defun tramp-debug-buffer-name (multi-method method user host) | 4949 | (defun tramp-debug-buffer-name (multi-method method user host) |
| 4914 | "A name for the debug buffer for USER at HOST using METHOD." | 4950 | "A name for the debug buffer for USER at HOST using METHOD." |
| @@ -4922,7 +4958,11 @@ USER the array of user names, HOST the array of host names." | |||
| 4922 | 4958 | ||
| 4923 | (defun tramp-get-debug-buffer (multi-method method user host) | 4959 | (defun tramp-get-debug-buffer (multi-method method user host) |
| 4924 | "Get the debug buffer for USER at HOST using METHOD." | 4960 | "Get the debug buffer for USER at HOST using METHOD." |
| 4925 | (get-buffer-create (tramp-debug-buffer-name multi-method method user host))) | 4961 | (with-current-buffer |
| 4962 | (get-buffer-create | ||
| 4963 | (tramp-debug-buffer-name multi-method method user host)) | ||
| 4964 | (setq buffer-undo-list t) | ||
| 4965 | (current-buffer))) | ||
| 4926 | 4966 | ||
| 4927 | (defun tramp-find-executable (multi-method method user host | 4967 | (defun tramp-find-executable (multi-method method user host |
| 4928 | progname dirlist ignore-tilde) | 4968 | progname dirlist ignore-tilde) |
| @@ -5214,8 +5254,16 @@ The terminal type can be configured with `tramp-terminal-type'." | |||
| 5214 | ((or (and (memq (process-status p) '(stop exit)) | 5254 | ((or (and (memq (process-status p) '(stop exit)) |
| 5215 | (not (zerop (process-exit-status p)))) | 5255 | (not (zerop (process-exit-status p)))) |
| 5216 | (memq (process-status p) '(signal))) | 5256 | (memq (process-status p) '(signal))) |
| 5217 | (tramp-message 9 "Process has died.") | 5257 | ;; `scp' could have copied correctly, but set modes could have failed. |
| 5218 | (throw 'tramp-action 'process-died)) | 5258 | ;; This can be ignored. |
| 5259 | (goto-char (point-min)) | ||
| 5260 | (if (re-search-forward tramp-operation-not-permitted-regexp nil t) | ||
| 5261 | (progn | ||
| 5262 | (tramp-message 10 "'set mode' error ignored.") | ||
| 5263 | (tramp-message 9 "Process has finished.") | ||
| 5264 | (throw 'tramp-action 'ok)) | ||
| 5265 | (tramp-message 9 "Process has died.") | ||
| 5266 | (throw 'tramp-action 'process-died))) | ||
| 5219 | (t nil))) | 5267 | (t nil))) |
| 5220 | 5268 | ||
| 5221 | ;; The following functions are specifically for multi connections. | 5269 | ;; The following functions are specifically for multi connections. |
| @@ -6336,7 +6384,7 @@ Sends COMMAND, then waits 30 seconds for shell prompt." | |||
| 6336 | (save-excursion | 6384 | (save-excursion |
| 6337 | (goto-char start-point) | 6385 | (goto-char start-point) |
| 6338 | (when (looking-at (regexp-quote tramp-last-cmd)) | 6386 | (when (looking-at (regexp-quote tramp-last-cmd)) |
| 6339 | (delete-region (point) (forward-line 1))))) | 6387 | (delete-region (point) (progn (forward-line 1) (point)))))) |
| 6340 | ;; Add output to debug buffer if appropriate. | 6388 | ;; Add output to debug buffer if appropriate. |
| 6341 | (when tramp-debug-buffer | 6389 | (when tramp-debug-buffer |
| 6342 | (append-to-buffer | 6390 | (append-to-buffer |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 866d6e5647d..a4aced24257 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run | 30 | ;; are auto-frobbed from configure.ac, so you should edit that file and run |
| 31 | ;; "autoconf && ./configure" to change them. | 31 | ;; "autoconf && ./configure" to change them. |
| 32 | 32 | ||
| 33 | (defconst tramp-version "2.0.46" | 33 | (defconst tramp-version "2.0.47" |
| 34 | "This version of Tramp.") | 34 | "This version of Tramp.") |
| 35 | 35 | ||
| 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | 36 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" |
diff --git a/man/ChangeLog b/man/ChangeLog index 0f4646e0d73..546589a509b 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2005-01-16 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | Sync with Tramp 2.0.47. | ||
| 4 | |||
| 5 | * tramp.texi (Compilation): New section, describing compilation of | ||
| 6 | remote files. | ||
| 7 | |||
| 1 | 2005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net> | 8 | 2005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net> |
| 2 | 9 | ||
| 3 | * man/rmail.texi: Document support for GNU mailutils in rmail.el. | 10 | * man/rmail.texi: Document support for GNU mailutils in rmail.el. |
diff --git a/man/tramp.texi b/man/tramp.texi index e8577af4982..ac6fb4d5436 100644 --- a/man/tramp.texi +++ b/man/tramp.texi | |||
| @@ -25,8 +25,8 @@ | |||
| 25 | @end macro | 25 | @end macro |
| 26 | 26 | ||
| 27 | @copying | 27 | @copying |
| 28 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004 Free Software | 28 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free |
| 29 | Foundation, Inc. | 29 | Software Foundation, Inc. |
| 30 | 30 | ||
| 31 | @quotation | 31 | @quotation |
| 32 | Permission is granted to copy, distribute and/or modify this document | 32 | Permission is granted to copy, distribute and/or modify this document |
| @@ -192,6 +192,7 @@ Using @value{tramp} | |||
| 192 | * Multi-hop filename syntax:: Multi-hop filename conventions. | 192 | * Multi-hop filename syntax:: Multi-hop filename conventions. |
| 193 | * Filename completion:: Filename completion. | 193 | * Filename completion:: Filename completion. |
| 194 | * Dired:: Dired. | 194 | * Dired:: Dired. |
| 195 | * Compilation:: Compile remote files. | ||
| 195 | 196 | ||
| 196 | The inner workings of remote version control | 197 | The inner workings of remote version control |
| 197 | 198 | ||
| @@ -1690,6 +1691,7 @@ minute you have already forgotten that you hit that key! | |||
| 1690 | * Multi-hop filename syntax:: Multi-hop filename conventions. | 1691 | * Multi-hop filename syntax:: Multi-hop filename conventions. |
| 1691 | * Filename completion:: Filename completion. | 1692 | * Filename completion:: Filename completion. |
| 1692 | * Dired:: Dired. | 1693 | * Dired:: Dired. |
| 1694 | * Compilation:: Compile remote files. | ||
| 1693 | @end menu | 1695 | @end menu |
| 1694 | 1696 | ||
| 1695 | 1697 | ||
| @@ -1885,6 +1887,32 @@ present, than filename completion. Dired has its own cache mechanism | |||
| 1885 | and will only fetch the directory listing once. | 1887 | and will only fetch the directory listing once. |
| 1886 | 1888 | ||
| 1887 | 1889 | ||
| 1890 | @node Compilation | ||
| 1891 | @section Compile remote files | ||
| 1892 | @cindex compile | ||
| 1893 | @cindex recompile | ||
| 1894 | |||
| 1895 | @value{tramp} provides commands for compilation of files on remote | ||
| 1896 | machines. In order to get them loaded, you need to require | ||
| 1897 | @file{tramp-util.el}: | ||
| 1898 | |||
| 1899 | @lisp | ||
| 1900 | (require 'tramp-util) | ||
| 1901 | @end lisp | ||
| 1902 | |||
| 1903 | Afterwards, you can use the commands @code{tramp-compile} and | ||
| 1904 | @code{tramp-recompile} instead of @code{compile} and @code{recompile}, | ||
| 1905 | respectively; @inforef{Compilation, ,@value{emacsdir}}. This does not | ||
| 1906 | work for the @option{ftp} and @option{smb} methods. | ||
| 1907 | |||
| 1908 | The corresponding key bindings and menu entries calling these commands | ||
| 1909 | are redefined automatically for buffers associated with remote files. | ||
| 1910 | |||
| 1911 | After finishing the compilation, you can use the usual commands like | ||
| 1912 | @code{previous-error}, @code{next-error} and @code{first-error} for | ||
| 1913 | navigation in the @file{*Compilation*} buffer. | ||
| 1914 | |||
| 1915 | |||
| 1888 | @node Bug Reports | 1916 | @node Bug Reports |
| 1889 | @chapter Reporting Bugs and Problems | 1917 | @chapter Reporting Bugs and Problems |
| 1890 | @cindex bug reports | 1918 | @cindex bug reports |
diff --git a/man/trampver.texi b/man/trampver.texi index 45cbefb72ac..87b1dc8ebd1 100644 --- a/man/trampver.texi +++ b/man/trampver.texi | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | @c In the Tramp CVS, the version number is auto-frobbed from | 4 | @c In the Tramp CVS, the version number is auto-frobbed from |
| 5 | @c configure.ac, so you should edit that file and run | 5 | @c configure.ac, so you should edit that file and run |
| 6 | @c "autoconf && ./configure" to change the version number. | 6 | @c "autoconf && ./configure" to change the version number. |
| 7 | @set trampver 2.0.46 | 7 | @set trampver 2.0.47 |
| 8 | 8 | ||
| 9 | @c Other flags from configuration | 9 | @c Other flags from configuration |
| 10 | @set prefix /usr/local | 10 | @set prefix /usr/local |