? texi/doclicense.texi
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/ChangeLog,v
retrieving revision 1.68
diff -u -u -r1.68 ChangeLog
--- ChangeLog	2007/04/01 18:44:17	1.68
+++ ChangeLog	2007/05/28 10:51:55
@@ -1,3 +1,7 @@
+2007-05-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	* Makefile (AUTHOR_VERSION): Bump to 2.0.56.
+
 2007-04-01  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.37 released.
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/Makefile,v
retrieving revision 1.68
diff -u -u -r1.68 Makefile
--- Makefile	2007/04/01 18:44:17	1.68
+++ Makefile	2007/05/28 10:51:55
@@ -18,7 +18,7 @@
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.37
-AUTHOR_VERSION = 2.0.55
+AUTHOR_VERSION = 2.0.56
 MAINTAINER = Kai Großjohann <kai.grossjohann@gmx.net>
 PACKAGE = tramp
 PKG_TYPE = regular
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/ChangeLog,v
retrieving revision 1.41
diff -u -u -r1.41 ChangeLog
--- lisp/ChangeLog	2007/03/31 16:37:41	1.41
+++ lisp/ChangeLog	2007/05/28 10:51:57
@@ -1,3 +1,44 @@
+2007-05-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	Version 2.0.56 released.
+
+2007-05-27  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el:
+	* tramp-ftp.el:
+	* tramp-smb.el:
+	* tramp-util.el:
+	* tramp-vc.el:
+	Don't load cl.el, because that pollutes the namespace.  Replace cl
+	macros by their implementations where necessary.  Requested by
+	Richard Stallman <rms@gnu.org>.
+
+	* tramp.el (tramp-file-name-p, tramp-file-name-multi-method)
+	(tramp-file-name-method, tramp-file-name-user)
+	(tramp-file-name-host, tramp-file-name-localname): New defuns,
+	replacing defstruct `tramp-file-name'.
+	(tramp-handle-file-remote-p, tramp-completion-dissect-file-name1)
+	(tramp-dissect-file-name, tramp-dissect-multi-file-name): Apply
+	`vector' instead of `make-tramp-file-name'.
+
+2007-04-16  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (top): Make `set-buffer-multibyte' an alias if it
+	doesn't exist.
+
+2007-04-08  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-completion-mode): `last-input-event' is nil when
+	XEmacs is started.
+
+2007-03-31  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-register-file-name-handler)
+	(tramp-register-completion-file-name-handler): New defsubst,
+	derived from `tramp-register-file-name-handlers'.  The split is
+	necessary because Tramp's file name handlers must be registered at
+	different startup places.
+
 2007-03-31  Joachim Schrod  <jschrod@acm.org>  (tiny change)
 
 	* tramp.el (tramp-completion-mode): `last-input-event' may have no
