# HG changeset patch # User Michael Albinus # Date 1128783197 0 # Node ID da00cdf6de37a7cd2f563701ae4bc871d20b40ca # Parent 27e12359729e2296ada51236769e6c8e7b714b18 Sync with Tramp 2.0.51. diff -r 27e12359729e -r da00cdf6de37 lisp/ChangeLog --- a/lisp/ChangeLog Sat Oct 08 13:28:55 2005 +0000 +++ b/lisp/ChangeLog Sat Oct 08 14:53:17 2005 +0000 @@ -1,3 +1,20 @@ +2005-10-08 Michael Albinus + + Sync with Tramp 2.0.51. + + * net/tramp.el (tramp-handle-set-visited-file-modtime) + (tramp-handle-insert-file-contents) + (tramp-handle-write-region): Insert special handling for + `last-coding-system-used' again, it still seems to be + necessary (unlike stated before). Reported by Toshinori Sugita + + (tramp-password-prompt-regexp): There might be other words before + trailing ":". Reported by Kurt Steinkraus . + (tramp-chunksize): Improve docstring. + (tramp-set-auto-save-file-modes): Octal integer code #o600 breaks + Emacs 20. Use `tramp-octal-to-decimal' therefore. Reported by + Christian Joergensen . + 2005-10-07 Glenn Morris * progmodes/f90.el (f90-keywords-re, f90-mode): Doc fix. @@ -2521,7 +2538,7 @@ Sync with Tramp 2.0.50. - * tramp.el: Remove defvar of `last-coding-system-used' in the + * net/tramp.el: Remove defvar of `last-coding-system-used' in the XEmacs case; not necessary anymore. (tramp-user-regexp): Allow "@" as part of user name. (tramp-handle-set-visited-file-modtime) @@ -2562,7 +2579,7 @@ instead of octal character code ?\600. The latter resulted in a syntax error with XEmacs. - * tramp-smb.el: Remove defvar of `last-coding-system-used' in the + * net/tramp-smb.el: Remove defvar of `last-coding-system-used' in the XEmacs case; not necessary anymore. (tramp-smb-handle-write-region): No special handling for `last-coding-system-used, because this is done in @@ -7492,7 +7509,7 @@ Sync with Tramp 2.0.49. - * tramp.el (tramp-handle-dired-call-process) + * net/tramp.el (tramp-handle-dired-call-process) (tramp-handle-insert-directory):`insert-buffer' cannot be used because the contents of the Tramp buffer is changed before insertion (`expand-file' and alike). @@ -10241,7 +10258,7 @@ Sync with Tramp 2.0.48. - * tramp.el (all): Change all addresses to .gnu.org. + * net/tramp.el (all): Change all addresses to .gnu.org. (tramp-append-tramp-buffers): New defun. (tramp-bug): Apply `tramp-append-tramp-buffers' as post-hook. Catch `dont-send' signal. @@ -10251,7 +10268,7 @@ Kjetil Kjernsmo . Check for Emacs 21.3.50 removed. - * tramp-smb.el (all): Remove debug construct for + * net/tramp-smb.el (all): Remove debug construct for `with-parsed-tramp-file-name'. (tramp-smb-prompt): Prompt can contain spaces inside directory names. (tramp-smb-handle-delete-directory, tramp-smb-handle-delete-file): @@ -12093,7 +12110,7 @@ Sync with Tramp 2.0.47. - * tramp.el (tramp-operation-not-permitted-regexp) New defcustom, + * net/tramp.el (tramp-operation-not-permitted-regexp) New defcustom, catching keep-date problems in cp/scp operations. (tramp-handle-copy-file): Don't call `set-file-modes' unconditionally. Specialized functions should know better what is @@ -12112,7 +12129,7 @@ (tramp-file-name-for-operation): Mark `shell-command' as magic for Emacs only. - * tramp-util.el (tramp-minor-mode): New minor mode. Add it to + * net/tramp-util.el (tramp-minor-mode): New minor mode. Add it to `find-file-hooks' and `dired-mode-hook'. (tramp-minor-mode-map): Respective map. Add remapping for `compile' and `recompile'. @@ -12120,19 +12137,19 @@ (tramp-compile): Enable `tramp-minor-mode' and `compilation-mode' in buffer "*Compilation*". Call the commands asynchronously. - * tramp-vc.el (tramp-vc-do-command, tramp-vc-do-command-new) + * net/tramp-vc.el (tramp-vc-do-command, tramp-vc-do-command-new) (tramp-vc-simple-command): Call `tramp-handle-shell-command' but `shell-command', because it isn't magic in XEmacs. Reported by Adrian Aichner . - * tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for + * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for `substitute-in-file-name. (tramp-smb-handle-substitute-in-file-name): New defun. (tramp-smb-advice-PC-do-completion): Delete advice. 2005-01-16 Kai Grossjohann - * tramp.el (tramp-wait-for-output): Fix typo in echo processing. + * net/tramp.el (tramp-wait-for-output): Fix typo in echo processing. Fix error in deleting region. 2005-01-15 Richard M. Stallman diff -r 27e12359729e -r da00cdf6de37 lisp/net/tramp.el --- a/lisp/net/tramp.el Sat Oct 08 13:28:55 2005 +0000 +++ b/lisp/net/tramp.el Sat Oct 08 14:53:17 2005 +0000 @@ -844,7 +844,7 @@ :type 'regexp) (defcustom tramp-password-prompt-regexp - "^.*\\([pP]assword\\|passphrase.*\\):\^@? *" + "^.*\\([pP]assword\\|passphrase\\).*:\^@? *" "*Regexp matching password-like prompts. The regexp should match at end of buffer. @@ -1364,26 +1364,53 @@ checked via the following code: (with-temp-buffer - (let ((bytes 1000) - (proc (start-process (buffer-name) (current-buffer) \"wc\" \"-c\"))) - (process-send-string proc (make-string bytes ?x)) - (process-send-eof proc) - (process-send-eof proc) - (accept-process-output proc 1) - (goto-char (point-min)) - (re-search-forward \"\\\\w+\") - (message \"Bytes sent: %s\\tBytes received: %s\" bytes (match-string 0)))) - -In the Emacs normally running Tramp, evaluate the above code. -You can do this, for example, by pasting it into the `*scratch*' -buffer and then hitting C-j with the cursor after the last -closing parenthesis. - -If your Emacs is buggy, the sent and received numbers will be -different. In that case, you'll want to set this variable to -some number. For those people who have needed it, the value 500 -seems to have worked well. There is no way to predict what value -you need; maybe you could just experiment a bit. + (let* ((user \"xxx\") (host \"yyy\") + (init 0) (step 50) + (sent init) (received init)) + (while (= sent received) + (setq sent (+ sent step)) + (erase-buffer) + (let ((proc (start-process (buffer-name) (current-buffer) + \"ssh\" \"-l\" user host \"wc\" \"-c\"))) + (when (memq (process-status proc) '(run open)) + (process-send-string proc (make-string sent ?\\ )) + (process-send-eof proc) + (process-send-eof proc)) + (while (not (progn (goto-char (point-min)) + (re-search-forward \"\\\\w+\" (point-max) t))) + (accept-process-output proc 1)) + (when (memq (process-status proc) '(run open)) + (setq received (string-to-number (match-string 0))) + (delete-process proc) + (message \"Bytes sent: %s\\tBytes received: %s\" sent received) + (sit-for 0)))) + (if (> sent (+ init step)) + (message \"You should set `tramp-chunksize' to a maximum of %s\" + (- sent step)) + (message \"Test does not work\") + (display-buffer (current-buffer)) + (sit-for 30)))) + +In the Emacs normally running Tramp, evaluate the above code +(replace \"xxx\" and \"yyy\" by the remote user and host name, +respectively). You can do this, for example, by pasting it into +the `*scratch*' buffer and then hitting C-j with the cursor after the +last closing parenthesis. Note that it works only if you have configured +\"ssh\" to run without password query, see ssh-agent(1). + +You will see the number of bytes sent successfully to the remote host. +If that number exceeds 1000, you can stop the execution by hitting +C-g, because your Emacs is likely clean. + +If your Emacs is buggy, the code stops and gives you an indication +about the value `tramp-chunksize' should be set. Maybe you could just +experiment a bit, e.g. changing the values of `init' and `step' +in the third line of the code. + +When it is necessary to set `tramp-chunksize', you might consider to +use an out-of-the-band method (like \"scp\") instead of an internal one +(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases +performance. Please raise a bug report via \"M-x tramp-bug\" if your system needs this variable to be set as well." @@ -2371,11 +2398,14 @@ (buffer-name))) (if time-list (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) - (let ((f (buffer-file-name))) + (let ((f (buffer-file-name)) + coding-system-used) (with-parsed-tramp-file-name f nil (let* ((attr (file-attributes f)) ;; '(-1 65535) means file doesn't exists yet. (modtime (or (nth 5 attr) '(-1 65535)))) + (when (boundp 'last-coding-system-used) + (setq coding-system-used (symbol-value 'last-coding-system-used))) ;; We use '(0 0) as a don't-know value. See also ;; `tramp-handle-file-attributes-with-ls'. (if (not (equal modtime '(0 0))) @@ -2390,6 +2420,8 @@ (setq attr (buffer-substring (point) (progn (end-of-line) (point))))) (setq tramp-buffer-file-attributes attr)) + (when (boundp 'last-coding-system-used) + (set 'last-coding-system-used coding-system-used)) nil))))) ;; CCC continue here @@ -3750,7 +3782,7 @@ 'insert-file-contents) 'file-local-copy))) (file-local-copy filename))) - (result nil)) + coding-system-used result) (when visit (setq buffer-file-name filename) (set-visited-file-modtime) @@ -3759,10 +3791,15 @@ multi-method method user host 9 "Inserting local temp file `%s'..." local-copy) (setq result (insert-file-contents local-copy nil beg end replace)) + ;; Now `last-coding-system-used' has right value. Remember it. + (when (boundp 'last-coding-system-used) + (setq coding-system-used (symbol-value 'last-coding-system-used))) (tramp-message-for-buffer multi-method method user host 9 "Inserting local temp file `%s'...done" local-copy) (delete-file local-copy) + (when (boundp 'last-coding-system-used) + (set 'last-coding-system-used coding-system-used)) (list (expand-file-name filename) (second result)))))) @@ -3876,6 +3913,13 @@ (loc-dec (tramp-get-local-decoding multi-method method user host)) (trampbuf (get-buffer-create "*tramp output*")) (modes (file-modes filename)) + ;; We use this to save the value of `last-coding-system-used' + ;; after writing the tmp file. At the end of the function, + ;; we set `last-coding-system-used' to this saved value. + ;; This way, any intermediary coding systems used while + ;; talking to the remote shell or suchlike won't hose this + ;; variable. This approach was snarfed from ange-ftp.el. + coding-system-used tmpfil) ;; Write region into a tmp file. This isn't really needed if we ;; use an encoding function, but currently we use it always @@ -3892,6 +3936,9 @@ (if confirm ; don't pass this arg unless defined for backward compat. (list start end tmpfil append 'no-message lockname confirm) (list start end tmpfil append 'no-message lockname))) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (when (boundp 'last-coding-system-used) + (setq coding-system-used (symbol-value 'last-coding-system-used))) ;; The permissions of the temporary file should be set. If ;; filename does not exist (eq modes nil) it has been renamed to ;; the backup file. This case `save-buffer' handles @@ -3998,6 +4045,9 @@ ;; We must pass modtime explicitely, because filename can be different ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. (nth 5 (file-attributes filename)))) + ;; Make `last-coding-system-used' have the right value. + (when (boundp 'last-coding-system-used) + (set 'last-coding-system-used coding-system-used)) (when (or (eq visit t) (eq visit nil) (stringp visit)) @@ -6990,7 +7040,7 @@ ;; auto-saved file belonging to another original file. This could ;; be a security threat. (set-file-modes buffer-auto-save-file-name - (or (file-modes bfn) #o600))))) + (or (file-modes bfn) (tramp-octal-to-decimal "0600")))))) (unless (or (> emacs-major-version 21) (and (featurep 'xemacs) diff -r 27e12359729e -r da00cdf6de37 lisp/net/trampver.el --- a/lisp/net/trampver.el Sat Oct 08 13:28:55 2005 +0000 +++ b/lisp/net/trampver.el Sat Oct 08 14:53:17 2005 +0000 @@ -30,7 +30,7 @@ ;; are auto-frobbed from configure.ac, so you should edit that file and run ;; "autoconf && ./configure" to change them. -(defconst tramp-version "2.0.50" +(defconst tramp-version "2.0.51" "This version of Tramp.") (defconst tramp-bug-report-address "tramp-devel@gnu.org" diff -r 27e12359729e -r da00cdf6de37 man/ChangeLog --- a/man/ChangeLog Sat Oct 08 13:28:55 2005 +0000 +++ b/man/ChangeLog Sat Oct 08 14:53:17 2005 +0000 @@ -1,3 +1,7 @@ +2005-10-08 Michael Albinus + + Sync with Tramp 2.0.51. + 2005-10-08 Nick Roberts * speedbar.texi (Introduction): Describe new location of speedbar diff -r 27e12359729e -r da00cdf6de37 man/trampver.texi --- a/man/trampver.texi Sat Oct 08 13:28:55 2005 +0000 +++ b/man/trampver.texi Sat Oct 08 14:53:17 2005 +0000 @@ -4,7 +4,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.0.50 +@set trampver 2.0.51 @c Other flags from configuration @set prefix /usr/local