aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus2005-08-07 15:42:42 +0000
committerMichael Albinus2005-08-07 15:42:42 +0000
commitd2a2c17f0f3735238953df26f42b4d18cb04bf4d (patch)
treeea5e36c48aa2815bec2e15ca6856affeae1bafa5 /lisp/net
parentf38be8010a5d26ce7386fe8d8b3fec4c01671df0 (diff)
downloademacs-d2a2c17f0f3735238953df26f42b4d18cb04bf4d.tar.gz
emacs-d2a2c17f0f3735238953df26f42b4d18cb04bf4d.zip
Sync with Tramp 2.0.50.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-ftp.el4
-rw-r--r--lisp/net/tramp-smb.el22
-rw-r--r--lisp/net/tramp-uu.el2
-rw-r--r--lisp/net/tramp.el339
-rw-r--r--lisp/net/trampver.el4
5 files changed, 176 insertions, 195 deletions
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 05beeb246e1..53cc392ad7a 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -1,8 +1,8 @@
1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP and EFS -*- coding: iso-8859-1; -*- 1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- coding: iso-8859-1; -*-
2 2
3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Michael Albinus <Michael.Albinus@alcatel.de> 5;; Author: Michael Albinus <michael.albinus@gmx.de>
6;; Keywords: comm, processes 6;; Keywords: comm, processes
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 74e2796fdef..5644e081e6c 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -46,11 +46,6 @@
46 (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler 46 (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler
47 (byte-compiler-options (warnings (- unused-vars)))))) 47 (byte-compiler-options (warnings (- unused-vars))))))
48 48
49;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'.
50(eval-when-compile
51 (unless (boundp 'last-coding-system-used)
52 (defvar last-coding-system-used nil)))
53
54;; Define SMB method ... 49;; Define SMB method ...
55(defcustom tramp-smb-method "smb" 50(defcustom tramp-smb-method "smb"
56 "*Method to connect SAMBA and M$ SMB servers." 51 "*Method to connect SAMBA and M$ SMB servers."
@@ -598,13 +593,6 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
598 (let ((share (tramp-smb-get-share localname)) 593 (let ((share (tramp-smb-get-share localname))
599 (file (tramp-smb-get-localname localname t)) 594 (file (tramp-smb-get-localname localname t))
600 (curbuf (current-buffer)) 595 (curbuf (current-buffer))
601 ;; We use this to save the value of `last-coding-system-used'
602 ;; after writing the tmp file. At the end of the function,
603 ;; we set `last-coding-system-used' to this saved value.
604 ;; This way, any intermediary coding systems used while
605 ;; talking to the remote shell or suchlike won't hose this
606 ;; variable. This approach was snarfed from ange-ftp.el.
607 coding-system-used
608 tmpfil) 596 tmpfil)
609 ;; Write region into a tmp file. 597 ;; Write region into a tmp file.
610 (setq tmpfil (tramp-make-temp-file)) 598 (setq tmpfil (tramp-make-temp-file))
@@ -616,9 +604,6 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
616 (if confirm ; don't pass this arg unless defined for backward compat. 604 (if confirm ; don't pass this arg unless defined for backward compat.
617 (list start end tmpfil append 'no-message lockname confirm) 605 (list start end tmpfil append 'no-message lockname confirm)
618 (list start end tmpfil append 'no-message lockname))) 606 (list start end tmpfil append 'no-message lockname)))
619 ;; Now, `last-coding-system-used' has the right value. Remember it.
620 (when (boundp 'last-coding-system-used)
621 (setq coding-system-used last-coding-system-used))
622 607
623 (tramp-smb-maybe-open-connection user host share) 608 (tramp-smb-maybe-open-connection user host share)
624 (tramp-message-for-buffer 609 (tramp-message-for-buffer
@@ -636,10 +621,7 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
636 (error "Buffer has changed from `%s' to `%s'" 621 (error "Buffer has changed from `%s' to `%s'"
637 curbuf (current-buffer))) 622 curbuf (current-buffer)))
638 (when (eq visit t) 623 (when (eq visit t)
639 (set-visited-file-modtime)) 624 (set-visited-file-modtime))))))
640 ;; Make `last-coding-system-used' have the right value.
641 (when (boundp 'last-coding-system-used)
642 (setq last-coding-system-used coding-system-used))))))
643 625
644 626
645;; Internal file name functions 627;; Internal file name functions
@@ -1000,7 +982,7 @@ Returns nil if an error message has appeared."
1000 (while (and (not found) (not err)) 982 (while (and (not found) (not err))
1001 983
1002 ;; Accept pending output. 984 ;; Accept pending output.
1003 (accept-process-output proc) 985 (tramp-accept-process-output proc)
1004 986
1005 ;; Search for prompt. 987 ;; Search for prompt.
1006 (goto-char (point-min)) 988 (goto-char (point-min))
diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el
index bbfd44c9999..e1e22af3cab 100644
--- a/lisp/net/tramp-uu.el
+++ b/lisp/net/tramp-uu.el
@@ -3,7 +3,7 @@
3 3
4;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4;; Copyright (C) 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 Gro,A_(Bjohann <kai.grossjohann@gmx.net>
7;; Keywords: comm, terminals 7;; Keywords: comm, terminals
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
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 19794976f7f..e3ad3959591 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4,7 +4,8 @@
4;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5;; 2005 Free Software Foundation, Inc. 5;; 2005 Free Software Foundation, Inc.
6 6
7;; Author: kai.grossjohann@gmx.net 7;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
8;; Michael Albinus <michael.albinus@gmx.de>
8;; Keywords: comm, processes 9;; Keywords: comm, processes
9 10
10;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -147,11 +148,6 @@ Nil means to use a separate filename syntax for Tramp.")
147 (when (boundp 'byte-compile-not-obsolete-var) 148 (when (boundp 'byte-compile-not-obsolete-var)
148 (setq byte-compile-not-obsolete-var 'directory-sep-char))) 149 (setq byte-compile-not-obsolete-var 'directory-sep-char)))
149 150
150;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'.
151(eval-when-compile
152 (unless (boundp 'last-coding-system-used)
153 (defvar last-coding-system-used nil)))
154
155;;; User Customizable Internal Variables: 151;;; User Customizable Internal Variables:
156 152
157(defgroup tramp nil 153(defgroup tramp nil
@@ -1031,7 +1027,7 @@ Derived from `tramp-postfix-multi-hop-format'."
1031 :type 'regexp) 1027 :type 'regexp)
1032 1028
1033(defcustom tramp-user-regexp 1029(defcustom tramp-user-regexp
1034 "[^:@/ \t]*" 1030 "[^:/ \t]*"
1035 "*Regexp matching user names." 1031 "*Regexp matching user names."
1036 :group 'tramp 1032 :group 'tramp
1037 :type 'regexp) 1033 :type 'regexp)
@@ -1914,7 +1910,9 @@ This function expects to be called from the tramp buffer only!"
1914 tramp-current-multi-method tramp-current-method 1910 tramp-current-multi-method tramp-current-method
1915 tramp-current-user tramp-current-host)) 1911 tramp-current-user tramp-current-host))
1916 (goto-char (point-max)) 1912 (goto-char (point-max))
1917 (tramp-insert-with-face 1913 (unless (bolp)
1914 (insert "\n"))
1915 (tramp-insert-with-face
1918 'italic 1916 'italic
1919 (concat "# " (apply #'format fmt-string args) "\n")))))) 1917 (concat "# " (apply #'format fmt-string args) "\n"))))))
1920 1918
@@ -2370,16 +2368,13 @@ target of the symlink differ."
2370 (buffer-name))) 2368 (buffer-name)))
2371 (if time-list 2369 (if time-list
2372 (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) 2370 (tramp-run-real-handler 'set-visited-file-modtime (list time-list))
2373 (let ((f (buffer-file-name)) 2371 (let ((f (buffer-file-name)))
2374 (coding-system-used nil))
2375 (with-parsed-tramp-file-name f nil 2372 (with-parsed-tramp-file-name f nil
2376 (let* ((attr (file-attributes f)) 2373 (let* ((attr (file-attributes f))
2377 ;; '(-1 65535) means file doesn't exists yet. 2374 ;; '(-1 65535) means file doesn't exists yet.
2378 (modtime (or (nth 5 attr) '(-1 65535)))) 2375 (modtime (or (nth 5 attr) '(-1 65535))))
2379 ;; We use '(0 0) as a don't-know value. See also 2376 ;; We use '(0 0) as a don't-know value. See also
2380 ;; `tramp-handle-file-attributes-with-ls'. 2377 ;; `tramp-handle-file-attributes-with-ls'.
2381 (when (boundp 'last-coding-system-used)
2382 (setq coding-system-used last-coding-system-used))
2383 (if (not (equal modtime '(0 0))) 2378 (if (not (equal modtime '(0 0)))
2384 (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) 2379 (tramp-run-real-handler 'set-visited-file-modtime (list modtime))
2385 (save-excursion 2380 (save-excursion
@@ -2392,9 +2387,7 @@ target of the symlink differ."
2392 (setq attr (buffer-substring (point) 2387 (setq attr (buffer-substring (point)
2393 (progn (end-of-line) (point))))) 2388 (progn (end-of-line) (point)))))
2394 (setq tramp-buffer-file-attributes attr)) 2389 (setq tramp-buffer-file-attributes attr))
2395 (when (boundp 'last-coding-system-used) 2390 nil)))))
2396 (setq last-coding-system-used coding-system-used))
2397 nil)))))
2398 2391
2399;; CCC continue here 2392;; CCC continue here
2400 2393
@@ -2412,7 +2405,7 @@ of."
2412 ;; recorded last modification time. 2405 ;; recorded last modification time.
2413 (if (or (not (buffer-file-name)) 2406 (if (or (not (buffer-file-name))
2414 (eq (visited-file-modtime) 0)) 2407 (eq (visited-file-modtime) 0))
2415 t 2408 t
2416 (let ((f (buffer-file-name))) 2409 (let ((f (buffer-file-name)))
2417 (with-parsed-tramp-file-name f nil 2410 (with-parsed-tramp-file-name f nil
2418 (let* ((attr (file-attributes f)) 2411 (let* ((attr (file-attributes f))
@@ -2447,12 +2440,6 @@ of."
2447 ;; if and only if that agrees with the buffer's record. 2440 ;; if and only if that agrees with the buffer's record.
2448 (t (equal mt '(-1 65535)))))))))) 2441 (t (equal mt '(-1 65535))))))))))
2449 2442
2450(defadvice clear-visited-file-modtime (after tramp activate)
2451 "Set `tramp-buffer-file-attributes' back to nil.
2452Tramp uses this variable as an emulation for the actual modtime of the file,
2453if the remote host can't provide the modtime."
2454 (setq tramp-buffer-file-attributes nil))
2455
2456(defun tramp-handle-set-file-modes (filename mode) 2443(defun tramp-handle-set-file-modes (filename mode)
2457 "Like `set-file-modes' for tramp files." 2444 "Like `set-file-modes' for tramp files."
2458 (with-parsed-tramp-file-name filename nil 2445 (with-parsed-tramp-file-name filename nil
@@ -3137,8 +3124,7 @@ be a local filename. The method used must be an out-of-band method."
3137 tramp-current-method method 3124 tramp-current-method method
3138 tramp-current-user user 3125 tramp-current-user user
3139 tramp-current-host host) 3126 tramp-current-host host)
3140 (tramp-message 3127 (message "Transferring %s to %s..." filename newname)
3141 5 "Transferring %s to file %s..." filename newname)
3142 3128
3143 ;; Use rcp-like program for file transfer. 3129 ;; Use rcp-like program for file transfer.
3144 (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf 3130 (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf
@@ -3147,8 +3133,7 @@ be a local filename. The method used must be an out-of-band method."
3147 (tramp-process-actions p multi-method method user host 3133 (tramp-process-actions p multi-method method user host
3148 tramp-actions-copy-out-of-band)) 3134 tramp-actions-copy-out-of-band))
3149 (kill-buffer trampbuf) 3135 (kill-buffer trampbuf)
3150 (tramp-message 3136 (message "Transferring %s to %s...done" filename newname)
3151 5 "Transferring %s to file %s...done" filename newname)
3152 3137
3153 ;; Set the mode. 3138 ;; Set the mode.
3154 (unless keep-date 3139 (unless keep-date
@@ -3319,7 +3304,7 @@ This is like `dired-recursive-delete-directory' for tramp files."
3319 (filename switches &optional wildcard full-directory-p) 3304 (filename switches &optional wildcard full-directory-p)
3320 "Like `insert-directory' for tramp files." 3305 "Like `insert-directory' for tramp files."
3321 (if (and (boundp 'ls-lisp-use-insert-directory-program) 3306 (if (and (boundp 'ls-lisp-use-insert-directory-program)
3322 (not ls-lisp-use-insert-directory-program)) 3307 (not (symbol-value 'ls-lisp-use-insert-directory-program)))
3323 (tramp-run-real-handler 'insert-directory 3308 (tramp-run-real-handler 'insert-directory
3324 (list filename switches wildcard full-directory-p)) 3309 (list filename switches wildcard full-directory-p))
3325 ;; For the moment, we assume that the remote "ls" program does not 3310 ;; For the moment, we assume that the remote "ls" program does not
@@ -3505,7 +3490,7 @@ the result will be a local, non-Tramp, filename."
3505;; Remote commands. 3490;; Remote commands.
3506 3491
3507(defvar tramp-async-proc nil 3492(defvar tramp-async-proc nil
3508 "Global variable keeping asyncronous process object. 3493 "Global variable keeping asynchronous process object.
3509Used in `tramp-handle-shell-command'") 3494Used in `tramp-handle-shell-command'")
3510 3495
3511(defun tramp-handle-shell-command (command &optional output-buffer error-buffer) 3496(defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
@@ -3762,7 +3747,6 @@ This will break if COMMAND prints a newline, followed by the value of
3762 'insert-file-contents) 3747 'insert-file-contents)
3763 'file-local-copy))) 3748 'file-local-copy)))
3764 (file-local-copy filename))) 3749 (file-local-copy filename)))
3765 (coding-system-used nil)
3766 (result nil)) 3750 (result nil))
3767 (when visit 3751 (when visit
3768 (setq buffer-file-name filename) 3752 (setq buffer-file-name filename)
@@ -3772,15 +3756,10 @@ This will break if COMMAND prints a newline, followed by the value of
3772 multi-method method user host 3756 multi-method method user host
3773 9 "Inserting local temp file `%s'..." local-copy) 3757 9 "Inserting local temp file `%s'..." local-copy)
3774 (setq result (insert-file-contents local-copy nil beg end replace)) 3758 (setq result (insert-file-contents local-copy nil beg end replace))
3775 ;; Now `last-coding-system-used' has right value. Remember it.
3776 (when (boundp 'last-coding-system-used)
3777 (setq coding-system-used last-coding-system-used))
3778 (tramp-message-for-buffer 3759 (tramp-message-for-buffer
3779 multi-method method user host 3760 multi-method method user host
3780 9 "Inserting local temp file `%s'...done" local-copy) 3761 9 "Inserting local temp file `%s'...done" local-copy)
3781 (delete-file local-copy) 3762 (delete-file local-copy)
3782 (when (boundp 'last-coding-system-used)
3783 (setq last-coding-system-used coding-system-used))
3784 (list (expand-file-name filename) 3763 (list (expand-file-name filename)
3785 (second result)))))) 3764 (second result))))))
3786 3765
@@ -3845,7 +3824,7 @@ This will break if COMMAND prints a newline, followed by the value of
3845 ;; (string= lockname filename)) 3824 ;; (string= lockname filename))
3846 ;; (error 3825 ;; (error
3847 ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) 3826 ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME"))
3848 ;; XEmacs takes a coding system as the sevent argument, not `confirm' 3827 ;; XEmacs takes a coding system as the seventh argument, not `confirm'
3849 (when (and (not (featurep 'xemacs)) 3828 (when (and (not (featurep 'xemacs))
3850 confirm (file-exists-p filename)) 3829 confirm (file-exists-p filename))
3851 (unless (y-or-n-p (format "File %s exists; overwrite anyway? " 3830 (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
@@ -3859,13 +3838,6 @@ This will break if COMMAND prints a newline, followed by the value of
3859 (loc-dec (tramp-get-local-decoding multi-method method user host)) 3838 (loc-dec (tramp-get-local-decoding multi-method method user host))
3860 (trampbuf (get-buffer-create "*tramp output*")) 3839 (trampbuf (get-buffer-create "*tramp output*"))
3861 (modes (file-modes filename)) 3840 (modes (file-modes filename))
3862 ;; We use this to save the value of `last-coding-system-used'
3863 ;; after writing the tmp file. At the end of the function,
3864 ;; we set `last-coding-system-used' to this saved value.
3865 ;; This way, any intermediary coding systems used while
3866 ;; talking to the remote shell or suchlike won't hose this
3867 ;; variable. This approach was snarfed from ange-ftp.el.
3868 coding-system-used
3869 tmpfil) 3841 tmpfil)
3870 ;; Write region into a tmp file. This isn't really needed if we 3842 ;; Write region into a tmp file. This isn't really needed if we
3871 ;; use an encoding function, but currently we use it always 3843 ;; use an encoding function, but currently we use it always
@@ -3887,9 +3859,6 @@ This will break if COMMAND prints a newline, followed by the value of
3887 ;; the backup file. This case `save-buffer' handles 3859 ;; the backup file. This case `save-buffer' handles
3888 ;; permissions. 3860 ;; permissions.
3889 (when modes (set-file-modes tmpfil modes)) 3861 (when modes (set-file-modes tmpfil modes))
3890 ;; Now, `last-coding-system-used' has the right value. Remember it.
3891 (when (boundp 'last-coding-system-used)
3892 (setq coding-system-used last-coding-system-used))
3893 ;; This is a bit lengthy due to the different methods possible for 3862 ;; This is a bit lengthy due to the different methods possible for
3894 ;; file transfer. First, we check whether the method uses an rcp 3863 ;; file transfer. First, we check whether the method uses an rcp
3895 ;; program. If so, we call it. Otherwise, both encoding and 3864 ;; program. If so, we call it. Otherwise, both encoding and
@@ -3991,9 +3960,6 @@ This will break if COMMAND prints a newline, followed by the value of
3991 ;; We must pass modtime explicitely, because filename can be different 3960 ;; We must pass modtime explicitely, because filename can be different
3992 ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. 3961 ;; from (buffer-file-name), f.e. if `file-precious-flag' is set.
3993 (nth 5 (file-attributes filename)))) 3962 (nth 5 (file-attributes filename))))
3994 ;; Make `last-coding-system-used' have the right value.
3995 (when (boundp 'last-coding-system-used)
3996 (setq last-coding-system-used coding-system-used))
3997 (when (or (eq visit t) 3963 (when (or (eq visit t)
3998 (eq visit nil) 3964 (eq visit nil)
3999 (stringp visit)) 3965 (stringp visit))
@@ -4301,7 +4267,7 @@ necessary anymore."
4301 (symbol-function 'PC-expand-many-files)) 4267 (symbol-function 'PC-expand-many-files))
4302 (defun PC-expand-many-files (name) 4268 (defun PC-expand-many-files (name)
4303 (if (tramp-tramp-file-p name) 4269 (if (tramp-tramp-file-p name)
4304 (expand-many-files name) 4270 (funcall (symbol-function 'expand-many-files) name)
4305 (tramp-save-PC-expand-many-files name)))) 4271 (tramp-save-PC-expand-many-files name))))
4306 4272
4307;; Why isn't eval-after-load sufficient? 4273;; Why isn't eval-after-load sufficient?
@@ -4825,12 +4791,11 @@ User may be nil."
4825(defun tramp-completion-handle-expand-file-name (name &optional dir) 4791(defun tramp-completion-handle-expand-file-name (name &optional dir)
4826 "Like `expand-file-name' for tramp files." 4792 "Like `expand-file-name' for tramp files."
4827 (let ((fullname (concat (or dir default-directory) name))) 4793 (let ((fullname (concat (or dir default-directory) name)))
4828 (tramp-drop-volume-letter 4794 (if (tramp-completion-mode fullname)
4829 (if (tramp-completion-mode fullname) 4795 (tramp-run-real-handler
4830 (tramp-run-real-handler 4796 'expand-file-name (list name dir))
4831 'expand-file-name (list name dir)) 4797 (tramp-completion-run-real-handler
4832 (tramp-completion-run-real-handler 4798 'expand-file-name (list name dir)))))
4833 'expand-file-name (list name dir))))))
4834 4799
4835;;; Internal Functions: 4800;;; Internal Functions:
4836 4801
@@ -5127,12 +5092,9 @@ file exists and nonzero exit status otherwise."
5127 (tramp-send-command 5092 (tramp-send-command
5128 multi-method method user host 5093 multi-method method user host
5129 (concat "PS1='$ ' exec " shell)) ; 5094 (concat "PS1='$ ' exec " shell)) ;
5130 (unless (tramp-wait-for-regexp 5095 (tramp-barf-if-no-shell-prompt
5131 (get-buffer-process (current-buffer)) 5096 (get-buffer-process (current-buffer))
5132 60 (format "\\(\\(%s\\)\\|\\(%s\\)\\)\\'" 5097 60 "Couldn't find remote `%s' prompt" shell)
5133 tramp-shell-prompt-pattern shell-prompt-pattern))
5134 (pop-to-buffer (buffer-name))
5135 (error "Couldn't find remote `%s' prompt" shell))
5136 (tramp-message 5098 (tramp-message
5137 9 "Setting remote shell prompt...") 5099 9 "Setting remote shell prompt...")
5138 ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we 5100 ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we
@@ -5331,7 +5293,7 @@ The terminal type can be configured with `tramp-terminal-type'."
5331 (tramp-message 9 "Waiting 60s for prompt from remote shell") 5293 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5332 (with-timeout (60 (throw 'tramp-action 'timeout)) 5294 (with-timeout (60 (throw 'tramp-action 'timeout))
5333 (while (not found) 5295 (while (not found)
5334 (accept-process-output p 1) 5296 (tramp-accept-process-output p 1)
5335 (goto-char (point-min)) 5297 (goto-char (point-min))
5336 (setq todo actions) 5298 (setq todo actions)
5337 (while todo 5299 (while todo
@@ -5368,7 +5330,7 @@ The terminal type can be configured with `tramp-terminal-type'."
5368 (tramp-message 9 "Waiting 60s for prompt from remote shell") 5330 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5369 (with-timeout (60 (throw 'tramp-action 'timeout)) 5331 (with-timeout (60 (throw 'tramp-action 'timeout))
5370 (while (not found) 5332 (while (not found)
5371 (accept-process-output p 1) 5333 (tramp-accept-process-output p 1)
5372 (setq todo actions) 5334 (setq todo actions)
5373 (goto-char (point-min)) 5335 (goto-char (point-min))
5374 (while todo 5336 (while todo
@@ -5757,6 +5719,14 @@ character."
5757 5719
5758;; Utility functions. 5720;; Utility functions.
5759 5721
5722(defun tramp-accept-process-output
5723 (&optional process timeout timeout-msecs)
5724 "Like `accept-process-output' for Tramp processes.
5725This is needed in order to hide `last-coding-system-used', which is set
5726for process communication also."
5727 (let (last-coding-system-used)
5728 (accept-process-output process timeout timeout-msecs)))
5729
5760(defun tramp-wait-for-regexp (proc timeout regexp) 5730(defun tramp-wait-for-regexp (proc timeout regexp)
5761 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. 5731 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
5762Expects the output of PROC to be sent to the current buffer. Returns 5732Expects the output of PROC to be sent to the current buffer. Returns
@@ -5773,20 +5743,18 @@ nil."
5773 timeout)) 5743 timeout))
5774 (with-timeout (timeout) 5744 (with-timeout (timeout)
5775 (while (not found) 5745 (while (not found)
5776 (accept-process-output proc 1) 5746 (tramp-accept-process-output proc 1)
5777 (unless (memq (process-status proc) '(run open)) 5747 (unless (memq (process-status proc) '(run open))
5778 (error "Process has died")) 5748 (error "Process has died"))
5779 (goto-char (point-min)) 5749 (goto-char (point-min))
5780 (setq found (when (re-search-forward regexp nil t) 5750 (setq found (re-search-forward regexp nil t))))))
5781 (tramp-match-string-list)))))))
5782 (t 5751 (t
5783 (while (not found) 5752 (while (not found)
5784 (accept-process-output proc 1) 5753 (tramp-accept-process-output proc 1)
5785 (unless (memq (process-status proc) '(run open)) 5754 (unless (memq (process-status proc) '(run open))
5786 (error "Process has died")) 5755 (error "Process has died"))
5787 (goto-char (point-min)) 5756 (goto-char (point-min))
5788 (setq found (when (re-search-forward regexp nil t) 5757 (setq found (re-search-forward regexp nil t)))))
5789 (tramp-match-string-list))))))
5790 (when tramp-debug-buffer 5758 (when tramp-debug-buffer
5791 (append-to-buffer 5759 (append-to-buffer
5792 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method 5760 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
@@ -6399,7 +6367,7 @@ Sends COMMAND, then waits 30 seconds for shell prompt."
6399 timeout)) 6367 timeout))
6400 (with-timeout (timeout) 6368 (with-timeout (timeout)
6401 (while (not found) 6369 (while (not found)
6402 (accept-process-output proc 1) 6370 (tramp-accept-process-output proc 1)
6403 (unless (memq (process-status proc) '(run open)) 6371 (unless (memq (process-status proc) '(run open))
6404 (error "Process has died")) 6372 (error "Process has died"))
6405 (goto-char (point-max)) 6373 (goto-char (point-max))
@@ -6407,7 +6375,7 @@ Sends COMMAND, then waits 30 seconds for shell prompt."
6407 (setq found (looking-at end-of-output)))))) 6375 (setq found (looking-at end-of-output))))))
6408 (t 6376 (t
6409 (while (not found) 6377 (while (not found)
6410 (accept-process-output proc 1) 6378 (tramp-accept-process-output proc 1)
6411 (unless (memq (process-status proc) '(run open)) 6379 (unless (memq (process-status proc) '(run open))
6412 (error "Process has died")) 6380 (error "Process has died"))
6413 (goto-char (point-max)) 6381 (goto-char (point-max))
@@ -6444,18 +6412,6 @@ Sends COMMAND, then waits 30 seconds for shell prompt."
6444 ;; Return value is whether end-of-output sentinel was found. 6412 ;; Return value is whether end-of-output sentinel was found.
6445 found)) 6413 found))
6446 6414
6447(defun tramp-match-string-list (&optional string)
6448 "Returns list of all match strings.
6449That is, (list (match-string 0) (match-string 1) ...), according to the
6450number of matches."
6451 (let* ((nmatches (/ (length (match-data)) 2))
6452 (i (- nmatches 1))
6453 (res nil))
6454 (while (>= i 0)
6455 (setq res (cons (match-string i string) res))
6456 (setq i (- i 1)))
6457 res))
6458
6459(defun tramp-send-command-and-check (multi-method method user host command 6415(defun tramp-send-command-and-check (multi-method method user host command
6460 &optional subshell) 6416 &optional subshell)
6461 "Run COMMAND and check its exit status. 6417 "Run COMMAND and check its exit status.
@@ -6556,7 +6512,7 @@ MULTI-METHOD, METHOD, USER, and HOST specify the connection."
6556If `tramp-discard-garbage' is nil, just erase buffer." 6512If `tramp-discard-garbage' is nil, just erase buffer."
6557 (if (not tramp-discard-garbage) 6513 (if (not tramp-discard-garbage)
6558 (erase-buffer) 6514 (erase-buffer)
6559 (while (prog1 (erase-buffer) (accept-process-output p 0.25)) 6515 (while (prog1 (erase-buffer) (tramp-accept-process-output p 0.25))
6560 (when tramp-debug-buffer 6516 (when tramp-debug-buffer
6561 (save-excursion 6517 (save-excursion
6562 (set-buffer (tramp-get-debug-buffer multi-method method user host)) 6518 (set-buffer (tramp-get-debug-buffer multi-method method user host))
@@ -6993,7 +6949,7 @@ as default."
6993 ;; auto-saved file belonging to another original file. This could 6949 ;; auto-saved file belonging to another original file. This could
6994 ;; be a security threat. 6950 ;; be a security threat.
6995 (set-file-modes buffer-auto-save-file-name 6951 (set-file-modes buffer-auto-save-file-name
6996 (or (file-modes bfn) ?\600))))) 6952 (or (file-modes bfn) #o600)))))
6997 6953
6998(unless (or (> emacs-major-version 21) 6954(unless (or (> emacs-major-version 21)
6999 (and (featurep 'xemacs) 6955 (and (featurep 'xemacs)
@@ -7130,10 +7086,11 @@ it does the right thing."
7130 "Specify if query is needed for process when Emacs is exited. 7086 "Specify if query is needed for process when Emacs is exited.
7131If the second argument flag is non-nil, Emacs will query the user before 7087If the second argument flag is non-nil, Emacs will query the user before
7132exiting if process is running." 7088exiting if process is running."
7089 (funcall
7133 (if (fboundp 'set-process-query-on-exit-flag) 7090 (if (fboundp 'set-process-query-on-exit-flag)
7134 (set-process-query-on-exit-flag process flag) 7091 (symbol-function 'set-process-query-on-exit-flag)
7135 (funcall (symbol-function 'process-kill-without-query) 7092 (symbol-function 'process-kill-without-query))
7136 process flag))) 7093 process flag))
7137 7094
7138 7095
7139;; ------------------------------------------------------------ 7096;; ------------------------------------------------------------
@@ -7213,20 +7170,19 @@ Only works for Bourne-like shells."
7213;; CCC: This check is now also really awful; we should search all 7170;; CCC: This check is now also really awful; we should search all
7214;; of the filename format, not just the prefix. 7171;; of the filename format, not just the prefix.
7215(when (string-match "\\[" tramp-prefix-format) 7172(when (string-match "\\[" tramp-prefix-format)
7216(defadvice file-expand-wildcards (around tramp-fix activate) 7173 (defadvice file-expand-wildcards (around tramp-fix activate)
7217 (let ((name (ad-get-arg 0))) 7174 (let ((name (ad-get-arg 0)))
7218 (if (tramp-tramp-file-p name) 7175 (if (tramp-tramp-file-p name)
7219 ;; If it's a Tramp file, dissect it and look if wildcards 7176 ;; If it's a Tramp file, dissect it and look if wildcards
7220 ;; need to be expanded at all. 7177 ;; need to be expanded at all.
7221 (let ((v (tramp-dissect-file-name name))) 7178 (let ((v (tramp-dissect-file-name name)))
7222 (if (string-match "[[*?]" (tramp-file-name-localname v)) 7179 (if (string-match "[[*?]" (tramp-file-name-localname v))
7223 (let ((res ad-do-it)) 7180 (let ((res ad-do-it))
7224 (setq ad-return-value (or res (list name)))) 7181 (setq ad-return-value (or res (list name))))
7225 (setq ad-return-value (list name)))) 7182 (setq ad-return-value (list name))))
7226 ;; If it is not a Tramp file, just run the original function. 7183 ;; If it is not a Tramp file, just run the original function.
7227 (let ((res ad-do-it)) 7184 (let ((res ad-do-it))
7228 (setq ad-return-value (or res (list name))))))) 7185 (setq ad-return-value (or res (list name))))))))
7229)
7230 7186
7231;; Tramp version is useful in a number of situations. 7187;; Tramp version is useful in a number of situations.
7232 7188
@@ -7246,69 +7202,74 @@ Only works for Bourne-like shells."
7246 (interactive) 7202 (interactive)
7247 (require 'reporter) 7203 (require 'reporter)
7248 (catch 'dont-send 7204 (catch 'dont-send
7249 (let ((reporter-prompt-for-summary-p t)) 7205 (let ((reporter-prompt-for-summary-p t))
7250 (reporter-submit-bug-report 7206 (reporter-submit-bug-report
7251 tramp-bug-report-address ; to-address 7207 tramp-bug-report-address ; to-address
7252 (format "tramp (%s)" tramp-version) ; package name and version 7208 (format "tramp (%s)" tramp-version) ; package name and version
7253 `(;; Current state 7209 (delq nil
7254 tramp-ls-command 7210 `(;; Current state
7255 tramp-test-groks-nt 7211 tramp-ls-command
7256 tramp-file-exists-command 7212 tramp-test-groks-nt
7257 tramp-current-multi-method 7213 tramp-file-exists-command
7258 tramp-current-method 7214 tramp-current-multi-method
7259 tramp-current-user 7215 tramp-current-method
7260 tramp-current-host 7216 tramp-current-user
7261 7217 tramp-current-host
7262 ;; System defaults 7218
7263 tramp-auto-save-directory ; vars to dump 7219 ;; System defaults
7264 tramp-default-method 7220 tramp-auto-save-directory ; vars to dump
7265 tramp-rsh-end-of-line 7221 tramp-default-method
7266 tramp-default-password-end-of-line 7222 tramp-rsh-end-of-line
7267 tramp-remote-path 7223 tramp-default-password-end-of-line
7268 tramp-login-prompt-regexp 7224 tramp-remote-path
7269 tramp-password-prompt-regexp 7225 tramp-login-prompt-regexp
7270 tramp-wrong-passwd-regexp 7226 ;; Mask non-7bit characters
7271 tramp-yesno-prompt-regexp 7227 (tramp-password-prompt-regexp . tramp-reporter-dump-variable)
7272 tramp-yn-prompt-regexp 7228 tramp-wrong-passwd-regexp
7273 tramp-terminal-prompt-regexp 7229 tramp-yesno-prompt-regexp
7274 tramp-temp-name-prefix 7230 tramp-yn-prompt-regexp
7275 tramp-file-name-structure 7231 tramp-terminal-prompt-regexp
7276 tramp-file-name-regexp 7232 tramp-temp-name-prefix
7277 tramp-multi-file-name-structure 7233 tramp-file-name-structure
7278 tramp-multi-file-name-hop-structure 7234 tramp-file-name-regexp
7279 tramp-multi-methods 7235 tramp-multi-file-name-structure
7280 tramp-multi-connection-function-alist 7236 tramp-multi-file-name-hop-structure
7281 tramp-methods 7237 tramp-multi-methods
7282 tramp-end-of-output 7238 tramp-multi-connection-function-alist
7283 tramp-coding-commands 7239 tramp-methods
7284 tramp-actions-before-shell 7240 tramp-end-of-output
7285 tramp-actions-copy-out-of-band 7241 tramp-coding-commands
7286 tramp-multi-actions 7242 tramp-actions-before-shell
7287 tramp-terminal-type 7243 tramp-actions-copy-out-of-band
7288 tramp-shell-prompt-pattern 7244 tramp-multi-actions
7289 tramp-chunksize 7245 tramp-terminal-type
7290 ,(when (boundp 'tramp-backup-directory-alist) 7246 ;; Mask non-7bit characters
7291 'tramp-backup-directory-alist) 7247 (tramp-shell-prompt-pattern . tramp-reporter-dump-variable)
7292 ,(when (boundp 'tramp-bkup-backup-directory-info) 7248 tramp-chunksize
7293 'tramp-bkup-backup-directory-info) 7249 ,(when (boundp 'tramp-backup-directory-alist)
7294 7250 'tramp-backup-directory-alist)
7295 ;; Non-tramp variables of interest 7251 ,(when (boundp 'tramp-bkup-backup-directory-info)
7296 shell-prompt-pattern 7252 'tramp-bkup-backup-directory-info)
7297 backup-by-copying 7253
7298 backup-by-copying-when-linked 7254 ;; Non-tramp variables of interest
7299 backup-by-copying-when-mismatch 7255 ;; Mask non-7bit characters
7300 ,(when (boundp 'backup-by-copying-when-privileged-mismatch) 7256 (shell-prompt-pattern . tramp-reporter-dump-variable)
7301 'backup-by-copying-when-privileged-mismatch) 7257 backup-by-copying
7302 ,(when (boundp 'password-cache) 7258 backup-by-copying-when-linked
7303 'password-cache) 7259 backup-by-copying-when-mismatch
7304 ,(when (boundp 'password-cache-expiry) 7260 ,(when (boundp 'backup-by-copying-when-privileged-mismatch)
7305 'password-cache-expiry) 7261 'backup-by-copying-when-privileged-mismatch)
7306 ,(when (boundp 'backup-directory-alist) 7262 ,(when (boundp 'password-cache)
7307 'backup-directory-alist) 7263 'password-cache)
7308 ,(when (boundp 'bkup-backup-directory-info) 7264 ,(when (boundp 'password-cache-expiry)
7309 'bkup-backup-directory-info) 7265 'password-cache-expiry)
7310 file-name-handler-alist) 7266 ,(when (boundp 'backup-directory-alist)
7311 nil ; pre-hook 7267 'backup-directory-alist)
7268 ,(when (boundp 'bkup-backup-directory-info)
7269 'bkup-backup-directory-info)
7270 file-name-handler-alist))
7271
7272 'tramp-load-report-modules ; pre-hook
7312 'tramp-append-tramp-buffers ; post-hook 7273 'tramp-append-tramp-buffers ; post-hook
7313 "\ 7274 "\
7314Enter your bug report in this message, including as much detail as you 7275Enter your bug report in this message, including as much detail as you
@@ -7327,8 +7288,43 @@ report.
7327--bug report follows this line-- 7288--bug report follows this line--
7328")))) 7289"))))
7329 7290
7330(defun tramp-append-tramp-buffers () 7291(defun tramp-reporter-dump-variable (varsym mailbuf)
7331 "Append Tramp buffers into the bug report." 7292 "Pretty-print the value of the variable in symbol VARSYM.
7293Used for non-7bit chars in strings."
7294 (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer))
7295 (val (with-current-buffer reporter-eval-buffer
7296 (symbol-value varsym))))
7297
7298 ;; There are characters to be masked.
7299 (when (and (boundp 'mm-7bit-chars)
7300 (string-match
7301 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
7302 (with-current-buffer reporter-eval-buffer
7303 (set varsym (concat "(base64-decode-string \""
7304 (base64-encode-string val)
7305 "\")"))))
7306
7307 ;; Dump variable.
7308 (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf)
7309
7310 ;; Remove string quotation.
7311 (forward-line -1)
7312 (when (looking-at
7313 (concat "\\(^.*\\)" "\"" ;; \1 "
7314 "\\((base64-decode-string \\)" "\\\\" ;; \2 \
7315 "\\(\".*\\)" "\\\\" ;; \3 \
7316 "\\(\")\\)" "\"$")) ;; \4 "
7317 (replace-match "\\1\\2\\3\\4")
7318 (beginning-of-line)
7319 (insert " ;; variable encoded due to non-printable characters\n"))
7320 (forward-line 1)
7321
7322 ;; Reset VARSYM to old value.
7323 (with-current-buffer reporter-eval-buffer
7324 (set varsym val))))
7325
7326(defun tramp-load-report-modules ()
7327 "Load needed modules for reporting."
7332 7328
7333 ;; We load message.el and mml.el from Gnus. 7329 ;; We load message.el and mml.el from Gnus.
7334 (if (featurep 'xemacs) 7330 (if (featurep 'xemacs)
@@ -7338,9 +7334,12 @@ report.
7338 (require 'message nil 'noerror) 7334 (require 'message nil 'noerror)
7339 (require 'mml nil 'noerror)) 7335 (require 'mml nil 'noerror))
7340 (when (functionp 'message-mode) 7336 (when (functionp 'message-mode)
7341 (funcall 'message-mode)) 7337 (funcall (symbol-function 'message-mode)))
7342 (when (functionp 'mml-mode) 7338 (when (functionp 'mml-mode)
7343 (funcall 'mml-mode t)) 7339 (funcall (symbol-function 'mml-mode) t)))
7340
7341(defun tramp-append-tramp-buffers ()
7342 "Append Tramp buffers into the bug report."
7344 7343
7345 (when (and 7344 (when (and
7346 (eq major-mode 'message-mode) 7345 (eq major-mode 'message-mode)
@@ -7394,10 +7393,10 @@ Therefore, the contents of files might be included in the debug buffer(s).")
7394 (goto-char (point-max)) 7393 (goto-char (point-max))
7395 (insert "\n\n") 7394 (insert "\n\n")
7396 (dolist (buffer buffer-list) 7395 (dolist (buffer buffer-list)
7397 (mml-insert-empty-tag 7396 (funcall (symbol-function 'mml-insert-empty-tag)
7398 'part 'type "text/plain" 'encoding "base64" 7397 'part 'type "text/plain" 'encoding "base64"
7399 'disposition "attachment" 'buffer (buffer-name buffer) 7398 'disposition "attachment" 'buffer (buffer-name buffer)
7400 'description (buffer-name buffer))) 7399 'description (buffer-name buffer)))
7401 (set-buffer-modified-p nil)) 7400 (set-buffer-modified-p nil))
7402 7401
7403 ;; Don't send. Delete the message buffer. 7402 ;; Don't send. Delete the message buffer.
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 0feb93af987..2ba9f7b3249 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -4,7 +4,7 @@
4 4
5;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. 5;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
6 6
7;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE 7;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
8;; Keywords: comm, processes 8;; Keywords: comm, processes
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -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.49" 33(defconst tramp-version "2.0.50"
34 "This version of Tramp.") 34 "This version of Tramp.")
35 35
36(defconst tramp-bug-report-address "tramp-devel@gnu.org" 36(defconst tramp-bug-report-address "tramp-devel@gnu.org"