@@ -7,11 +48,54 @@
 
 	* tramp.el (tramp-handle-make-auto-save-file-name): Apply
 	`tramp-temporary-file-directory' for compatibility reasons.
+
+2007-03-07  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-handle-insert-directory): Check (featurep 'ls-lisp).
 
-2007-01-15  Michael Albinus  <michael.albinus@gmx.de>
+2007-03-05  Michael Albinus  <michael.albinus@gmx.de>
 
+	* tramp.el (tramp-make-temp-file): New parameter FILENAME.  Append
+	its extension to the resulting temporary file name.
+	(tramp-handle-file-local-copy, tramp-handle-write-region): Apply
+	it.
+
+	* tramp-smb.el (tramp-smb-handle-file-local-copy)
+	(tramp-smb-handle-write-region): Apply it.
+
+2007-02-12  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-get-ls-command, tramp-get-file-exists-command)
+	(tramp-get-remote-ln): Handle error case.  Reported by Chris Moore
+	<dooglus@gmail.com>.
+
+2007-01-27  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
+	default-directory to a sane value when calling start-process.
+
+2007-01-21  Glenn Morris  <rgm@gnu.org>
+
+	* tramp.el (tramp-perl-encode, tramp-perl-decode):
+	Update copyrights.
+
+2007-01-18  Michael Albinus  <michael.albinus@gmx.de>
+
 	* tramp.el (with-parsed-tramp-file-name): Protect debug spec
 	during compilation.
+
+2007-01-11  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el (tramp-handle-file-local-copy): Set
+	`enable-multibyte-characters' to nil.  Reported by Chris Moore
+	<christopher.ian.moore@gmail.com>.
+
+2007-01-09  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.el: (tramp-process-one-action): Remove `with-timeout'.
+	(tramp-process-actions): Add optional parameter TIMEOUT.
+	(tramp-open-connection-telnet, tramp-open-connection-rsh)
+	(tramp-open-connection-su): Add timeout of 60".
 
 2006-12-31  Michael Albinus  <michael.albinus@gmx.de>
 
Index: lisp/tramp-ftp.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp-ftp.el,v
retrieving revision 1.2
diff -u -u -r1.2 tramp-ftp.el
--- lisp/tramp-ftp.el	2006/08/29 06:03:37	1.2
+++ lisp/tramp-ftp.el	2007/05/28 10:51:57
@@ -1,6 +1,7 @@
 ;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- coding: iso-8859-1; -*-
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
+;;   2007 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -31,12 +32,7 @@
 
 (require 'tramp)
 
-(eval-when-compile
-  (require 'cl)
-  (require 'custom)
-  ;; Emacs 19.34 compatibility hack -- is this needed?
-  (or (>= emacs-major-version 20)
-      (load "cl-seq")))
+(eval-when-compile (require 'custom))
 
 ;; Disable Ange-FTP from file-name-handler-alist.
 ;; To handle EFS, the following functions need to be dealt with:
Index: lisp/tramp-smb.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp-smb.el,v
retrieving revision 1.8
diff -u -u -r1.8 tramp-smb.el
--- lisp/tramp-smb.el	2006/04/17 13:11:41	1.8
+++ lisp/tramp-smb.el	2007/05/28 10:51:57
@@ -1,6 +1,6 @@
 ;;; tramp-smb.el --- Tramp access functions for SMB servers -*- coding: iso-8859-1; -*-
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -31,12 +31,7 @@
 (require 'tramp)
 
 ;; Pacify byte-compiler
-(eval-when-compile
-  (require 'cl)
-  (require 'custom)
-  ;; Emacs 19.34 compatibility hack -- is this needed?
-  (or (>= emacs-major-version 20)
-      (load "cl-seq")))
+(eval-when-compile (require 'custom))
 
 ;; Avoid byte-compiler warnings if the byte-compiler supports this.
 ;; Currently, XEmacs supports this.
@@ -384,7 +379,7 @@
     (save-excursion
       (let ((share (tramp-smb-get-share localname))
 	    (file (tramp-smb-get-localname localname t))
-	    (tmpfil (tramp-make-temp-file)))
+	    (tmpfil (tramp-make-temp-file filename)))
 	(unless (file-exists-p filename)
 	  (error "Cannot make local copy of non-existing file `%s'" filename))
 	(tramp-message-for-buffer
@@ -595,7 +590,7 @@
 	    (curbuf (current-buffer))
 	    tmpfil)
 	;; Write region into a tmp file.
-	(setq tmpfil (tramp-make-temp-file))
+	(setq tmpfil (tramp-make-temp-file filename))
 	;; We say `no-message' here because we don't want the visited file
 	;; modtime data to be clobbered from the temp file.  We call
 	;; `set-visited-file-modtime' ourselves later on.
Index: lisp/tramp-util.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp-util.el,v
retrieving revision 1.9
diff -u -u -r1.9 tramp-util.el
--- lisp/tramp-util.el	2006/01/22 22:10:49	1.9
+++ lisp/tramp-util.el	2007/05/28 10:51:58
@@ -2,7 +2,7 @@
 ;;; tramp-util.el --- Misc utility functions to use with Tramp
 
 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
+;;   2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: kai.grossjohann@gmx.net
 ;; Keywords: comm, extensions, processes
@@ -29,7 +29,6 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
 (require 'compile)
 (require 'tramp)
 (add-hook 'tramp-util-unload-hook
Index: lisp/tramp-uu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp-uu.el,v
retrieving revision 1.6
diff -u -u -r1.6 tramp-uu.el
--- lisp/tramp-uu.el	2006/04/17 13:11:41	1.6
+++ lisp/tramp-uu.el	2007/05/28 10:51:58
@@ -1,7 +1,8 @@
 ;;; -*- coding: iso-2022-7bit; -*-
 ;;; tramp-uu.el --- uuencode in Lisp
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006,
+;;   2007 Free Software Foundation, Inc.
 
 ;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
 ;; Keywords: comm, terminals
Index: lisp/tramp-vc.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp-vc.el,v
retrieving revision 1.17
diff -u -u -r1.17 tramp-vc.el
--- lisp/tramp-vc.el	2006/04/17 13:11:41	1.17
+++ lisp/tramp-vc.el	2007/05/28 10:51:58
@@ -1,7 +1,7 @@
 ;;; tramp-vc.el --- Version control integration for TRAMP.el
 
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pittman <daniel@danann.net>
 ;; Keywords: comm, processes
@@ -31,8 +31,6 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
 (require 'vc)
 ;; Old VC defines vc-rcs-release in vc.el, new VC requires extra module.
 (unless (boundp 'vc-rcs-release)
Index: lisp/tramp.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/tramp.el,v
retrieving revision 1.41
diff -u -u -r1.41 tramp.el
--- lisp/tramp.el	2007/03/31 16:37:41	1.41
+++ lisp/tramp.el	2007/05/28 10:52:02
@@ -1,9 +1,11 @@
 ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol
 
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;;   2007 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
+;; (copyright statements below in code to be updated with the above notice)
+
 ;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -149,11 +151,7 @@
 		    (when (featurep 'tramp-smb)
 		      (unload-feature 'tramp-smb 'force)))))))
 
-(require 'cl)
 (require 'custom)
-;; Emacs 19.34 compatibility hack -- is this needed?
-(or (>= emacs-major-version 20)
-    (load "cl-seq"))
 
 (unless (boundp 'custom-print-functions)
   (defvar custom-print-functions nil))	; not autoloaded before Emacs 20.4
@@ -173,6 +171,11 @@
   (when (boundp 'byte-compile-not-obsolete-var)
     (setq byte-compile-not-obsolete-var 'directory-sep-char)))
 
+;; `set-buffer-multibyte' comes from Emacs Leim.
+(eval-and-compile
+  (unless (fboundp 'set-buffer-multibyte)
+    (defalias 'set-buffer-multibyte 'ignore)))
+
 ;;; User Customizable Internal Variables:
 
 (defgroup tramp nil
@@ -1791,7 +1794,8 @@
 (defvar tramp-perl-encode
   "%s -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+#   Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -1833,7 +1837,8 @@
 (defvar tramp-perl-decode
   "%s -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+#   Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -2382,10 +2387,10 @@
 			       "Integer constant overflow in reader")
 			(string-match
 			 "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'"
-			 (caddr err)))
-	       (let* ((big (read (substring (caddr err) 0
+			 (car (cddr err))))
+	       (let* ((big (read (substring (car (cddr err)) 0
 					    (match-beginning 1))))
-		      (small (read (match-string 1 (caddr err))))
+		      (small (read (match-string 1 (car (cddr err)))))
 		      (twiddle (/ small 65536)))
 		 (cons (+ big twiddle)
 		       (- small (* twiddle 65536))))))))
@@ -2805,7 +2810,7 @@
                                  object)))
                (cell root))
           (while (cdr cell)
-            (if (and match (not (string-match match (caadr cell))))
+            (if (and match (not (string-match match (car (cadr cell)))))
                 ;; Remove from list
                 (setcdr cell (cddr cell))
               ;; Include in list
@@ -3243,8 +3248,13 @@
 
       ;; Use rcp-like program for file transfer.
       (unwind-protect
-          (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf
-                          copy-program copy-args)))
+          (let* ((default-directory
+		   (if (and (stringp default-directory)
+			    (file-accessible-directory-p default-directory))
+		       default-directory
+		     (tramp-temporary-file-directory)))
+		 (p (apply 'start-process (buffer-name trampbuf) trampbuf
+			   copy-program copy-args)))
             (tramp-set-process-query-on-exit-flag p nil)
             (tramp-process-actions p multi-method method user host
                                    tramp-actions-copy-out-of-band))
@@ -3419,10 +3429,10 @@
 (defun tramp-handle-insert-directory
   (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for tramp files."
-  (if (and (boundp 'ls-lisp-use-insert-directory-program)
+  (if (and (featurep 'ls-lisp)
            (not (symbol-value 'ls-lisp-use-insert-directory-program)))
-      (tramp-run-real-handler 'insert-directory
-                              (list filename switches wildcard full-directory-p))
+      (tramp-run-real-handler
+       'insert-directory (list filename switches wildcard full-directory-p))
     ;; For the moment, we assume that the remote "ls" program does not
     ;; grok "--dired".  In the future, we should detect this on
     ;; connection setup.
@@ -3764,10 +3774,12 @@
 
 ;; File Editing.
 
-(defsubst tramp-make-temp-file ()
-  (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
-	   (expand-file-name tramp-temp-name-prefix
-			     (tramp-temporary-file-directory))))
+(defsubst tramp-make-temp-file (filename)
+  (concat
+   (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
+	    (expand-file-name tramp-temp-name-prefix
+			      (tramp-temporary-file-directory)))
+   (file-name-extension filename t)))
 
 (defun tramp-handle-file-local-copy (filename)
   "Like `file-local-copy' for tramp files."
@@ -3787,7 +3799,7 @@
       (unless (file-exists-p filename)
 	(error "Cannot make local copy of non-existing file `%s'"
 	       filename))
-      (setq tmpfil (tramp-make-temp-file))
+      (setq tmpfil (tramp-make-temp-file filename))
 
       (cond ((tramp-method-out-of-band-p multi-method method user host)
 	     ;; `copy-file' handles out-of-band methods
@@ -3814,10 +3826,14 @@
 
 	       ;; Here is where loc-enc and loc-dec used to be let-bound.
 	       (if (and (symbolp loc-dec) (fboundp loc-dec))
-		   ;; If local decoding is a function, we call it.
+		   ;; If local decoding is a function, we call it.  We
+		   ;; must disable multibyte, because
+		   ;; `uudecode-decode-region' doesn't handle it
+		   ;; correctly.
 		   (let ((tmpbuf (get-buffer-create " *tramp tmp*")))
 		     (set-buffer tmpbuf)
 		     (erase-buffer)
+		     (set-buffer-multibyte nil)
 		     (insert-buffer-substring tramp-buf)
 		     (tramp-message-for-buffer
 		      multi-method method user host
@@ -3835,7 +3851,7 @@
 		     (kill-buffer tmpbuf))
 		 ;; If tramp-decoding-function is not defined for this
 		 ;; method, we invoke tramp-decoding-command instead.
-		 (let ((tmpfil2 (tramp-make-temp-file)))
+		 (let ((tmpfil2 (tramp-make-temp-file filename)))
 		   (write-region (point-min) (point-max) tmpfil2)
 		   (tramp-message
 		    6 "Decoding remote file %s with command %s..."
@@ -3856,12 +3872,7 @@
   "Like `file-remote-p' for tramp files."
   (when (tramp-tramp-file-p filename)
     (with-parsed-tramp-file-name filename nil
-      (make-tramp-file-name
-:multi-method multi-method
-:method method
-:user user
-:host host
-:localname ""))))
+      (vector multi-method method user host ""))))
 
 (defun tramp-handle-insert-file-contents
   (filename &optional visit beg end replace)
@@ -3906,7 +3917,7 @@
 	(when (boundp 'last-coding-system-used)
 	  (set 'last-coding-system-used coding-system-used))
 	(list (expand-file-name filename)
-	      (second result))))))
+	      (cadr result))))))
 
 
 (defun tramp-handle-find-backup-file-name (filename)
@@ -4043,7 +4054,7 @@
       ;; Write region into a tmp file.  This isn't really needed if we
       ;; use an encoding function, but currently we use it always
       ;; because this makes the logic simpler.
-      (setq tmpfil (tramp-make-temp-file))
+      (setq tmpfil (tramp-make-temp-file filename))
       ;; Set current buffer.  If connection wasn't open, `file-modes' has
       ;; changed it accidently.
       (set-buffer curbuf)
@@ -4410,10 +4421,20 @@
       (tramp-completion-run-real-handler operation args)))))
 
 ;;;###autoload
-(defsubst tramp-register-file-name-handlers ()
-  "Add tramp file name handlers to `file-name-handler-alist'."
+(defsubst tramp-register-file-name-handler ()
+  "Add tramp file name handler to `file-name-handler-alist'."
   (add-to-list 'file-name-handler-alist
 	       (cons tramp-file-name-regexp 'tramp-file-name-handler))
+  ;; If jka-compr is already loaded, move it to the front of
+  ;; `file-name-handler-alist'.
+  (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
+    (when jka
+      (setq file-name-handler-alist
+	    (cons jka (delete jka file-name-handler-alist))))))
+
+;;;###autoload
+(defsubst tramp-register-completion-file-name-handler ()
+  "Add tramp completion file name handler to `file-name-handler-alist'."
   ;; `partial-completion-mode' is unknown in XEmacs.  So we should
   ;; load it unconditionally there.  In the GNU Emacs case, method/
   ;; user/host name completion shall be bound to `partial-completion-mode'.
@@ -4431,13 +4452,18 @@
       (setq file-name-handler-alist
 	    (cons jka (delete jka file-name-handler-alist))))))
 
+;; `tramp-file-name-handler' must be registered before evaluation of
+;; site-start and init files, because there might exist remote files
+;; already, f.e. files kept via recentf-mode.
+;;;###autoload(tramp-register-file-name-handler)
 ;; During autoload, it shall be checked whether
-;; `partial-completion-mode' is active.  Therefore registering will be
-;; delayed.
+;; `partial-completion-mode' is active.  Therefore registering of
+;; `tramp-completion-file-name-handler' will be delayed.
 ;;;###autoload(add-hook
 ;;;###autoload 'after-init-hook
-;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
-(tramp-register-file-name-handlers)
+;;;###autoload '(lambda () (tramp-register-completion-file-name-handler)))
+(tramp-register-file-name-handler)
+(tramp-register-completion-file-name-handler)
 
 ;;;###autoload
 (defun tramp-unload-file-name-handlers ()
@@ -4548,6 +4574,8 @@
 		       (char-equal last-input-event ?\ )))))
 	;; XEmacs
 	(and (featurep 'xemacs)
+	     ;; `last-input-event' might be nil.
+	     (not (null last-input-event))
 	     ;; `last-input-event' may have no character approximation.
 	     (funcall (symbol-function 'event-to-character) last-input-event)
 	     (or
@@ -4746,24 +4774,14 @@
 			  (match-string (nth 1 structure) name)))
 	(if (and method (member method tramp-multi-methods))
 	    ;; Not handled (yet).
-	    (make-tramp-file-name
-	     :multi-method method
-	     :method nil
-	     :user nil
-	     :host nil
-	     :localname nil)
+	    (vector method nil nil nil nil)
 	  (let ((user   (and (nth 2 structure)
 			     (match-string (nth 2 structure) name)))
 		(host   (and (nth 3 structure)
 			     (match-string (nth 3 structure) name)))
 		(localname   (and (nth 4 structure)
 			     (match-string (nth 4 structure) name))))
-	    (make-tramp-file-name
-	     :multi-method nil
-	     :method method
-	     :user user
-	     :host host
-	     :localname localname)))))))
+	    (vector nil method user host localname)))))))
 
 ;; This function returns all possible method completions, adding the
 ;; trailing method delimeter.
@@ -5166,7 +5184,7 @@
                               (aref user i) (aref host i))
                     (format "%s@%s:" (aref method i) (aref host i)))
                   string-list))
-      (incf i))
+      (setq i (1+ i)))
     (format "*%s/%s %s*"
             prefix multi-method
             (apply 'concat (reverse string-list)))))
@@ -5545,32 +5563,36 @@
   (let (found item pattern action todo)
     (erase-buffer)
     (tramp-message 9 "Waiting 60s for prompt from remote shell")
-    (with-timeout (60 (throw 'tramp-action 'timeout))
-      (while (not found)
-	(tramp-accept-process-output p 1)
+    (while (not found)
+      (tramp-accept-process-output p 1)
+      (goto-char (point-min))
+      (setq todo actions)
+      (while todo
 	(goto-char (point-min))
-	(setq todo actions)
-	(while todo
-	  (goto-char (point-min))
-	  (setq item (pop todo))
-	  (setq pattern (symbol-value (nth 0 item)))
-	  (setq action (nth 1 item))
-	  (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
-			 pattern)
-	  (when (re-search-forward (concat pattern "\\'") nil t)
-	    (setq found (funcall action p multi-method method user host)))))
-      found)))
+	(setq item (pop todo))
+	(setq pattern (symbol-value (nth 0 item)))
+	(setq action (nth 1 item))
+	(tramp-message 10 "Looking for regexp \"%s\" from remote shell"
+		       pattern)
+	(when (re-search-forward (concat pattern "\\'") nil t)
+	  (setq found (funcall action p multi-method method user host)))))
+    found))
 
-(defun tramp-process-actions (p multi-method method user host actions)
-  "Perform actions until success."
+(defun tramp-process-actions
+  (p multi-method method user host actions &optional timeout)
+  "Perform actions until success or TIMEOUT."
   (tramp-message 10 "%s" (mapconcat 'identity (process-command p) " "))
   (let (exit)
     (while (not exit)
       (tramp-message 9 "Waiting for prompts from remote shell")
       (setq exit
 	    (catch 'tramp-action
-	      (tramp-process-one-action
-	       p multi-method method user host actions)
+	      (if timeout
+		  (with-timeout (timeout)
+		    (tramp-process-one-action
+		     p multi-method method user host actions))
+		(tramp-process-one-action
+		 p multi-method method user host actions))
 	      nil)))
     (unless (eq exit 'ok)
       (tramp-clear-passwd user host)
@@ -5694,7 +5716,7 @@
 	(set-buffer (tramp-get-buffer multi-method method user host))
 	(erase-buffer)
 	(tramp-process-actions p multi-method method user host
-			       tramp-actions-before-shell)
+			       tramp-actions-before-shell 60)
         (tramp-open-connection-setup-interactive-shell
          p multi-method method user host)
         (tramp-post-connection multi-method method user host)))))
@@ -5767,7 +5789,7 @@
 
 	(set-buffer buf)
 	(tramp-process-actions p multi-method method user host
-			       tramp-actions-before-shell)
+			       tramp-actions-before-shell 60)
         (tramp-message 7 "Initializing remote shell")
         (tramp-open-connection-setup-interactive-shell
          p multi-method method user host)
@@ -5828,7 +5850,7 @@
         (tramp-set-process-query-on-exit-flag p nil)
 	(set-buffer (tramp-get-buffer multi-method method user host))
 	(tramp-process-actions p multi-method method user host
-			       tramp-actions-before-shell)
+			       tramp-actions-before-shell 60)
         (tramp-open-connection-setup-interactive-shell
          p multi-method method user host)
         (tramp-post-connection multi-method method
@@ -5899,7 +5921,7 @@
             ;; is done here.
             (funcall multi-func p m u h command)
             (erase-buffer)
-            (incf i)))
+            (setq i (1+ i))))
         (tramp-open-connection-setup-interactive-shell
          p multi-method method user host)
         (tramp-post-connection multi-method method user host)))))
@@ -6795,7 +6817,8 @@
 
 (defun tramp-mode-string-to-int (mode-string)
   "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits."
-  (let* ((mode-chars (string-to-vector mode-string))
+  (let* (case-fold-search
+	 (mode-chars (string-to-vector mode-string))
          (owner-read (aref mode-chars 1))
          (owner-write (aref mode-chars 2))
          (owner-execute-or-setid (aref mode-chars 3))
@@ -6807,45 +6830,61 @@
          (other-execute-or-sticky (aref mode-chars 9)))
     (save-match-data
       (logior
-       (case owner-read
-         (?r (tramp-octal-to-decimal "00400")) (?- 0)
-         (t (error "Second char `%c' must be one of `r-'" owner-read)))
-       (case owner-write
-         (?w (tramp-octal-to-decimal "00200")) (?- 0)
-         (t (error "Third char `%c' must be one of `w-'" owner-write)))
-       (case owner-execute-or-setid
-         (?x (tramp-octal-to-decimal "00100"))
-         (?S (tramp-octal-to-decimal "04000"))
-         (?s (tramp-octal-to-decimal "04100"))
-         (?- 0)
-         (t (error "Fourth char `%c' must be one of `xsS-'"
-                   owner-execute-or-setid)))
-       (case group-read
-         (?r (tramp-octal-to-decimal "00040")) (?- 0)
-         (t (error "Fifth char `%c' must be one of `r-'" group-read)))
-       (case group-write
-         (?w (tramp-octal-to-decimal "00020")) (?- 0)
-         (t (error "Sixth char `%c' must be one of `w-'" group-write)))
-       (case group-execute-or-setid
-         (?x (tramp-octal-to-decimal "00010"))
-         (?S (tramp-octal-to-decimal "02000"))
-         (?s (tramp-octal-to-decimal "02010"))
-         (?- 0)
-         (t (error "Seventh char `%c' must be one of `xsS-'"
-                   group-execute-or-setid)))
-       (case other-read
-         (?r (tramp-octal-to-decimal "00004")) (?- 0)
-         (t (error "Eighth char `%c' must be one of `r-'" other-read)))
-       (case other-write
-         (?w (tramp-octal-to-decimal "00002")) (?- 0)
+       (cond
+	((char-equal owner-read ?r) (tramp-octal-to-decimal "00400"))
+	((char-equal owner-read ?-) 0)
+	(t (error "Second char `%c' must be one of `r-'" owner-read)))
+       (cond
+	((char-equal owner-write ?w) (tramp-octal-to-decimal "00200"))
+	((char-equal owner-write ?-) 0)
+	(t (error "Third char `%c' must be one of `w-'" owner-write)))
+       (cond
+	((char-equal owner-execute-or-setid ?x)
+	 (tramp-octal-to-decimal "00100"))
+	((char-equal owner-execute-or-setid ?S)
+	 (tramp-octal-to-decimal "04000"))
+	((char-equal owner-execute-or-setid ?s)
+	 (tramp-octal-to-decimal "04100"))
+	((char-equal owner-execute-or-setid ?-) 0)
+	(t (error "Fourth char `%c' must be one of `xsS-'"
+		  owner-execute-or-setid)))
+       (cond
+	((char-equal group-read ?r) (tramp-octal-to-decimal "00040"))
+	((char-equal group-read ?-) 0)
+	(t (error "Fifth char `%c' must be one of `r-'" group-read)))
+       (cond
+	((char-equal group-write ?w) (tramp-octal-to-decimal "00020"))
+	((char-equal group-write ?-) 0)
+	(t (error "Sixth char `%c' must be one of `w-'" group-write)))
+       (cond
+	((char-equal group-execute-or-setid ?x)
+	 (tramp-octal-to-decimal "00010"))
+	((char-equal group-execute-or-setid ?S)
+	 (tramp-octal-to-decimal "02000"))
+	((char-equal group-execute-or-setid ?s)
+	 (tramp-octal-to-decimal "02010"))
+	((char-equal group-execute-or-setid ?-) 0)
+	(t (error "Seventh char `%c' must be one of `xsS-'"
+		  group-execute-or-setid)))
+       (cond
+	((char-equal other-read ?r)
+	 (tramp-octal-to-decimal "00004"))
+	((char-equal other-read ?-) 0)
+	(t (error "Eighth char `%c' must be one of `r-'" other-read)))
+       (cond
+         ((char-equal other-write ?w) (tramp-octal-to-decimal "00002"))
+	 ((char-equal other-write ?-) 0)
          (t (error "Nineth char `%c' must be one of `w-'" other-write)))
-       (case other-execute-or-sticky
-         (?x (tramp-octal-to-decimal "00001"))
-         (?T (tramp-octal-to-decimal "01000"))
-         (?t (tramp-octal-to-decimal "01001"))
-         (?- 0)
-         (t (error "Tenth char `%c' must be one of `xtT-'"
-                   other-execute-or-sticky)))))))
+       (cond
+	((char-equal other-execute-or-sticky ?x)
+	 (tramp-octal-to-decimal "00001"))
+	((char-equal other-execute-or-sticky ?T)
+	 (tramp-octal-to-decimal "01000"))
+	((char-equal other-execute-or-sticky ?t)
+	 (tramp-octal-to-decimal "01001"))
+	((char-equal other-execute-or-sticky ?-) 0)
+	(t (error "Tenth char `%c' must be one of `xtT-'"
+		  other-execute-or-sticky)))))))
 
 (defun tramp-convert-file-attributes (multi-method method user host attr)
   "Convert file-attributes ATTR generated by perl script or ls.
@@ -6948,7 +6987,29 @@
 ;; internal data structure.  Convenience functions for internal
 ;; data structure.
 
-(defstruct tramp-file-name multi-method method user host localname)
+(defun tramp-file-name-p (obj)
+  "Check whether TRAMP-FILE-NAME is a Tramp object."
+  (and (vectorp obj) (= 5 (length obj))))
+
+(defun tramp-file-name-multi-method (obj)
+  "Return MULTI-METHOD component of TRAMP-FILE-NAME."
+  (and (tramp-file-name-p obj) (aref obj 0)))
+
+(defun tramp-file-name-method (obj)
+  "Return METHOD component of TRAMP-FILE-NAME."
+  (and (tramp-file-name-p obj) (aref obj 1)))
+
+(defun tramp-file-name-user (obj)
+  "Return USER component of TRAMP-FILE-NAME."
+  (and (tramp-file-name-p obj) (aref obj 2)))
+
+(defun tramp-file-name-host (obj)
+  "Return HOST component of TRAMP-FILE-NAME."
+  (and (tramp-file-name-p obj) (aref obj 3)))
+
+(defun tramp-file-name-localname (obj)
+  "Return LOCALNAME component of TRAMP-FILE-NAME."
+  (and (tramp-file-name-p obj) (aref obj 4)))
 
 (defun tramp-tramp-file-p (name)
   "Return t iff NAME is a tramp file."
@@ -6981,12 +7042,7 @@
 	(let ((user (match-string (nth 2 tramp-file-name-structure) name))
 	      (host (match-string (nth 3 tramp-file-name-structure) name))
 	      (localname (match-string (nth 4 tramp-file-name-structure) name)))
-	  (make-tramp-file-name
-	   :multi-method nil
-	   :method method
-	   :user (or user nil)
-	   :host host
-	   :localname localname))))))
+	  (vector nil method (or user nil) host localname))))))
 
 (defun tramp-find-default-method (user host)
   "Look up the right method to use in `tramp-default-method-alist'."
@@ -7026,7 +7082,7 @@
     (setq method (match-string method-index name))
     (setq hops (match-string hops-index name))
     (setq len (/ (length (match-data t)) 2))
-    (when (< localname-index 0) (incf localname-index len))
+    (when (< localname-index 0) (setq localname-index (+ localname-index len)))
     (setq localname (match-string localname-index name))
     (let ((index 0))
       (while (string-match hop-regexp hops index)
@@ -7037,12 +7093,12 @@
               (cons (match-string hop-user-index hops) hop-users))
         (setq hop-hosts
               (cons (match-string hop-host-index hops) hop-hosts))))
-    (make-tramp-file-name
-:multi-method method
-:method       (apply 'vector (reverse hop-methods))
-:user         (apply 'vector (reverse hop-users))
-:host         (apply 'vector (reverse hop-hosts))
-:localname         localname)))
+    (vector
+     method
+     (apply 'vector (reverse hop-methods))
+     (apply 'vector (reverse hop-users))
+     (apply 'vector (reverse hop-hosts))
+     localname)))
 
 (defun tramp-make-tramp-file-name (multi-method method user host localname)
   "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME."
@@ -7074,7 +7130,7 @@
       (let ((m (aref method i)) (u (aref user i)) (h (aref host i)))
         (setq hops (concat hops (format-spec hop-format
 					     `((?m . ,m) (?u . ,u) (?h . ,h)))))
-        (incf i)))
+        (setq i (1+ i))))
     (concat prefix hops localname)))
 
 (defun tramp-make-copy-program-file-name (user host localname)
@@ -7093,10 +7149,12 @@
 ;; Variables local to connection.
 
 (defun tramp-get-ls-command (multi-method method user host)
-  (save-excursion
-    (tramp-maybe-open-connection multi-method method user host)
-    (set-buffer (tramp-get-buffer multi-method method user host))
-    tramp-ls-command))
+  (or
+   (save-excursion
+     (tramp-maybe-open-connection multi-method method user host)
+     (set-buffer (tramp-get-buffer multi-method method user host))
+     tramp-ls-command)
+   (error "Couldn't find remote `ls' command")))
 
 (defun tramp-get-test-groks-nt (multi-method method user host)
   (save-excursion
@@ -7105,16 +7163,20 @@
     tramp-test-groks-nt))
 
 (defun tramp-get-file-exists-command (multi-method method user host)
-  (save-excursion
-    (tramp-maybe-open-connection multi-method method user host)
-    (set-buffer (tramp-get-buffer multi-method method user host))
-    tramp-file-exists-command))
+  (or
+   (save-excursion
+     (tramp-maybe-open-connection multi-method method user host)
+     (set-buffer (tramp-get-buffer multi-method method user host))
+     tramp-file-exists-command)
+   (error "Couldn't find remote `test -e' command")))
 
 (defun tramp-get-remote-perl (multi-method method user host)
   (tramp-get-connection-property "perl" nil multi-method method user host))
 
 (defun tramp-get-remote-ln (multi-method method user host)
-  (tramp-get-connection-property "ln" nil multi-method method user host))
+  (or
+   (tramp-get-connection-property "ln" nil multi-method method user host)
+   (error "Couldn't find remote `ln' command")))
 
 (defun tramp-get-remote-uid (multi-method method user host)
   (tramp-get-connection-property "uid" nil multi-method method user host))
@@ -7183,7 +7245,7 @@
 		      (assoc (tramp-find-method multi-method method user host)
 			     tramp-methods))))
     (if entry
-	(second entry)
+	(cadr entry)
       (symbol-value param))))
 
 
Index: lisp/trampver.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/lisp/trampver.el,v
retrieving revision 1.15
diff -u -u -r1.15 trampver.el
--- lisp/trampver.el	2006/12/30 21:03:06	1.15
+++ lisp/trampver.el	2007/05/28 10:52:02
@@ -2,7 +2,7 @@
 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol
 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
 
-;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
 ;; Keywords: comm, processes
@@ -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.55"
+(defconst tramp-version "2.0.56"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
Index: texi/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/texi/ChangeLog,v
retrieving revision 1.32
diff -u -u -r1.32 ChangeLog
--- texi/ChangeLog	2006/12/30 21:03:08	1.32
+++ texi/ChangeLog	2007/05/28 10:52:02
@@ -1,3 +1,20 @@
+2007-05-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	Version 2.0.56 released.
+
+	* doclicense.texi: New file.
+
+	* Makefile.in (TEXI_FILES): Add doclicense.texi.
+
+2007-04-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* tramp.texi: Include GFDL.
+
+2007-02-21  Michael Albinus  <michael.albinus@gmx.de>
+
+	* tramp.texi (Frequently Asked Questions): Improve ~/.zshrc
+	settings.  Reported by Ted Zlatanov <tzz@lifelogs.com>.
+
 2006-12-30  Michael Albinus  <michael.albinus@gmx.de>
 
 	Version 2.0.55 released.
Index: texi/tramp.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/texi/tramp.texi,v
retrieving revision 1.25
diff -u -u -r1.25 tramp.texi
--- texi/tramp.texi	2006/12/30 21:03:08	1.25
+++ texi/tramp.texi	2007/05/28 10:52:03
@@ -25,7 +25,7 @@
 @end macro
 
 @copying
-Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 Free Software Foundation, Inc.
 
 @quotation
@@ -159,6 +159,8 @@
 * Files directories and localnames::  How file names, directories and localnames are mangled and managed.
 * Issues::                      Debatable Issues and What Was Decided.
 
+* GNU Free Documentation License:: The license for this documentation.
+
 @detailmenu
  --- The Detailed Node Listing ---
 @c
@@ -2049,8 +2051,12 @@
 A special problem is the zsh, which uses left-hand side and right-hand
 side prompts in parallel.  Therefore, it is necessary to disable the
 zsh line editor on the remote host.  You shall add to @file{~/.zshrc}
-the following command: @command{[ $TERM = "dumb" ] && unsetopt zle}.
+the following command:
 
+@example
+[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
+@end example
+
 @item
 @value{tramp} doesn't transfer strings with more than 500 characters
 correctly
@@ -2405,6 +2411,10 @@
 for @value{emacsothername}.
 @end ifset
 @end itemize
+
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@include doclicense.texi
 
 @node Concept Index
 @comment node-name,    next,  previous,      up
Index: texi/trampver.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/tramp/texi/trampver.texi,v
retrieving revision 1.15
diff -u -u -r1.15 trampver.texi
--- texi/trampver.texi	2006/12/30 21:03:08	1.15
+++ texi/trampver.texi	2007/05/28 10:52:03
@@ -1,10 +1,15 @@
 @c -*-texinfo-*-
 @c texi/trampver.texi.  Generated from trampver.texi.in by configure.
 
+@c This is part of the Emacs manual.
+@c Copyright (C) 2003, 2004, 2005, 2006, 2007
+@c   Free Software Foundation, Inc.
+@c See file emacs.texi for copying conditions.
+
 @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.55
+@set trampver 2.0.56
 
 @c Other flags from configuration
 @set prefix /usr/local
