emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el


From: Kai Großjohann
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el
Date: Fri, 28 Feb 2003 13:28:48 -0500

Index: emacs/lisp/net/tramp.el
diff -c emacs/lisp/net/tramp.el:1.32 emacs/lisp/net/tramp.el:1.33
*** emacs/lisp/net/tramp.el:1.32        Wed Feb  5 16:03:36 2003
--- emacs/lisp/net/tramp.el     Fri Feb 28 13:28:47 2003
***************
*** 2,8 ****
  
  ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, 
Inc.
  
! ;; Author: address@hidden
  ;; Keywords: comm, processes
  
  ;; This file is part of GNU Emacs.
--- 2,8 ----
  
  ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, 
Inc.
  
! ;; Author: address@hidden 
  ;; Keywords: comm, processes
  
  ;; This file is part of GNU Emacs.
***************
*** 34,40 ****
  ;;
  ;; Notes:
  ;; -----
! ;;
  ;; This package only works for Emacs 20 and higher, and for XEmacs 21
  ;; and higher.  (XEmacs 20 is missing the `with-timeout' macro.  Emacs
  ;; 19 is reported to have other problems.  For XEmacs 21, you need the
--- 34,40 ----
  ;;
  ;; Notes:
  ;; -----
! ;; 
  ;; This package only works for Emacs 20 and higher, and for XEmacs 21
  ;; and higher.  (XEmacs 20 is missing the `with-timeout' macro.  Emacs
  ;; 19 is reported to have other problems.  For XEmacs 21, you need the
***************
*** 72,78 ****
  ;; In the Tramp CVS repository, the version numer is auto-frobbed from
  ;; the Makefile, so you should edit the top-level Makefile to change
  ;; the version number.
! (defconst tramp-version "2.0.29"
    "This version of tramp.")
  
  (defconst tramp-bug-report-address "address@hidden"
--- 72,78 ----
  ;; In the Tramp CVS repository, the version numer is auto-frobbed from
  ;; the Makefile, so you should edit the top-level Makefile to change
  ;; the version number.
! (defconst tramp-version "2.0.30"
    "This version of tramp.")
  
  (defconst tramp-bug-report-address "address@hidden"
***************
*** 95,101 ****
  (unless (fboundp 'uudecode-decode-region)
    (autoload 'uudecode-decode-region "uudecode"))
  
! ;; ;; It does not work to load EFS after loading TRAMP.
  ;; (when (fboundp 'efs-file-handler-function)
  ;;   (require 'efs))
  
--- 95,101 ----
  (unless (fboundp 'uudecode-decode-region)
    (autoload 'uudecode-decode-region "uudecode"))
  
! ;; ;; It does not work to load EFS after loading TRAMP.  
  ;; (when (fboundp 'efs-file-handler-function)
  ;;   (require 'efs))
  
***************
*** 110,116 ****
  ;; tramp-smb uses "smbclient" from Samba.
  ;; Not available under Cygwin and Windows, because they don't offer
  ;; "smbclient".  And even not necessary there, because Emacs supports
! ;; UNC file names like "//host/share/path".
  (unless (memq system-type '(cygwin windows-nt))
    (eval-after-load "tramp"
      '(require 'tramp-smb)))
--- 110,116 ----
  ;; tramp-smb uses "smbclient" from Samba.
  ;; Not available under Cygwin and Windows, because they don't offer
  ;; "smbclient".  And even not necessary there, because Emacs supports
! ;; UNC file names like "//host/share/localname".
  (unless (memq system-type '(cygwin windows-nt))
    (eval-after-load "tramp"
      '(require 'tramp-smb)))
***************
*** 489,495 ****
              (tramp-su-args              nil)
              (tramp-telnet-program       nil)
                (tramp-telnet-args          nil))
!      ("fcp"
              (tramp-connection-function  tramp-open-connection-rsh)
                (tramp-rsh-program          "fsh")
                (tramp-rcp-program          "fcp")
--- 489,495 ----
              (tramp-su-args              nil)
              (tramp-telnet-program       nil)
                (tramp-telnet-args          nil))
!      ("fcp"   
              (tramp-connection-function  tramp-open-connection-rsh)
                (tramp-rsh-program          "fsh")
                (tramp-rcp-program          "fcp")
***************
*** 520,526 ****
      the value that you decide to use.  You Have Been Warned.
    * `tramp-rsh-program'
      This specifies the name of the program to use for rsh; this might be
!     the full path to rsh or the name of a workalike program.
    * `tramp-rsh-args'
      This specifies the list of arguments to pass to the above
      mentioned program.  Please note that this is a list of arguments,
--- 520,526 ----
      the value that you decide to use.  You Have Been Warned.
    * `tramp-rsh-program'
      This specifies the name of the program to use for rsh; this might be
!     the absolute filename of rsh or the name of a workalike program.
    * `tramp-rsh-args'
      This specifies the list of arguments to pass to the above
      mentioned program.  Please note that this is a list of arguments,
***************
*** 529,535 ****
      for \"-b\", or one for \"-f\" and one for \"foo\".
    * `tramp-rcp-program'
      This specifies the name of the program to use for rcp; this might be
!     the full path to rcp or the name of a workalike program.
    * `tramp-rcp-args'
      This specifies the list of parameters to pass to the above mentioned
      program, the hints for `tramp-rsh-args' also apply here.
--- 529,535 ----
      for \"-b\", or one for \"-f\" and one for \"foo\".
    * `tramp-rcp-program'
      This specifies the name of the program to use for rcp; this might be
!     the absolute filename of rcp or the name of a workalike program.
    * `tramp-rcp-args'
      This specifies the list of parameters to pass to the above mentioned
      program, the hints for `tramp-rsh-args' also apply here.
***************
*** 942,948 ****
  
  (defcustom tramp-postfix-multi-hop-format
    (if tramp-unified-filenames ":" "/")
!   "*String matching delimeter between path and next method.
  Applicable for multi-hop methods.
  Used in `tramp-make-tramp-multi-file-name'."
    :group 'tramp
--- 942,948 ----
  
  (defcustom tramp-postfix-multi-hop-format
    (if tramp-unified-filenames ":" "/")
!   "*String matching delimeter between host and next method.
  Applicable for multi-hop methods.
  Used in `tramp-make-tramp-multi-file-name'."
    :group 'tramp
***************
*** 950,956 ****
  
  (defcustom tramp-postfix-multi-hop-regexp
    (regexp-quote tramp-postfix-multi-hop-format)
!   "*Regexp matching delimeter between path and next method.
  Applicable for multi-hop methods.
  Derived from `tramp-postfix-multi-hop-format'."
    :group 'tramp
--- 950,956 ----
  
  (defcustom tramp-postfix-multi-hop-regexp
    (regexp-quote tramp-postfix-multi-hop-format)
!   "*Regexp matching delimeter between host and next method.
  Applicable for multi-hop methods.
  Derived from `tramp-postfix-multi-hop-format'."
    :group 'tramp
***************
*** 990,1010 ****
  
  (defcustom tramp-postfix-host-format
    (if tramp-unified-filenames ":" "]")
!   "*String matching delimeter between host names and paths.
  Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'."
    :group 'tramp
    :type 'string)
  
  (defcustom tramp-postfix-host-regexp
    (regexp-quote tramp-postfix-host-format)
!   "*Regexp matching delimeter between host names and paths.
  Derived from `tramp-postfix-host-format'."
    :group 'tramp
    :type 'regexp)
  
! (defcustom tramp-path-regexp
    ".*$"
!   "*Regexp matching paths."
    :group 'tramp
    :type 'regexp)
  
--- 990,1010 ----
  
  (defcustom tramp-postfix-host-format
    (if tramp-unified-filenames ":" "]")
!   "*String matching delimeter between host names and localnames.
  Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'."
    :group 'tramp
    :type 'string)
  
  (defcustom tramp-postfix-host-regexp
    (regexp-quote tramp-postfix-host-format)
!   "*Regexp matching delimeter between host names and localnames.
  Derived from `tramp-postfix-host-format'."
    :group 'tramp
    :type 'regexp)
  
! (defcustom tramp-localname-regexp
    ".*$"
!   "*Regexp matching localnames."
    :group 'tramp
    :type 'regexp)
  
***************
*** 1017,1023 ****
      "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp 
"\\)?"
      "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp   "\\)?"
            "\\(" tramp-host-with-port-regexp "\\)" tramp-postfix-host-regexp
!         "\\(" tramp-path-regexp "\\)")
     2 4 5 6)
  
    "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
--- 1017,1023 ----
      "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp 
"\\)?"
      "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp   "\\)?"
            "\\(" tramp-host-with-port-regexp "\\)" tramp-postfix-host-regexp
!         "\\(" tramp-localname-regexp "\\)")
     2 4 5 6)
  
    "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
***************
*** 1115,1125 ****
      tramp-prefix-regexp
      "\\(" "\\(" tramp-method-regexp "\\)" "\\)?"
      "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?"
!     tramp-postfix-host-regexp "\\(" tramp-path-regexp "\\)")
     2 3 -1)
    "*Describes the file name structure of `multi' files.
  Multi files allow you to contact a remote host in several hops.
! This is a list of four elements (REGEXP METHOD HOP PATH).
  
  The first element, REGEXP, gives a regular expression to match against
  the file name.  In this regular expression, `%s' is replaced with the
--- 1115,1125 ----
      tramp-prefix-regexp
      "\\(" "\\(" tramp-method-regexp "\\)" "\\)?"
      "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?"
!     tramp-postfix-host-regexp "\\(" tramp-localname-regexp "\\)")
     2 3 -1)
    "*Describes the file name structure of `multi' files.
  Multi files allow you to contact a remote host in several hops.
! This is a list of four elements (REGEXP METHOD HOP LOCALNAME).
  
  The first element, REGEXP, gives a regular expression to match against
  the file name.  In this regular expression, `%s' is replaced with the
***************
*** 1130,1139 ****
  
  All remaining elements are numbers.  METHOD gives the number of the
  paren pair which matches the method name.  HOP gives the number of the
! paren pair which matches the hop sequence.  PATH gives the number of
! the paren pair which matches the path name on the remote host.
  
! PATH can also be negative, which means to count from the end.  Ie, a
  value of -1 means the last paren pair.
  
  I think it would be good if the regexp matches the whole of the
--- 1130,1139 ----
  
  All remaining elements are numbers.  METHOD gives the number of the
  paren pair which matches the method name.  HOP gives the number of the
! paren pair which matches the hop sequence.  LOCALNAME gives the number of
! the paren pair which matches the localname (pathname) on the remote host.
  
! LOCALNAME can also be negative, which means to count from the end.  Ie, a
  value of -1 means the last paren pair.
  
  I think it would be good if the regexp matches the whole of the
***************
*** 1142,1148 ****
    :type '(list (regexp :tag "File name regexp")
                 (integer :tag "Paren pair for method name")
                 (integer :tag "Paren pair for hops")
!                (integer :tag "Paren pair to match path")))
  
  (defcustom tramp-multi-file-name-hop-structure
    (list
--- 1142,1148 ----
    :type '(list (regexp :tag "File name regexp")
                 (integer :tag "Paren pair for method name")
                 (integer :tag "Paren pair for hops")
!                (integer :tag "Paren pair to match localname")))
  
  (defcustom tramp-multi-file-name-hop-structure
    (list
***************
*** 1173,1197 ****
      "%h")
     (concat tramp-postfix-host-format "%p"))
    "*Describes how to construct a `multi' file name.
! This is a list of three elements PREFIX, HOP and PATH.
  
  The first element PREFIX says how to construct the prefix, the second
  element HOP specifies what each hop looks like, and the final element
! PATH says how to construct the path name.
  
  In PREFIX, `%%' means `%' and `%m' means the method name.
  
  In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop
  user and hop host, respectively.
  
! In PATH, `%%' means `%' and `%p' means the path name.
  
  The resulting file name always contains one copy of PREFIX and one
! copy of PATH, but there is one copy of HOP for each hop in the file
  name.
  
  Note: the current implementation requires the prefix to contain the
! method name, followed by all the hops, and the path name must come
  last."
    :group 'tramp
    :type '(list string string string))
--- 1173,1197 ----
      "%h")
     (concat tramp-postfix-host-format "%p"))
    "*Describes how to construct a `multi' file name.
! This is a list of three elements PREFIX, HOP and LOCALNAME.
  
  The first element PREFIX says how to construct the prefix, the second
  element HOP specifies what each hop looks like, and the final element
! LOCALNAME says how to construct the localname (pathname).
  
  In PREFIX, `%%' means `%' and `%m' means the method name.
  
  In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop
  user and hop host, respectively.
  
! In LOCALNAME, `%%' means `%' and `%p' means the localname.
  
  The resulting file name always contains one copy of PREFIX and one
! copy of LOCALNAME, but there is one copy of HOP for each hop in the file
  name.
  
  Note: the current implementation requires the prefix to contain the
! method name, followed by all the hops, and the localname must come
  last."
    :group 'tramp
    :type '(list string string string))
***************
*** 1249,1254 ****
--- 1249,1282 ----
    :group 'tramp
    :type '(repeat (list variable function)))
  
+ ;; Chunked sending kluge.  We set this to 500 for black-listed constellations
+ ;; known to have a bug in `process-send-string'; some ssh connections appear
+ ;; to drop bytes when data is sent too quickly.
+ (defcustom tramp-chunksize
+   (when (and (not (featurep 'xemacs))
+            (memq system-type '(hpux)))
+     500)
+   "*If non-nil, chunksize for sending input to local process.
+ It is necessary only on systems which have a buggy `process-send-string'
+ implementation.  The necessity, whether this variable must be set, can be
+ 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))))
+ 
+ Please raise a bug report via \"M-x tramp-bug\" if your system needs
+ this variable to be set as well."
+   :group 'tramp
+   :type 'integer)
+ 
  ;;; Internal Variables:
  
  (defvar tramp-buffer-file-attributes nil
***************
*** 1708,1720 ****
  holding the components.  For example, if VAR is the symbol `foo', then
  `foo' will be bound to the whole structure, `foo-multi-method' will
  be bound to the multi-method component, and so on for `foo-method',
! `foo-user', `foo-host', `foo-path'.
  
  Remaining args are Lisp expressions to be evaluated (inside an implicit
  `progn').
  
  If VAR is nil, then we bind `v' to the structure and `multi-method',
! `method', `user', `host', `path' to the components."
    `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename))
          (,(if var (intern (concat (symbol-name var) "-multi-method")) 
'multi-method)
           (tramp-file-name-multi-method ,(or var 'v)))
--- 1736,1748 ----
  holding the components.  For example, if VAR is the symbol `foo', then
  `foo' will be bound to the whole structure, `foo-multi-method' will
  be bound to the multi-method component, and so on for `foo-method',
! `foo-user', `foo-host', `foo-localname'.
  
  Remaining args are Lisp expressions to be evaluated (inside an implicit
  `progn').
  
  If VAR is nil, then we bind `v' to the structure and `multi-method',
! `method', `user', `host', `localname' to the components."
    `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename))
          (,(if var (intern (concat (symbol-name var) "-multi-method")) 
'multi-method)
           (tramp-file-name-multi-method ,(or var 'v)))
***************
*** 1724,1731 ****
           (tramp-file-name-user ,(or var 'v)))
          (,(if var (intern (concat (symbol-name var) "-host")) 'host)
           (tramp-file-name-host ,(or var 'v)))
!         (,(if var (intern (concat (symbol-name var) "-path")) 'path)
!          (tramp-file-name-path ,(or var 'v))))
       ,@body))
  
  (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
--- 1752,1759 ----
           (tramp-file-name-user ,(or var 'v)))
          (,(if var (intern (concat (symbol-name var) "-host")) 'host)
           (tramp-file-name-host ,(or var 'v)))
!         (,(if var (intern (concat (symbol-name var) "-localname")) 'localname)
!          (tramp-file-name-localname ,(or var 'v))))
       ,@body))
  
  (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
***************
*** 1764,1779 ****
    (filename linkname &optional ok-if-already-exists)
    "Like `make-symbolic-link' for tramp files.
  If LINKNAME is a non-Tramp file, it is used verbatim as the target of
! the symlink.  If LINKNAME is a Tramp file, only the path component is
  used as the target of the symlink.
  
! If LINKNAME is a Tramp file and the path component is relative, then
! it is expanded first, before the path component is taken.  Note that
  this can give surprising results if the user/host for the source and
  target of the symlink differ."
    (with-parsed-tramp-file-name linkname l
      (let ((ln (tramp-get-remote-ln l-multi-method l-method l-user l-host))
!         (cwd (file-name-directory l-path)))
        (unless ln
        (signal 'file-error
                (list "Making a symbolic link."
--- 1792,1807 ----
    (filename linkname &optional ok-if-already-exists)
    "Like `make-symbolic-link' for tramp files.
  If LINKNAME is a non-Tramp file, it is used verbatim as the target of
! the symlink.  If LINKNAME is a Tramp file, only the localname component is
  used as the target of the symlink.
  
! If LINKNAME is a Tramp file and the localname component is relative, then
! it is expanded first, before the localname component is taken.  Note that
  this can give surprising results if the user/host for the source and
  target of the symlink differ."
    (with-parsed-tramp-file-name linkname l
      (let ((ln (tramp-get-remote-ln l-multi-method l-method l-user l-host))
!         (cwd (file-name-directory l-localname)))
        (unless ln
        (signal 'file-error
                (list "Making a symbolic link."
***************
*** 1787,1802 ****
                     (not (yes-or-no-p
                           (format
                            "File %s already exists; make it a link anyway? "
!                           l-path)))))
!           (signal 'file-already-exists (list "File already exists" l-path))
          (delete-file linkname)))
  
!       ;; If FILENAME is a Tramp name, use just the path component.
        (when (tramp-tramp-file-p filename)
!       (setq filename (tramp-file-name-path
                        (tramp-dissect-file-name
                         (expand-file-name filename)))))
! 
        ;; Right, they are on the same host, regardless of user, method, etc.
        ;; We now make the link on the remote machine. This will occur as the 
user
        ;; that FILENAME belongs to.
--- 1815,1830 ----
                     (not (yes-or-no-p
                           (format
                            "File %s already exists; make it a link anyway? "
!                           l-localname)))))
!           (signal 'file-already-exists (list "File already exists" 
l-localname))
          (delete-file linkname)))
  
!       ;; If FILENAME is a Tramp name, use just the localname component.
        (when (tramp-tramp-file-p filename)
!       (setq filename (tramp-file-name-localname
                        (tramp-dissect-file-name
                         (expand-file-name filename)))))
!     
        ;; Right, they are on the same host, regardless of user, method, etc.
        ;; We now make the link on the remote machine. This will occur as the 
user
        ;; that FILENAME belongs to.
***************
*** 1805,1819 ****
        l-multi-method l-method l-user l-host
        (format "cd %s && %s -sf %s %s"
                cwd ln
!               filename
!               l-path)
        t)))))
  
  
  (defun tramp-handle-load (file &optional noerror nomessage nosuffix 
must-suffix)
    "Like `load' for tramp files.  Not implemented!"
    (unless (file-name-absolute-p file)
!     (error "Tramp cannot `load' files without absolute path name"))
    (with-parsed-tramp-file-name file nil
      (unless nosuffix
        (cond ((file-exists-p (concat file ".elc"))
--- 1833,1847 ----
        l-multi-method l-method l-user l-host
        (format "cd %s && %s -sf %s %s"
                cwd ln
!               filename 
!               l-localname)
        t)))))
  
  
  (defun tramp-handle-load (file &optional noerror nomessage nosuffix 
must-suffix)
    "Like `load' for tramp files.  Not implemented!"
    (unless (file-name-absolute-p file)
!     (error "Tramp cannot `load' files without absolute file name"))
    (with-parsed-tramp-file-name file nil
      (unless nosuffix
        (cond ((file-exists-p (concat file ".elc"))
***************
*** 1842,1885 ****
        (message "Loading %s...done" file))
        t)))
  
! ;; Path manipulation functions that grok TRAMP paths...
  (defun tramp-handle-file-name-directory (file)
    "Like `file-name-directory' but aware of TRAMP files."
    ;; everything except the last filename thing is the directory
    (with-parsed-tramp-file-name file nil
      ;; For the following condition, two possibilities should be tried:
!     ;; (1) (string= path "")
!     ;; (2) (or (string= path "") (string= path "/"))
      ;; The second variant fails when completing a "/" directory on
      ;; the remote host, that is a filename which looks like
      ;; "/address@hidden:/".  But maybe wildcards fail with the first variant.
      ;; We should do some investigation.
!     (if (string= path "")
        ;; For a filename like "/[foo]", we return "/".  The `else'
        ;; case would return "/[foo]" unchanged.  But if we do that,
        ;; then `file-expand-wildcards' ceases to work.  It's not
        ;; quite clear to me what's the intuition that tells that this
        ;; behavior is the right behavior, but oh, well.
        "/"
!       ;; run the command on the path portion only
        ;; CCC: This should take into account the remote machine type, no?
        ;;  --daniel <address@hidden>
        (tramp-make-tramp-file-name multi-method method user host
                                  ;; This will not recurse...
!                                 (or (file-name-directory path) "")))))
  
  (defun tramp-handle-file-name-nondirectory (file)
    "Like `file-name-nondirectory' but aware of TRAMP files."
    (with-parsed-tramp-file-name file nil
!     (file-name-nondirectory path)))
  
  (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
    "Like `file-truename' for tramp files."
    (with-parsed-tramp-file-name filename nil
!     (let* ((steps        (tramp-split-string path "/"))
!          (pathdir (let ((directory-sep-char ?/))
!                     (file-name-as-directory path)))
!          (is-dir (string= path pathdir))
           (thisstep nil)
           (numchase 0)
           ;; Don't make the following value larger than necessary.
--- 1870,1913 ----
        (message "Loading %s...done" file))
        t)))
  
! ;; Localname manipulation functions that grok TRAMP localnames...
  (defun tramp-handle-file-name-directory (file)
    "Like `file-name-directory' but aware of TRAMP files."
    ;; everything except the last filename thing is the directory
    (with-parsed-tramp-file-name file nil
      ;; For the following condition, two possibilities should be tried:
!     ;; (1) (string= localname "")
!     ;; (2) (or (string= localname "") (string= localname "/"))
      ;; The second variant fails when completing a "/" directory on
      ;; the remote host, that is a filename which looks like
      ;; "/address@hidden:/".  But maybe wildcards fail with the first variant.
      ;; We should do some investigation.
!     (if (string= localname "")
        ;; For a filename like "/[foo]", we return "/".  The `else'
        ;; case would return "/[foo]" unchanged.  But if we do that,
        ;; then `file-expand-wildcards' ceases to work.  It's not
        ;; quite clear to me what's the intuition that tells that this
        ;; behavior is the right behavior, but oh, well.
        "/"
!       ;; run the command on the localname portion only
        ;; CCC: This should take into account the remote machine type, no?
        ;;  --daniel <address@hidden>
        (tramp-make-tramp-file-name multi-method method user host
                                  ;; This will not recurse...
!                                 (or (file-name-directory localname) "")))))
  
  (defun tramp-handle-file-name-nondirectory (file)
    "Like `file-name-nondirectory' but aware of TRAMP files."
    (with-parsed-tramp-file-name file nil
!     (file-name-nondirectory localname)))
  
  (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
    "Like `file-truename' for tramp files."
    (with-parsed-tramp-file-name filename nil
!     (let* ((steps        (tramp-split-string localname "/"))
!          (localnamedir (let ((directory-sep-char ?/))
!                     (file-name-as-directory localname)))
!          (is-dir (string= localname localnamedir))
           (thisstep nil)
           (numchase 0)
           ;; Don't make the following value larger than necessary.
***************
*** 1956,1962 ****
              multi-method method user host
              (format
               (tramp-get-file-exists-command multi-method method user host)
!              (tramp-shell-quote-argument path)))))))
  
  ;; Devices must distinguish physical file systems.  The device numbers
  ;; provided by "lstat" aren't unique, because we operate on different hosts.
--- 1984,1990 ----
              multi-method method user host
              (format
               (tramp-get-file-exists-command multi-method method user host)
!              (tramp-shell-quote-argument localname)))))))
  
  ;; Devices must distinguish physical file systems.  The device numbers
  ;; provided by "lstat" aren't unique, because we operate on different hosts.
***************
*** 1981,1997 ****
          (if (tramp-get-remote-perl multi-method method user host)
              (setq result
                    (tramp-handle-file-attributes-with-perl
!                    multi-method method user host path nonnumeric))
            (setq result
                  (tramp-handle-file-attributes-with-ls
!                  multi-method method user host path nonnumeric)))
          ;; set virtual device number
          (setcar (nthcdr 11 result)
                  (tramp-get-device multi-method method user host)))))
      result))
  
  (defun tramp-handle-file-attributes-with-ls
!   (multi-method method user host path &optional nonnumeric)
    "Implement `file-attributes' for tramp files using the ls(1) command."
    (let (symlinkp dirp
                 res-inode res-filemodes res-numlinks
--- 2009,2025 ----
          (if (tramp-get-remote-perl multi-method method user host)
              (setq result
                    (tramp-handle-file-attributes-with-perl
!                    multi-method method user host localname nonnumeric))
            (setq result
                  (tramp-handle-file-attributes-with-ls
!                  multi-method method user host localname nonnumeric)))
          ;; set virtual device number
          (setcar (nthcdr 11 result)
                  (tramp-get-device multi-method method user host)))))
      result))
  
  (defun tramp-handle-file-attributes-with-ls
!   (multi-method method user host localname &optional nonnumeric)
    "Implement `file-attributes' for tramp files using the ls(1) command."
    (let (symlinkp dirp
                 res-inode res-filemodes res-numlinks
***************
*** 1999,2011 ****
      (tramp-message-for-buffer multi-method method user host 10
                              "file attributes with ls: %s"
                              (tramp-make-tramp-file-name
!                              multi-method method user host path))
      (tramp-send-command
       multi-method method user host
       (format "%s %s %s"
             (tramp-get-ls-command multi-method method user host)
             (if nonnumeric "-ild" "-ildn")
!            (tramp-shell-quote-argument path)))
      (tramp-wait-for-output)
      ;; parse `ls -l' output ...
      ;; ... inode
--- 2027,2039 ----
      (tramp-message-for-buffer multi-method method user host 10
                              "file attributes with ls: %s"
                              (tramp-make-tramp-file-name
!                              multi-method method user host localname))
      (tramp-send-command
       multi-method method user host
       (format "%s %s %s"
             (tramp-get-ls-command multi-method method user host)
             (if nonnumeric "-ild" "-ildn")
!            (tramp-shell-quote-argument localname)))
      (tramp-wait-for-output)
      ;; parse `ls -l' output ...
      ;; ... inode
***************
*** 2076,2082 ****
       )))
  
  (defun tramp-handle-file-attributes-with-perl
!   (multi-method method user host path &optional nonnumeric)
    "Implement `file-attributes' for tramp files using a Perl script.
  
  The Perl command is sent to the remote machine when the connection
--- 2104,2110 ----
       )))
  
  (defun tramp-handle-file-attributes-with-perl
!   (multi-method method user host localname &optional nonnumeric)
    "Implement `file-attributes' for tramp files using a Perl script.
  
  The Perl command is sent to the remote machine when the connection
***************
*** 2084,2094 ****
    (tramp-message-for-buffer multi-method method user host 10
                            "file attributes with perl: %s"
                            (tramp-make-tramp-file-name
!                            multi-method method user host path))
    (tramp-send-command
     multi-method method user host
!    (format "tramp_file_attributes %s"
!          (tramp-shell-quote-argument path)))
    (tramp-wait-for-output)
    (let ((result (read (current-buffer))))
      (setcar (nthcdr 8 result)
--- 2112,2122 ----
    (tramp-message-for-buffer multi-method method user host 10
                            "file attributes with perl: %s"
                            (tramp-make-tramp-file-name
!                            multi-method method user host localname))
    (tramp-send-command
     multi-method method user host
!    (format "tramp_file_attributes %s" 
!          (tramp-shell-quote-argument localname)))
    (tramp-wait-for-output)
    (let ((result (read (current-buffer))))
      (setcar (nthcdr 8 result)
***************
*** 2127,2133 ****
             multi-method method user host
             (format "%s -ild %s"
                     (tramp-get-ls-command multi-method method user host)
!                    (tramp-shell-quote-argument path)))
            (tramp-wait-for-output)
            (setq attr (buffer-substring (point)
                                         (progn (end-of-line) (point)))))
--- 2155,2161 ----
             multi-method method user host
             (format "%s -ild %s"
                     (tramp-get-ls-command multi-method method user host)
!                    (tramp-shell-quote-argument localname)))
            (tramp-wait-for-output)
            (setq attr (buffer-substring (point)
                                         (progn (end-of-line) (point)))))
***************
*** 2161,2167 ****
                    (format "%s -ild %s"
                            (tramp-get-ls-command multi-method method
                                                  user host)
!                           (tramp-shell-quote-argument path)))
                   (tramp-wait-for-output)
                   (setq attr (buffer-substring
                               (point) (progn (end-of-line) (point)))))
--- 2189,2195 ----
                    (format "%s -ild %s"
                            (tramp-get-ls-command multi-method method
                                                  user host)
!                           (tramp-shell-quote-argument localname)))
                   (tramp-wait-for-output)
                   (setq attr (buffer-substring
                               (point) (progn (end-of-line) (point)))))
***************
*** 2183,2189 ****
                      multi-method method user host
                      (format "chmod %s %s"
                              (tramp-decimal-to-octal mode)
!                             (tramp-shell-quote-argument path))))
        (signal 'file-error
                (list "Doing chmod"
                      ;; FIXME: extract the proper text from chmod's stderr.
--- 2211,2217 ----
                      multi-method method user host
                      (format "chmod %s %s"
                              (tramp-decimal-to-octal mode)
!                             (tramp-shell-quote-argument localname))))
        (signal 'file-error
                (list "Doing chmod"
                      ;; FIXME: extract the proper text from chmod's stderr.
***************
*** 2288,2294 ****
         (tramp-send-command-and-check
        multi-method method user host
        (format "test -d %s"
!               (tramp-shell-quote-argument path))
        t)))))                          ;run command in subshell
  
  (defun tramp-handle-file-regular-p (filename)
--- 2316,2322 ----
         (tramp-send-command-and-check
        multi-method method user host
        (format "test -d %s"
!               (tramp-shell-quote-argument localname))
        t)))))                          ;run command in subshell
  
  (defun tramp-handle-file-regular-p (filename)
***************
*** 2346,2359 ****
  
  (defun tramp-handle-directory-file-name (directory)
    "Like `directory-file-name' for tramp files."
!   ;; If path component of filename is "/", leave it unchanged.
!   ;; Otherwise, remove any trailing slash from path component.
    ;; Method, host, etc, are unchanged.  Does it make sense to try
    ;; to avoid parsing the filename?
    (with-parsed-tramp-file-name directory nil
!     (if (and (not (zerop (length path)))
!            (eq (aref path (1- (length path))) ?/)
!            (not (string= path "/")))
        (substring directory 0 -1)
        directory)))
  
--- 2374,2387 ----
  
  (defun tramp-handle-directory-file-name (directory)
    "Like `directory-file-name' for tramp files."
!   ;; If localname component of filename is "/", leave it unchanged.
!   ;; Otherwise, remove any trailing slash from localname component.
    ;; Method, host, etc, are unchanged.  Does it make sense to try
    ;; to avoid parsing the filename?
    (with-parsed-tramp-file-name directory nil
!     (if (and (not (zerop (length localname)))
!            (eq (aref localname (1- (length localname))) ?/)
!            (not (string= localname "/")))
        (substring directory 0 -1)
        directory)))
  
***************
*** 2367,2377 ****
        (save-excursion
        (tramp-barf-unless-okay
         multi-method method user host
!        (concat "cd " (tramp-shell-quote-argument path))
         nil
         'file-error
         "tramp-handle-directory-files: couldn't `cd %s'"
!        (tramp-shell-quote-argument path))
        (tramp-send-command
         multi-method method user host
         (concat (tramp-get-ls-command multi-method method user host)
--- 2395,2405 ----
        (save-excursion
        (tramp-barf-unless-okay
         multi-method method user host
!        (concat "cd " (tramp-shell-quote-argument localname))
         nil
         'file-error
         "tramp-handle-directory-files: couldn't `cd %s'"
!        (tramp-shell-quote-argument localname))
        (tramp-send-command
         multi-method method user host
         (concat (tramp-get-ls-command multi-method method user host)
***************
*** 2423,2432 ****
        (save-excursion
          (tramp-barf-unless-okay
           multi-method method user host
!          (format "cd %s" (tramp-shell-quote-argument path))
           nil 'file-error
           "tramp-handle-file-name-all-completions: Couldn't `cd %s'"
!          (tramp-shell-quote-argument path))
  
          ;; Get a list of directories and files, including reliably
          ;; tagging the directories with a trailing '/'.  Because I
--- 2451,2460 ----
        (save-excursion
          (tramp-barf-unless-okay
           multi-method method user host
!          (format "cd %s" (tramp-shell-quote-argument localname))
           nil 'file-error
           "tramp-handle-file-name-all-completions: Couldn't `cd %s'"
!          (tramp-shell-quote-argument localname))
  
          ;; Get a list of directories and files, including reliably
          ;; tagging the directories with a trailing '/'.  Because I
***************
*** 2449,2455 ****
            (push (buffer-substring (point)
                                    (tramp-line-end-position))
                  result))
! 
          (tramp-send-command multi-method method user host "cd")
          (tramp-wait-for-output)
  
--- 2477,2483 ----
            (push (buffer-substring (point)
                                    (tramp-line-end-position))
                  result))
!       
          (tramp-send-command multi-method method user host "cd")
          (tramp-wait-for-output)
  
***************
*** 2498,2505 ****
          (error "add-name-to-file: file %s already exists" newname))
        (tramp-barf-unless-okay
         v1-multi-method v1-method v1-user v1-host
!        (format "%s %s %s" ln (tramp-shell-quote-argument v1-path)
!                (tramp-shell-quote-argument v2-path))
         nil 'file-error
         "error with add-name-to-file, see buffer `%s' for details"
         (buffer-name))))))
--- 2526,2533 ----
          (error "add-name-to-file: file %s already exists" newname))
        (tramp-barf-unless-okay
         v1-multi-method v1-method v1-user v1-host
!        (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname)
!                (tramp-shell-quote-argument v2-localname))
         nil 'file-error
         "error with add-name-to-file, see buffer `%s' for details"
         (buffer-name))))))
***************
*** 2572,2578 ****
              ;; directly.
              (tramp-do-copy-or-rename-file-directly
               op v1-multi-method v1-method v1-user v1-host
!              v1-path v2-path keep-date)
            ;; The shortcut was not possible.  So we copy the
            ;; file first.  If the operation was `rename', we go
            ;; back and delete the original file (if the copy was
--- 2600,2606 ----
              ;; directly.
              (tramp-do-copy-or-rename-file-directly
               op v1-multi-method v1-method v1-user v1-host
!              v1-localname v2-localname keep-date)
            ;; The shortcut was not possible.  So we copy the
            ;; file first.  If the operation was `rename', we go
            ;; back and delete the original file (if the copy was
***************
*** 2590,2602 ****
            ;; directory if we want to invoke rcp.
            (tramp-do-copy-or-rename-via-buffer
             op filename newname keep-date)))))
!         ((or t1 t2)
!          ;; Use the generic method via a Tramp buffer.
!          (tramp-do-copy-or-rename-via-buffer op filename newname keep-date))
!         (t
!          ;; One of them must be a Tramp file.
!          (error "Tramp implementation says this cannot happen")))))
  
  (defun tramp-do-copy-or-rename-via-buffer (op filename newname keep-date)
    "Use an Emacs buffer to copy or rename a file.
  First arg OP is either `copy' or `rename' and indicates the operation.
--- 2618,2631 ----
            ;; directory if we want to invoke rcp.
            (tramp-do-copy-or-rename-via-buffer
             op filename newname keep-date)))))
!      ((or t1 t2)
!       ;; Use the generic method via a Tramp buffer.
!       (tramp-do-copy-or-rename-via-buffer op filename newname keep-date))
!      (t
!       ;; One of them must be a Tramp file.
!       (error "Tramp implementation says this cannot happen")))))
  
+ ;; CCC: implement keep-date if possible -- via touch?
  (defun tramp-do-copy-or-rename-via-buffer (op filename newname keep-date)
    "Use an Emacs buffer to copy or rename a file.
  First arg OP is either `copy' or `rename' and indicates the operation.
***************
*** 2617,2627 ****
        (delete-file filename))))
  
  (defun tramp-do-copy-or-rename-file-directly
!   (op multi-method method user host path1 path2 keep-date)
    "Invokes `cp' or `mv' on the remote system.
  OP must be one of `copy' or `rename', indicating `cp' or `mv',
  respectively.  METHOD, USER, and HOST specify the connection.
! PATH1 and PATH2 specify the two arguments of `cp' or `mv'.
  If KEEP-DATE is non-nil, preserve the time stamp when copying."
    ;; CCC: What happens to the timestamp when renaming?
    (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p")
--- 2646,2656 ----
        (delete-file filename))))
  
  (defun tramp-do-copy-or-rename-file-directly
!   (op multi-method method user host localname1 localname2 keep-date)
    "Invokes `cp' or `mv' on the remote system.
  OP must be one of `copy' or `rename', indicating `cp' or `mv',
  respectively.  METHOD, USER, and HOST specify the connection.
! LOCALNAME1 and LOCALNAME2 specify the two arguments of `cp' or `mv'.
  If KEEP-DATE is non-nil, preserve the time stamp when copying."
    ;; CCC: What happens to the timestamp when renaming?
    (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p")
***************
*** 2635,2646 ****
         multi-method method user host
         (format "%s %s %s"
                 cmd
!                (tramp-shell-quote-argument path1)
!                (tramp-shell-quote-argument path2))
         nil 'file-error
         "Copying directly failed, see buffer `%s' for details."
         (buffer-name)))))
  
  ;; mkdir
  (defun tramp-handle-make-directory (dir &optional parents)
    "Like `make-directory' for tramp files."
--- 2664,2683 ----
         multi-method method user host
         (format "%s %s %s"
                 cmd
!                (tramp-shell-quote-argument localname1)
!                (tramp-shell-quote-argument localname2))
         nil 'file-error
         "Copying directly failed, see buffer `%s' for details."
         (buffer-name)))))
  
+ (defun tramp-do-copy-or-rename-file-one-local
+   (op filename newname keep-date)
+   "Invoke rcp program to copy.
+ One of FILENAME and NEWNAME must be a Tramp name, the other must
+ be a local filename.  The method used must be an out-of-band method."
+   ;; CCC
+   )
+ 
  ;; mkdir
  (defun tramp-handle-make-directory (dir &optional parents)
    "Like `make-directory' for tramp files."
***************
*** 2651,2657 ****
         multi-method method user host
         (format " %s %s"
               (if parents "mkdir -p" "mkdir")
!              (tramp-shell-quote-argument path))
         nil 'file-error
         "Couldn't make directory %s" dir))))
  
--- 2688,2694 ----
         multi-method method user host
         (format " %s %s"
               (if parents "mkdir -p" "mkdir")
!              (tramp-shell-quote-argument localname))
         nil 'file-error
         "Couldn't make directory %s" dir))))
  
***************
*** 2664,2670 ****
        (tramp-send-command
         multi-method method user host
         (format "rmdir %s ; echo ok"
!              (tramp-shell-quote-argument path)))
        (tramp-wait-for-output))))
  
  (defun tramp-handle-delete-file (filename)
--- 2701,2707 ----
        (tramp-send-command
         multi-method method user host
         (format "rmdir %s ; echo ok"
!              (tramp-shell-quote-argument localname)))
        (tramp-wait-for-output))))
  
  (defun tramp-handle-delete-file (filename)
***************
*** 2675,2681 ****
        (unless (zerop (tramp-send-command-and-check
                      multi-method method user host
                      (format "rm -f %s"
!                             (tramp-shell-quote-argument path))))
        (signal 'file-error "Couldn't delete Tramp file")))))
  
  ;; Dired.
--- 2712,2718 ----
        (unless (zerop (tramp-send-command-and-check
                      multi-method method user host
                      (format "rm -f %s"
!                             (tramp-shell-quote-argument localname))))
        (signal 'file-error "Couldn't delete Tramp file")))))
  
  ;; Dired.
***************
*** 2686,2707 ****
    "Recursively delete the directory given.
  This is like `dired-recursive-delete-directory' for tramp files."
    (with-parsed-tramp-file-name filename nil
!     ;; run a shell command 'rm -r <path>'
      ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
      (or (tramp-handle-file-exists-p filename)
        (signal
         'file-error
         (list "Removing old file name" "no such directory" filename)))
      ;; Which is better, -r or -R? (-r works for me <address@hidden>)
!     (tramp-send-command multi-method method user host
!                       (format "rm -r %s" (tramp-shell-quote-argument path)))
      ;; Wait for the remote system to return to us...
      ;; This might take a while, allow it plenty of time.
      (tramp-wait-for-output 120)
      ;; Make sure that it worked...
      (and (tramp-handle-file-exists-p filename)
         (error "Failed to recusively delete %s" filename))))
! 
  
  (defun tramp-handle-dired-call-process (program discard &rest arguments)
    "Like `dired-call-process' for tramp files."
--- 2723,2744 ----
    "Recursively delete the directory given.
  This is like `dired-recursive-delete-directory' for tramp files."
    (with-parsed-tramp-file-name filename nil
!     ;; run a shell command 'rm -r <localname>'
      ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
      (or (tramp-handle-file-exists-p filename)
        (signal
         'file-error
         (list "Removing old file name" "no such directory" filename)))
      ;; Which is better, -r or -R? (-r works for me <address@hidden>)
!     (tramp-send-command multi-method method user host 
!                       (format "rm -r %s" (tramp-shell-quote-argument 
localname)))
      ;; Wait for the remote system to return to us...
      ;; This might take a while, allow it plenty of time.
      (tramp-wait-for-output 120)
      ;; Make sure that it worked...
      (and (tramp-handle-file-exists-p filename)
         (error "Failed to recusively delete %s" filename))))
!        
  
  (defun tramp-handle-dired-call-process (program discard &rest arguments)
    "Like `dired-call-process' for tramp files."
***************
*** 2709,2718 ****
      (save-excursion
        (tramp-barf-unless-okay
         multi-method method user host
!        (format "cd %s" (tramp-shell-quote-argument path))
         nil 'file-error
         "tramp-handle-dired-call-process: Couldn't `cd %s'"
!        (tramp-shell-quote-argument path))
        (tramp-send-command
         multi-method method user host
         (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
--- 2746,2755 ----
      (save-excursion
        (tramp-barf-unless-okay
         multi-method method user host
!        (format "cd %s" (tramp-shell-quote-argument localname))
         nil 'file-error
         "tramp-handle-dired-call-process: Couldn't `cd %s'"
!        (tramp-shell-quote-argument localname))
        (tramp-send-command
         multi-method method user host
         (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
***************
*** 2754,2761 ****
       switches filename (if wildcard "yes" "no")
       (if full-directory-p "yes" "no"))
      (when wildcard
!       (setq wildcard (file-name-nondirectory path))
!       (setq path (file-name-directory path)))
      (when (listp switches)
        (setq switches (mapconcat 'identity switches " ")))
      (unless full-directory-p
--- 2791,2798 ----
       switches filename (if wildcard "yes" "no")
       (if full-directory-p "yes" "no"))
      (when wildcard
!       (setq wildcard (file-name-nondirectory localname))
!       (setq localname (file-name-directory localname)))
      (when (listp switches)
        (setq switches (mapconcat 'identity switches " ")))
      (unless full-directory-p
***************
*** 2772,2786 ****
                   (tramp-get-ls-command multi-method method user host)
                   switches
                   (if wildcard
!                      path
!                    (tramp-shell-quote-argument (concat path ".")))))
        (tramp-barf-unless-okay
         multi-method method user host
         (format "cd %s" (tramp-shell-quote-argument
!                         (file-name-directory path)))
         nil 'file-error
         "Couldn't `cd %s'"
!        (tramp-shell-quote-argument (file-name-directory path)))
        (tramp-send-command
         multi-method method user host
         (format "%s %s %s"
--- 2809,2823 ----
                   (tramp-get-ls-command multi-method method user host)
                   switches
                   (if wildcard
!                      localname
!                    (tramp-shell-quote-argument (concat localname ".")))))
        (tramp-barf-unless-okay
         multi-method method user host
         (format "cd %s" (tramp-shell-quote-argument
!                         (file-name-directory localname)))
         nil 'file-error
         "Couldn't `cd %s'"
!        (tramp-shell-quote-argument (file-name-directory localname)))
        (tramp-send-command
         multi-method method user host
         (format "%s %s %s"
***************
*** 2790,2797 ****
                     ;; Add "/." to make sure we got complete dir
                     ;; listing for symlinks, too.
                     (concat (file-name-as-directory
!                             (file-name-nondirectory path)) ".")
!                  (file-name-nondirectory path)))))
        (sit-for 1)                     ;needed for rsh but not ssh?
        (tramp-wait-for-output))
      (let ((old-pos (point)))
--- 2827,2834 ----
                     ;; Add "/." to make sure we got complete dir
                     ;; listing for symlinks, too.
                     (concat (file-name-as-directory
!                             (file-name-nondirectory localname)) ".")
!                  (file-name-nondirectory localname)))))
        (sit-for 1)                     ;needed for rsh but not ssh?
        (tramp-wait-for-output))
      (let ((old-pos (point)))
***************
*** 2844,2850 ****
      name))
  
  (defun tramp-handle-expand-file-name (name &optional dir)
!   "Like `expand-file-name' for tramp files."
    ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
    (setq dir (or dir default-directory "/"))
    ;; Unless NAME is absolute, concat DIR and NAME.
--- 2881,2889 ----
      name))
  
  (defun tramp-handle-expand-file-name (name &optional dir)
!   "Like `expand-file-name' for tramp files.
! If the localname part of the given filename starts with \"/../\" then
! the result will be a local, non-Tramp, filename."
    ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
    (setq dir (or dir default-directory "/"))
    ;; Unless NAME is absolute, concat DIR and NAME.
***************
*** 2856,2871 ****
                                (list name nil))
      ;; Dissect NAME.
      (with-parsed-tramp-file-name name nil
!       (unless (file-name-absolute-p path)
!       (setq path (concat "~/" path)))
        (save-excursion
        ;; Tilde expansion if necessary.  This needs a shell which
        ;; groks tilde expansion!  The function `tramp-find-shell' is
        ;; supposed to find such a shell on the remote host.  Please
        ;; tell me about it when this doesn't work on your system.
!       (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" path)
!         (let ((uname (match-string 1 path))
!               (fname (match-string 2 path)))
            ;; CCC fanatic error checking?
            (set-buffer (tramp-get-buffer multi-method method user host))
            (erase-buffer)
--- 2895,2910 ----
                                (list name nil))
      ;; Dissect NAME.
      (with-parsed-tramp-file-name name nil
!       (unless (file-name-absolute-p localname)
!       (setq localname (concat "~/" localname)))
        (save-excursion
        ;; Tilde expansion if necessary.  This needs a shell which
        ;; groks tilde expansion!  The function `tramp-find-shell' is
        ;; supposed to find such a shell on the remote host.  Please
        ;; tell me about it when this doesn't work on your system.
!       (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
!         (let ((uname (match-string 1 localname))
!               (fname (match-string 2 localname)))
            ;; CCC fanatic error checking?
            (set-buffer (tramp-get-buffer multi-method method user host))
            (erase-buffer)
***************
*** 2876,2892 ****
            (tramp-wait-for-output)
            (goto-char (point-min))
            (setq uname (buffer-substring (point) (tramp-line-end-position)))
!           (setq path (concat uname fname))
            (erase-buffer)))
!       ;; No tilde characters in file name, do normal
!       ;; expand-file-name (this does "/./" and "/../").  We bind
!       ;; directory-sep-char here for XEmacs on Windows, which would
!       ;; otherwise use backslash.
!       (let ((directory-sep-char ?/))
!         (tramp-make-tramp-file-name
!          multi-method method user host
!          (tramp-drop-volume-letter
!           (tramp-run-real-handler 'expand-file-name (list path)))))))))
  
  ;; Remote commands.
  
--- 2915,2936 ----
            (tramp-wait-for-output)
            (goto-char (point-min))
            (setq uname (buffer-substring (point) (tramp-line-end-position)))
!           (setq localname (concat uname fname))
            (erase-buffer)))
!       ;; Look if localname starts with "/../" construct.  If this is
!       ;; the case, then we return a local name instead of a remote name.
!       (if (string-match "^/\\.\\./" localname)
!           (expand-file-name (substring localname 3))
!         ;; No tilde characters in file name, do normal
!         ;; expand-file-name (this does "/./" and "/../").  We bind
!         ;; directory-sep-char here for XEmacs on Windows, which
!         ;; would otherwise use backslash.
!         (let ((directory-sep-char ?/))
!           (tramp-make-tramp-file-name
!            multi-method method user host
!            (tramp-drop-volume-letter
!             (tramp-run-real-handler 'expand-file-name
!                                     (list localname))))))))))
  
  ;; Remote commands.
  
***************
*** 2904,2913 ****
          (save-excursion
            (tramp-barf-unless-okay
             multi-method method user host
!            (format "cd %s" (tramp-shell-quote-argument path))
             nil 'file-error
             "tramp-handle-shell-command: Couldn't `cd %s'"
!            (tramp-shell-quote-argument path))
            (tramp-send-command multi-method method user host
                                (concat command "; tramp_old_status=$?"))
            ;; This will break if the shell command prints "/////"
--- 2948,2957 ----
          (save-excursion
            (tramp-barf-unless-okay
             multi-method method user host
!            (format "cd %s" (tramp-shell-quote-argument localname))
             nil 'file-error
             "tramp-handle-shell-command: Couldn't `cd %s'"
!            (tramp-shell-quote-argument localname))
            (tramp-send-command multi-method method user host
                                (concat command "; tramp_old_status=$?"))
            ;; This will break if the shell command prints "/////"
***************
*** 2994,3000 ****
                                     (list
                                      (tramp-make-rcp-program-file-name
                                       user host
!                                      (tramp-shell-quote-argument path))
                                      tmpfil))))
               (pop-to-buffer output-buf)
               (error
--- 3038,3044 ----
                                     (list
                                      (tramp-make-rcp-program-file-name
                                       user host
!                                      (tramp-shell-quote-argument localname))
                                      tmpfil))))
               (pop-to-buffer output-buf)
               (error
***************
*** 3013,3019 ****
               (tramp-message 5 "Encoding remote file %s..." filename)
               (tramp-barf-unless-okay
                multi-method method user host
!               (concat rem-enc " < " (tramp-shell-quote-argument path))
                nil 'file-error
                "Encoding remote file failed, see buffer `%s' for details"
                tramp-buf)
--- 3057,3063 ----
               (tramp-message 5 "Encoding remote file %s..." filename)
               (tramp-barf-unless-okay
                multi-method method user host
!               (concat rem-enc " < " (tramp-shell-quote-argument localname))
                nil 'file-error
                "Encoding remote file failed, see buffer `%s' for details"
                tramp-buf)
***************
*** 3172,3178 ****
                                  tmpfil
                                  (tramp-make-rcp-program-file-name
                                   user host
!                                  (tramp-shell-quote-argument path))))))
               (tramp-message-for-buffer
                multi-method method user host
                6 "Writing tmp file using `%s'..." rcp-program)
--- 3216,3222 ----
                                  tmpfil
                                  (tramp-make-rcp-program-file-name
                                   user host
!                                  (tramp-shell-quote-argument localname))))))
               (tramp-message-for-buffer
                multi-method method user host
                6 "Writing tmp file using `%s'..." rcp-program)
***************
*** 3246,3258 ****
                  multi-method method user host
                  (format "%s >%s <<'EOF'"
                          rem-dec
!                         (tramp-shell-quote-argument path)))
                 (set-buffer tmpbuf)
                 (tramp-message-for-buffer
                  multi-method method user host
                  6 "Sending data to remote host...")
!                (tramp-send-region multi-method method user host
!                                   (point-min) (point-max))
                 ;; wait for remote decoding to complete
                 (tramp-message-for-buffer
                  multi-method method user host
--- 3290,3302 ----
                  multi-method method user host
                  (format "%s >%s <<'EOF'"
                          rem-dec
!                         (tramp-shell-quote-argument localname)))
                 (set-buffer tmpbuf)
                 (tramp-message-for-buffer
                  multi-method method user host
                  6 "Sending data to remote host...")
!                (tramp-send-string multi-method method user host
!                                   (buffer-string))
                 ;; wait for remote decoding to complete
                 (tramp-message-for-buffer
                  multi-method method user host
***************
*** 3292,3308 ****
        (message "Wrote %s" filename)))))
  
  ;; Call down to the real handler.
! ;; Because EFS does not play nicely with TRAMP (both systems match an
! ;; TRAMP path) it is needed to disable efs as well as tramp for the
  ;; operation.
  ;;
  ;; Other than that, this is the canon file-handler code that the doco
  ;; says should be used here. Which is nice.
  ;;
  ;; Under XEmacs current, EFS also hooks in as
! ;; efs-sifn-handler-function to handle any path with environment
  ;; variables. This has two implications:
! ;; 1) That EFS may not be completely dead (yet) for TRAMP paths
  ;; 2) That TRAMP might want to do the same thing.
  ;; Details as they come in.
  ;;
--- 3336,3352 ----
        (message "Wrote %s" filename)))))
  
  ;; Call down to the real handler.
! ;; Because EFS does not play nicely with TRAMP (both systems match a
! ;; TRAMP file name) it is needed to disable efs as well as tramp for the
  ;; operation.
  ;;
  ;; Other than that, this is the canon file-handler code that the doco
  ;; says should be used here. Which is nice.
  ;;
  ;; Under XEmacs current, EFS also hooks in as
! ;; efs-sifn-handler-function to handle any filename with environment
  ;; variables. This has two implications:
! ;; 1) That EFS may not be completely dead (yet) for TRAMP filenames
  ;; 2) That TRAMP might want to do the same thing.
  ;; Details as they come in.
  ;;
***************
*** 3506,3520 ****
              ;;-                       '(?\* ?\? ?[ ?]))))
              ;;-  (tramp-send-command
              ;;-   multi-method method user host
!             ;;-   (format "echo %s" (comint-quote-filename path)))
              ;;-  (tramp-wait-for-output))
              (tramp-send-command multi-method method user host
!                                 (format "echo %s" path))
              (tramp-wait-for-output)
              (setq bufstr (buffer-substring (point-min)
                                             (tramp-line-end-position)))
              (goto-char (point-min))
!             (if (string-equal path bufstr)
                  nil
                (insert "(\"")
                (while (search-forward " " nil t)
--- 3550,3564 ----
              ;;-                       '(?\* ?\? ?[ ?]))))
              ;;-  (tramp-send-command
              ;;-   multi-method method user host
!             ;;-   (format "echo %s" (comint-quote-filename localname)))
              ;;-  (tramp-wait-for-output))
              (tramp-send-command multi-method method user host
!                                 (format "echo %s" localname))
              (tramp-wait-for-output)
              (setq bufstr (buffer-substring (point-min)
                                             (tramp-line-end-position)))
              (goto-char (point-min))
!             (if (string-equal localname bufstr)
                  nil
                (insert "(\"")
                (while (search-forward " " nil t)
***************
*** 3554,3560 ****
  ;; `tramp-completion-file-name-regexp-unified' aren't different.
  ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to
  ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'.
! ;; Using `last-input-event' is a little bit risky, because completing a file
  ;; might require loading other files, like "~/.netrc", and for them it
  ;; shouldn't be decided based on that variable. On the other hand, those files
  ;; shouldn't have partial tramp file name syntax. Maybe another variable 
should
--- 3598,3604 ----
  ;; `tramp-completion-file-name-regexp-unified' aren't different.
  ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to
  ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'.
! ;; Using `last-input-event' is a little bit risky, because completing a file 
  ;; might require loading other files, like "~/.netrc", and for them it
  ;; shouldn't be decided based on that variable. On the other hand, those files
  ;; shouldn't have partial tramp file name syntax. Maybe another variable 
should
***************
*** 3587,3593 ****
      (tramp-completion-run-real-handler
       'file-exists-p (list filename))))
  
! ;; Path manipulation in case of partial TRAMP file names.
  (defun tramp-completion-handle-file-name-directory (file)
    "Like `file-name-directory' but aware of TRAMP files."
    (if (tramp-completion-mode file)
--- 3631,3637 ----
      (tramp-completion-run-real-handler
       'file-exists-p (list filename))))
  
! ;; Localname manipulation in case of partial TRAMP file names.
  (defun tramp-completion-handle-file-name-directory (file)
    "Like `file-name-directory' but aware of TRAMP files."
    (if (tramp-completion-mode file)
***************
*** 3595,3601 ****
      (tramp-completion-run-real-handler
       'file-name-directory (list file))))
  
! ;; Path manipulation in case of partial TRAMP file names.
  (defun tramp-completion-handle-file-name-nondirectory (file)
    "Like `file-name-nondirectory' but aware of TRAMP files."
    (substring
--- 3639,3645 ----
      (tramp-completion-run-real-handler
       'file-name-directory (list file))))
  
! ;; Localname manipulation in case of partial TRAMP file names.
  (defun tramp-completion-handle-file-name-nondirectory (file)
    "Like `file-name-nondirectory' but aware of TRAMP files."
    (substring
***************
*** 3625,3637 ****
             (method (tramp-file-name-method car))
             (user (tramp-file-name-user car))
             (host (tramp-file-name-host car))
!            (path (tramp-file-name-path car))
             (m (tramp-find-method multi-method method user host))
             (tramp-current-user user) ; see `tramp-parse-passwd'
             all-user-hosts)
  
        (unless (or multi-method ;; Not handled (yet).
!                   path)        ;; Nothing to complete
  
          (if (or user host)
  
--- 3669,3681 ----
             (method (tramp-file-name-method car))
             (user (tramp-file-name-user car))
             (host (tramp-file-name-host car))
!            (localname (tramp-file-name-localname car))
             (m (tramp-find-method multi-method method user host))
             (tramp-current-user user) ; see `tramp-parse-passwd'
             all-user-hosts)
  
        (unless (or multi-method ;; Not handled (yet).
!                   localname)        ;; Nothing to complete
  
          (if (or user host)
  
***************
*** 3644,3650 ****
                               (funcall (nth 0 x) (nth 1 x)))))
               (tramp-get-completion-function m))
  
!             (setq result (append result
                (mapcar
                 (lambda (x)
                   (tramp-get-completion-user-host
--- 3688,3694 ----
                               (funcall (nth 0 x) (nth 1 x)))))
               (tramp-get-completion-function m))
  
!             (setq result (append result 
                (mapcar
                 (lambda (x)
                   (tramp-get-completion-user-host
***************
*** 3675,3681 ****
  ;; I misuse a little bit the tramp-file-name structure in order to handle
  ;; completion possibilities for partial methods / user names / host names.
  ;; Return value is a list of tramp-file-name structures according to possible
! ;; completions. If "multi-method" or "path" is non-nil it means there
  ;; shouldn't be a completion anymore.
  
  ;; Expected results:
--- 3719,3725 ----
  ;; I misuse a little bit the tramp-file-name structure in order to handle
  ;; completion possibilities for partial methods / user names / host names.
  ;; Return value is a list of tramp-file-name structures according to possible
! ;; completions. If "multi-method" or "localname" is non-nil it means there
  ;; shouldn't be a completion anymore.
  
  ;; Expected results:
***************
*** 3685,3691 ****
  ;; [nil nil "x" nil nil]
  ;; [nil "x" nil nil nil]
  
! ;; "/x:"                    "/x:y"                   "/x:y:"
  ;; [nil nil nil "x" ""]     [nil nil nil "x" "y"]    [nil "x" nil "y" ""]
  ;;       "/[x/"                   "/[x/y"
  ;; [nil "x" nil "" nil]     [nil "x" nil "y" nil]
--- 3729,3735 ----
  ;; [nil nil "x" nil nil]
  ;; [nil "x" nil nil nil]
  
! ;; "/x:"                    "/x:y"                   "/x:y:"                
  ;; [nil nil nil "x" ""]     [nil nil nil "x" "y"]    [nil "x" nil "y" ""]
  ;;       "/[x/"                   "/[x/y"
  ;; [nil "x" nil "" nil]     [nil "x" nil "y" nil]
***************
*** 3757,3763 ****
  (defun tramp-completion-dissect-file-name1 (structure name)
    "Returns a `tramp-file-name' structure matching STRUCTURE.
  The structure consists of multi-method, remote method, remote user,
! remote host and remote path name."
  
    (let (method)
      (save-match-data
--- 3801,3807 ----
  (defun tramp-completion-dissect-file-name1 (structure name)
    "Returns a `tramp-file-name' structure matching STRUCTURE.
  The structure consists of multi-method, remote method, remote user,
! remote host and localname (filename on remote host)."
  
    (let (method)
      (save-match-data
***************
*** 3771,3789 ****
             :method nil
             :user nil
             :host nil
!            :path nil)
          (let ((user   (and (nth 2 structure)
                             (match-string (nth 2 structure) name)))
                (host   (and (nth 3 structure)
                             (match-string (nth 3 structure) name)))
!               (path   (and (nth 4 structure)
                             (match-string (nth 4 structure) name))))
            (make-tramp-file-name
             :multi-method nil
             :method method
             :user user
             :host host
!            :path path)))))))
  
  ;; This function returns all possible method completions, adding the
  ;; trailing method delimeter.
--- 3815,3833 ----
             :method nil
             :user nil
             :host nil
!            :localname 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)))))))
  
  ;; This function returns all possible method completions, adding the
  ;; trailing method delimeter.
***************
*** 4046,4052 ****
         (tramp-file-name-multi-method v) (tramp-file-name-method v)
         (tramp-file-name-user v) (tramp-file-name-host v)
         (format "test %s %s" switch
!                (tramp-shell-quote-argument (tramp-file-name-path v)))))))
  
  (defun tramp-run-test2 (program file1 file2 &optional switch)
    "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
--- 4090,4096 ----
         (tramp-file-name-multi-method v) (tramp-file-name-method v)
         (tramp-file-name-user v) (tramp-file-name-host v)
         (format "test %s %s" switch
!                (tramp-shell-quote-argument (tramp-file-name-localname v)))))))
  
  (defun tramp-run-test2 (program file1 file2 &optional switch)
    "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
***************
*** 4063,4070 ****
           (user2 (tramp-file-name-user v2))
           (host1 (tramp-file-name-host v1))
           (host2 (tramp-file-name-host v2))
!          (path1 (tramp-file-name-path v1))
!          (path2 (tramp-file-name-path v2)))
      (unless (and method1 method2 host1 host2
                   (equal mmethod1 mmethod2)
                   (equal method1 method2)
--- 4107,4114 ----
           (user2 (tramp-file-name-user v2))
           (host1 (tramp-file-name-host v1))
           (host2 (tramp-file-name-host v2))
!          (localname1 (tramp-file-name-localname v1))
!          (localname2 (tramp-file-name-localname v2)))
      (unless (and method1 method2 host1 host2
                   (equal mmethod1 mmethod2)
                   (equal method1 method2)
***************
*** 4077,4085 ****
         mmethod1 method1 user1 host1
         (format "%s %s %s %s"
                 program
!                (tramp-shell-quote-argument path1)
                 (or switch "")
!                (tramp-shell-quote-argument path2))))))
  
  (defun tramp-buffer-name (multi-method method user host)
    "A name for the connection buffer for USER at HOST using METHOD."
--- 4121,4129 ----
         mmethod1 method1 user1 host1
         (format "%s %s %s %s"
                 program
!                (tramp-shell-quote-argument localname1)
                 (or switch "")
!                (tramp-shell-quote-argument localname2))))))
  
  (defun tramp-buffer-name (multi-method method user host)
    "A name for the connection buffer for USER at HOST using METHOD."
***************
*** 4138,4144 ****
  to search.  If IGNORE-TILDE is non-nil, directory names starting
  with `~' will be ignored.
  
! Returns the full path name of PROGNAME, if found, and nil otherwise.
  
  This function expects to be in the right *tramp* buffer."
    (let (result)
--- 4182,4188 ----
  to search.  If IGNORE-TILDE is non-nil, directory names starting
  with `~' will be ignored.
  
! Returns the absolute file name of PROGNAME, if found, and nil otherwise.
  
  This function expects to be in the right *tramp* buffer."
    (let (result)
***************
*** 4238,4244 ****
                    (tramp-handle-file-exists-p existing)
                    (not (tramp-handle-file-exists-p nonexisting))))
        (error "Couldn't find command to check if file exists."))))
! 
  
  ;; CCC test ksh or bash found for tilde expansion?
  (defun tramp-find-shell (multi-method method user host)
--- 4282,4288 ----
                    (tramp-handle-file-exists-p existing)
                    (not (tramp-handle-file-exists-p nonexisting))))
        (error "Couldn't find command to check if file exists."))))
!     
  
  ;; CCC test ksh or bash found for tilde expansion?
  (defun tramp-find-shell (multi-method method user host)
***************
*** 4294,4300 ****
  
  (defun tramp-check-ls-command (multi-method method user host cmd)
    "Checks whether the given `ls' executable groks `-n'.
! METHOD, USER and HOST specify the connection, CMD (the full path name of)
  the `ls' executable.  Returns t if CMD supports the `-n' option, nil
  otherwise."
    (tramp-message 9 "Checking remote `%s' command for `-n' option"
--- 4338,4344 ----
  
  (defun tramp-check-ls-command (multi-method method user host cmd)
    "Checks whether the given `ls' executable groks `-n'.
! METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
  the `ls' executable.  Returns t if CMD supports the `-n' option, nil
  otherwise."
    (tramp-message 9 "Checking remote `%s' command for `-n' option"
***************
*** 4337,4345 ****
     (tramp-check-ls-commands multi-method method user host "gnuls" 
tramp-remote-path)
     (tramp-check-ls-commands multi-method method user host "gls" 
tramp-remote-path)))
  
! ;; ------------------------------------------------------------
! ;; -- Functions for establishing connection --
! ;; ------------------------------------------------------------
  
  ;; The following functions are actions to be taken when seeing certain
  ;; prompts from the remote host.  See the variable
--- 4381,4389 ----
     (tramp-check-ls-commands multi-method method user host "gnuls" 
tramp-remote-path)
     (tramp-check-ls-commands multi-method method user host "gls" 
tramp-remote-path)))
  
! ;; ------------------------------------------------------------ 
! ;; -- Functions for establishing connection -- 
! ;; ------------------------------------------------------------ 
  
  ;; The following functions are actions to be taken when seeing certain
  ;; prompts from the remote host.  See the variable
***************
*** 4538,4544 ****
      (when multi-method
        (error "Cannot multi-connect using telnet connection method"))
      (tramp-pre-connection multi-method method user host)
!     (tramp-message 7 "Opening connection for address@hidden using %s..."
                   (or user (user-login-name)) host method)
      (let ((process-environment (copy-sequence process-environment)))
        (setenv "TERM" tramp-terminal-type)
--- 4582,4588 ----
      (when multi-method
        (error "Cannot multi-connect using telnet connection method"))
      (tramp-pre-connection multi-method method user host)
!     (tramp-message 7 "Opening connection for address@hidden using %s..." 
                   (or user (user-login-name)) host method)
      (let ((process-environment (copy-sequence process-environment)))
        (setenv "TERM" tramp-terminal-type)
***************
*** 4572,4578 ****
           p multi-method method user host)
          (tramp-post-connection multi-method method user host)))))
  
! 
  (defun tramp-open-connection-rsh (multi-method method user host)
    "Open a connection using an rsh METHOD.
  This starts the command `rsh HOST -l USER'[*], then waits for a remote
--- 4616,4622 ----
           p multi-method method user host)
          (tramp-post-connection multi-method method user host)))))
  
!           
  (defun tramp-open-connection-rsh (multi-method method user host)
    "Open a connection using an rsh METHOD.
  This starts the command `rsh HOST -l USER'[*], then waits for a remote
***************
*** 4603,4609 ****
        (error "Cannot multi-connect using rsh connection method"))
      (tramp-pre-connection multi-method method user host)
      (if (and user (not (string= user "")))
!       (tramp-message 7 "Opening connection for address@hidden using %s..."
                       user host method)
        (tramp-message 7 "Opening connection at %s using %s..." host method))
      (let ((process-environment (copy-sequence process-environment))
--- 4647,4653 ----
        (error "Cannot multi-connect using rsh connection method"))
      (tramp-pre-connection multi-method method user host)
      (if (and user (not (string= user "")))
!       (tramp-message 7 "Opening connection for address@hidden using %s..." 
                       user host method)
        (tramp-message 7 "Opening connection at %s using %s..." host method))
      (let ((process-environment (copy-sequence process-environment))
***************
*** 4631,4639 ****
                                                    (> emacs-major-version 20))
                                         tramp-dos-coding-system))
               (p (if (and user (not (string= user "")))
!                     (apply #'start-process bufnam buf rsh-program
                             host "-l" user rsh-args)
!                   (apply #'start-process bufnam buf rsh-program
                           host rsh-args)))
               (found nil))
          (process-kill-without-query p)
--- 4675,4683 ----
                                                    (> emacs-major-version 20))
                                         tramp-dos-coding-system))
               (p (if (and user (not (string= user "")))
!                     (apply #'start-process bufnam buf rsh-program  
                             host "-l" user rsh-args)
!                   (apply #'start-process bufnam buf rsh-program 
                           host rsh-args)))
               (found nil))
          (process-kill-without-query p)
***************
*** 4703,4712 ****
                               tramp-actions-before-shell)
          (tramp-open-connection-setup-interactive-shell
           p multi-method method user host)
!         (tramp-post-connection multi-method method
                                 user host)))))
  
! ;; HHH: Not Changed.  Multi method.  It is not clear to me how this can
  ;;      handle not giving a user name in the "file name".
  ;;
  ;;      This is more difficult than for the single-hop method.  In the
--- 4747,4756 ----
                               tramp-actions-before-shell)
          (tramp-open-connection-setup-interactive-shell
           p multi-method method user host)
!         (tramp-post-connection multi-method method 
                                 user host)))))
  
! ;; HHH: Not Changed.  Multi method.  It is not clear to me how this can 
  ;;      handle not giving a user name in the "file name".
  ;;
  ;;      This is more difficult than for the single-hop method.  In the
***************
*** 4776,4782 ****
          (tramp-post-connection multi-method method user host)))))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
! ;;      of no user name provided.  Hack to make it work as it did before:
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-telnet (p method user host command)
--- 4820,4826 ----
          (tramp-post-connection multi-method method user host)))))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
! ;;      of no user name provided.  Hack to make it work as it did before:  
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-telnet (p method user host command)
***************
*** 4798,4805 ****
      (tramp-process-multi-actions p method user host
                                 tramp-multi-actions)))
  
! ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
! ;;      of no user name provided.  Hack to make it work as it did before:
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-rlogin (p method user host command)
--- 4842,4849 ----
      (tramp-process-multi-actions p method user host
                                 tramp-multi-actions)))
  
! ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
! ;;      of no user name provided.  Hack to make it work as it did before:  
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-rlogin (p method user host command)
***************
*** 4824,4831 ****
      (tramp-process-multi-actions p method user host
                                 tramp-multi-actions)))
  
! ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case
! ;;      of no user name provided.  Hack to make it work as it did before:
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-su (p method user host command)
--- 4868,4875 ----
      (tramp-process-multi-actions p method user host
                                 tramp-multi-actions)))
  
! ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
! ;;      of no user name provided.  Hack to make it work as it did before:  
  ;;      changed `user' to `(or user (user-login-name))' in the places where
  ;;      the value is actually used.
  (defun tramp-multi-connect-su (p method user host command)
***************
*** 4934,4941 ****
    ;; sign.  The following command line sets $PS1 to a sane value, and
    ;; works under Bourne-ish shells as well as csh-like shells.  Daniel
    ;; Pittman reports that the unusual positioning of the single quotes
!   ;; makes it work under `rc', too.
!   (process-send-string nil (format "exec env 'PS1=$ ' %s%s"
                                     (tramp-get-remote-sh
                                    multi-method method user host)
                                     tramp-rsh-end-of-line))
--- 4978,4988 ----
    ;; sign.  The following command line sets $PS1 to a sane value, and
    ;; works under Bourne-ish shells as well as csh-like shells.  Daniel
    ;; Pittman reports that the unusual positioning of the single quotes
!   ;; makes it work under `rc', too.  We also unset the variable $ENV
!   ;; because that is read by some sh implementations (eg, bash when
!   ;; called as sh) on startup; this way, we avoid the startup file
!   ;; clobbering $PS1.
!   (process-send-string nil (format "exec env 'ENV=' 'PS1=$ ' %s%s"
                                     (tramp-get-remote-sh
                                    multi-method method user host)
                                     tramp-rsh-end-of-line))
***************
*** 5159,5165 ****
    (tramp-wait-for-output)
    ;; Send the fallback `uudecode' script.
    (erase-buffer)
!   (tramp-send-linewise multi-method method user host tramp-uudecode)
    (tramp-wait-for-output)
    ;; Find a `perl'.
    (erase-buffer)
--- 5206,5212 ----
    (tramp-wait-for-output)
    ;; Send the fallback `uudecode' script.
    (erase-buffer)
!   (tramp-send-string multi-method method user host tramp-uudecode)
    (tramp-wait-for-output)
    ;; Find a `perl'.
    (erase-buffer)
***************
*** 5174,5180 ****
        ;; Set up stat in Perl if we can.
        (when tramp-remote-perl
        (tramp-message 5 "Sending the Perl `file-attributes' implementation.")
!       (tramp-send-linewise
         multi-method method user host
         (concat "tramp_file_attributes () {\n"
                 tramp-remote-perl
--- 5221,5227 ----
        ;; Set up stat in Perl if we can.
        (when tramp-remote-perl
        (tramp-message 5 "Sending the Perl `file-attributes' implementation.")
!       (tramp-send-string
         multi-method method user host
         (concat "tramp_file_attributes () {\n"
                 tramp-remote-perl
***************
*** 5186,5199 ****
                 (tramp-find-method multi-method method user host)
                 user host)
          (tramp-message 5 "Sending the Perl `mime-encode' implementations.")
!         (tramp-send-linewise
           multi-method method user host
           (concat "tramp_encode () {\n"
                   (format tramp-perl-encode tramp-remote-perl)
                   " 2>/dev/null"
                   "\n}"))
          (tramp-wait-for-output)
!         (tramp-send-linewise
           multi-method method user host
           (concat "tramp_encode_with_module () {\n"
                   (format tramp-perl-encode-with-module tramp-remote-perl)
--- 5233,5246 ----
                 (tramp-find-method multi-method method user host)
                 user host)
          (tramp-message 5 "Sending the Perl `mime-encode' implementations.")
!         (tramp-send-string
           multi-method method user host
           (concat "tramp_encode () {\n"
                   (format tramp-perl-encode tramp-remote-perl)
                   " 2>/dev/null"
                   "\n}"))
          (tramp-wait-for-output)
!         (tramp-send-string
           multi-method method user host
           (concat "tramp_encode_with_module () {\n"
                   (format tramp-perl-encode-with-module tramp-remote-perl)
***************
*** 5201,5214 ****
                   "\n}"))
          (tramp-wait-for-output)
          (tramp-message 5 "Sending the Perl `mime-decode' implementations.")
!         (tramp-send-linewise
           multi-method method user host
           (concat "tramp_decode () {\n"
                   (format tramp-perl-decode tramp-remote-perl)
                   " 2>/dev/null"
                   "\n}"))
          (tramp-wait-for-output)
!         (tramp-send-linewise
           multi-method method user host
           (concat "tramp_decode_with_module () {\n"
                   (format tramp-perl-decode-with-module tramp-remote-perl)
--- 5248,5261 ----
                   "\n}"))
          (tramp-wait-for-output)
          (tramp-message 5 "Sending the Perl `mime-decode' implementations.")
!         (tramp-send-string
           multi-method method user host
           (concat "tramp_decode () {\n"
                   (format tramp-perl-decode tramp-remote-perl)
                   " 2>/dev/null"
                   "\n}"))
          (tramp-wait-for-output)
!         (tramp-send-string
           multi-method method user host
           (concat "tramp_decode_with_module () {\n"
                   (format tramp-perl-decode-with-module tramp-remote-perl)
***************
*** 5468,5503 ****
      (process-send-string proc
                           (concat command tramp-rsh-end-of-line))))
  
- ;; It seems that Tru64 Unix does not like it if long strings are sent
- ;; to it in one go.  (This happens when sending the Perl
- ;; `file-attributes' implementation, for instance.)  Therefore, we
- ;; have this function which waits a bit at each line.
- (defun tramp-send-linewise
-   (multi-method method user host string &optional noerase)
-   "Send the STRING to USER at HOST linewise.
- Erases temporary buffer before sending the STRING (unless NOERASE
- is true).
- 
- The STRING is expected to use Unix line-endings, but the lines sent to
- the remote host use line-endings as defined in the variable
- `tramp-rsh-end-of-line'."
-   (tramp-maybe-open-connection multi-method method user host)
-   (when tramp-debug-buffer
-     (save-excursion
-       (set-buffer (tramp-get-debug-buffer multi-method method user host))
-       (goto-char (point-max))
-       (tramp-insert-with-face 'bold (format "$ %s\n" string))))
-   (let ((proc nil)
-       (lines (split-string string "\n")))
-     (set-buffer (tramp-get-buffer multi-method method user host))
-     (unless noerase (erase-buffer))
-     (setq proc (get-buffer-process (current-buffer)))
-     (mapcar (lambda (x)
-             (sleep-for 0.1)
-             (process-send-string proc
-                                  (concat x tramp-rsh-end-of-line)))
-           lines)))
- 
  (defun tramp-wait-for-output (&optional timeout)
    "Wait for output from remote rsh command."
    (let ((proc (get-buffer-process (current-buffer)))
--- 5515,5520 ----
***************
*** 5602,5640 ****
      (pop-to-buffer (current-buffer))
      (funcall 'signal signal (apply 'format fmt args))))
  
! ;; Chunked sending kluge.  We set this to 500 just to be on the
! ;; safe side; some ssh connections appear to drop bytes when data
! ;; is sent too quickly.
! ;; This happens when using `ssh' method using GNU Emacs 20.7.1
! ;; (hppa1.1-hp-hpux10.20, Motif).  (The connection is made to
! ;; localhost.)
! (defvar tramp-chunksize 500
!   "If non-nil, chunksize for sending things to remote host.")
! 
! (defun tramp-send-region (multi-method method user host start end)
!   "Send the region from START to END to remote command
! running as USER on HOST using METHOD."
    (let ((proc (get-buffer-process
                 (tramp-get-buffer multi-method method user host))))
      (unless proc
!       (error "Can't send region to remote host -- not logged in"))
      (if (and tramp-chunksize (not (zerop tramp-chunksize)))
!       (let ((pos start))
          (while (< pos end)
            (tramp-message-for-buffer
             multi-method method user host 10
!            "Sending chunk from %s to %s" pos end)
!           (process-send-region proc
!                                pos
!                                (min (+ pos tramp-chunksize)
!                                     end))
            (setq pos (+ pos tramp-chunksize))
            (sleep-for 0.1)))
!       (process-send-region proc start end))
!     (when tramp-debug-buffer
!       (append-to-buffer
!        (tramp-get-debug-buffer multi-method method user host)
!        start end))))
  
  (defun tramp-send-eof (multi-method method user host)
    "Send EOF to the remote end.
--- 5619,5666 ----
      (pop-to-buffer (current-buffer))
      (funcall 'signal signal (apply 'format fmt args))))
  
! ;; It seems that Tru64 Unix does not like it if long strings are sent
! ;; to it in one go.  (This happens when sending the Perl
! ;; `file-attributes' implementation, for instance.)  Therefore, we
! ;; have this function which waits a bit at each line.
! (defun tramp-send-string
!   (multi-method method user host string)
!   "Send the STRING to USER at HOST using METHOD.
! 
! The STRING is expected to use Unix line-endings, but the lines sent to
! the remote host use line-endings as defined in the variable
! `tramp-rsh-end-of-line'."
    (let ((proc (get-buffer-process
                 (tramp-get-buffer multi-method method user host))))
      (unless proc
!       (error "Can't send string to remote host -- not logged in"))
!     ;; debug message
!     (when tramp-debug-buffer
!       (save-excursion
!       (set-buffer (tramp-get-debug-buffer multi-method method user host))
!       (goto-char (point-max))
!       (tramp-insert-with-face 'bold (format "$ %s\n" string))))
!     ;; replace "\n" by `tramp-rsh-end-of-line'
!     (setq string
!         (mapconcat 'identity
!                    (split-string string "\n")
!                    tramp-rsh-end-of-line))
!     (unless (string-equal (substring string -1) tramp-rsh-end-of-line)
!       (setq string (concat string tramp-rsh-end-of-line)))
!     ;; send the string
      (if (and tramp-chunksize (not (zerop tramp-chunksize)))
!       (let ((pos 0)
!             (end (length string)))
          (while (< pos end)
            (tramp-message-for-buffer
             multi-method method user host 10
!            "Sending chunk from %s to %s"
!            pos (min (+ pos tramp-chunksize) end))
!           (process-send-string
!            proc (substring string pos (min (+ pos tramp-chunksize) end)))
            (setq pos (+ pos tramp-chunksize))
            (sleep-for 0.1)))
!       (process-send-string proc string))))
  
  (defun tramp-send-eof (multi-method method user host)
    "Send EOF to the remote end.
***************
*** 5789,5815 ****
     ""))
  
  
! ;; ------------------------------------------------------------
! ;; -- TRAMP file names --
! ;; ------------------------------------------------------------
  ;; Conversion functions between external representation and
  ;; internal data structure.  Convenience functions for internal
  ;; data structure.
  
! (defstruct tramp-file-name multi-method method user host path)
  
  (defun tramp-tramp-file-p (name)
    "Return t iff NAME is a tramp file."
    (save-match-data
      (string-match tramp-file-name-regexp name)))
! 
  ;; HHH: Changed.  Used to assign the return value of (user-login-name)
  ;;      to the `user' part of the structure if a user name was not
  ;;      provided, now it assigns nil.
  (defun tramp-dissect-file-name (name)
    "Return an `tramp-file-name' structure.
  The structure consists of remote method, remote user, remote host and
! remote path name."
    (save-match-data
      (let* ((match (string-match (nth 0 tramp-file-name-structure) name))
           (method
--- 5815,5841 ----
     ""))
  
  
! ;; ------------------------------------------------------------ 
! ;; -- TRAMP file names -- 
! ;; ------------------------------------------------------------ 
  ;; Conversion functions between external representation and
  ;; internal data structure.  Convenience functions for internal
  ;; data structure.
  
! (defstruct tramp-file-name multi-method method user host localname)
  
  (defun tramp-tramp-file-p (name)
    "Return t iff NAME is a tramp file."
    (save-match-data
      (string-match tramp-file-name-regexp name)))
!  
  ;; HHH: Changed.  Used to assign the return value of (user-login-name)
  ;;      to the `user' part of the structure if a user name was not
  ;;      provided, now it assigns nil.
  (defun tramp-dissect-file-name (name)
    "Return an `tramp-file-name' structure.
  The structure consists of remote method, remote user, remote host and
! localname (file name on remote host)."
    (save-match-data
      (let* ((match (string-match (nth 0 tramp-file-name-structure) name))
           (method
***************
*** 5828,5840 ****
        (unless match (error "Not a tramp file name: %s" name))
        (let ((user (match-string (nth 2 tramp-file-name-structure) name))
              (host (match-string (nth 3 tramp-file-name-structure) name))
!             (path (match-string (nth 4 tramp-file-name-structure) name)))
          (make-tramp-file-name
           :multi-method nil
           :method method
           :user (or user nil)
           :host host
!          :path path))))))
  
  (defun tramp-find-default-method (user host)
    "Look up the right method to use in `tramp-default-method-alist'."
--- 5854,5866 ----
        (unless match (error "Not a tramp file name: %s" name))
        (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))))))
  
  (defun tramp-find-default-method (user host)
    "Look up the right method to use in `tramp-default-method-alist'."
***************
*** 5855,5861 ****
  If both MULTI-METHOD and METHOD are nil, do a lookup in
  `tramp-default-method-alist'."
    (or multi-method method (tramp-find-default-method user host)))
! 
  ;; HHH: Not Changed.  Multi method.  Will probably not handle the case where
  ;;      a user name is not provided in the "file name" very well.
  (defun tramp-dissect-multi-file-name (name)
--- 5881,5887 ----
  If both MULTI-METHOD and METHOD are nil, do a lookup in
  `tramp-default-method-alist'."
    (or multi-method method (tramp-find-default-method user host)))
!     
  ;; HHH: Not Changed.  Multi method.  Will probably not handle the case where
  ;;      a user name is not provided in the "file name" very well.
  (defun tramp-dissect-multi-file-name (name)
***************
*** 5863,5881 ****
    (let ((regexp           (nth 0 tramp-multi-file-name-structure))
          (method-index     (nth 1 tramp-multi-file-name-structure))
          (hops-index       (nth 2 tramp-multi-file-name-structure))
!         (path-index       (nth 3 tramp-multi-file-name-structure))
          (hop-regexp       (nth 0 tramp-multi-file-name-hop-structure))
          (hop-method-index (nth 1 tramp-multi-file-name-hop-structure))
          (hop-user-index   (nth 2 tramp-multi-file-name-hop-structure))
          (hop-host-index   (nth 3 tramp-multi-file-name-hop-structure))
!         method hops len hop-methods hop-users hop-hosts path)
      (unless (string-match (format regexp hop-regexp) name)
        (error "Not a multi tramp file name: %s" name))
      (setq method (match-string method-index name))
      (setq hops (match-string hops-index name))
      (setq len (/ (length (match-data t)) 2))
!     (when (< path-index 0) (incf path-index len))
!     (setq path (match-string path-index name))
      (let ((index 0))
        (while (string-match hop-regexp hops index)
          (setq index (match-end 0))
--- 5889,5907 ----
    (let ((regexp           (nth 0 tramp-multi-file-name-structure))
          (method-index     (nth 1 tramp-multi-file-name-structure))
          (hops-index       (nth 2 tramp-multi-file-name-structure))
!         (localname-index       (nth 3 tramp-multi-file-name-structure))
          (hop-regexp       (nth 0 tramp-multi-file-name-hop-structure))
          (hop-method-index (nth 1 tramp-multi-file-name-hop-structure))
          (hop-user-index   (nth 2 tramp-multi-file-name-hop-structure))
          (hop-host-index   (nth 3 tramp-multi-file-name-hop-structure))
!         method hops len hop-methods hop-users hop-hosts localname)
      (unless (string-match (format regexp hop-regexp) name)
        (error "Not a multi tramp file name: %s" name))
      (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))
!     (setq localname (match-string localname-index name))
      (let ((index 0))
        (while (string-match hop-regexp hops index)
          (setq index (match-end 0))
***************
*** 5890,5921 ****
       :method       (apply 'vector (reverse hop-methods))
       :user         (apply 'vector (reverse hop-users))
       :host         (apply 'vector (reverse hop-hosts))
!      :path         path)))
  
! (defun tramp-make-tramp-file-name (multi-method method user host path)
!   "Constructs a tramp file name from METHOD, USER, HOST and PATH."
    (if multi-method
!       (tramp-make-tramp-multi-file-name multi-method method user host path)
      (format-spec
       (concat tramp-prefix-format
        (when method (concat "%m" tramp-postfix-single-method-format))
        (when user   (concat "%u" tramp-postfix-user-format))
        (when host   (concat "%h" tramp-postfix-host-format))
!       (when path   (concat "%p")))
!     `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,path)))))
  
  ;; CCC: Henrik Holm: Not Changed.  Multi Method.  What should be done
  ;; with this when USER is nil?
! (defun tramp-make-tramp-multi-file-name (multi-method method user host path)
    "Constructs a tramp file name for a multi-hop method."
    (unless tramp-make-multi-tramp-file-format
      (error "`tramp-make-multi-tramp-file-format' is nil"))
    (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format))
           (hop-format    (nth 1 tramp-make-multi-tramp-file-format))
!          (path-format   (nth 2 tramp-make-multi-tramp-file-format))
           (prefix (format-spec prefix-format `((?m . ,multi-method))))
           (hops "")
!          (path (format-spec path-format `((?p . ,path))))
           (i 0)
           (len (length method)))
      (while (< i len)
--- 5916,5947 ----
       :method       (apply 'vector (reverse hop-methods))
       :user         (apply 'vector (reverse hop-users))
       :host         (apply 'vector (reverse hop-hosts))
!      :localname         localname)))
  
! (defun tramp-make-tramp-file-name (multi-method method user host localname)
!   "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME."
    (if multi-method
!       (tramp-make-tramp-multi-file-name multi-method method user host 
localname)
      (format-spec
       (concat tramp-prefix-format
        (when method (concat "%m" tramp-postfix-single-method-format))
        (when user   (concat "%u" tramp-postfix-user-format))
        (when host   (concat "%h" tramp-postfix-host-format))
!       (when localname   (concat "%p")))
!     `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,localname)))))
  
  ;; CCC: Henrik Holm: Not Changed.  Multi Method.  What should be done
  ;; with this when USER is nil?
! (defun tramp-make-tramp-multi-file-name (multi-method method user host 
localname)
    "Constructs a tramp file name for a multi-hop method."
    (unless tramp-make-multi-tramp-file-format
      (error "`tramp-make-multi-tramp-file-format' is nil"))
    (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format))
           (hop-format    (nth 1 tramp-make-multi-tramp-file-format))
!          (localname-format   (nth 2 tramp-make-multi-tramp-file-format))
           (prefix (format-spec prefix-format `((?m . ,multi-method))))
           (hops "")
!          (localname (format-spec localname-format `((?p . ,localname))))
           (i 0)
           (len (length method)))
      (while (< i len)
***************
*** 5923,5935 ****
          (setq hops (concat hops (format-spec hop-format
                                             `((?m . ,m) (?u . ,u) (?h . ,h)))))
          (incf i)))
!     (concat prefix hops path)))
  
! (defun tramp-make-rcp-program-file-name (user host path)
    "Create a file name suitable to be passed to `rcp'."
    (if user
!       (format "address@hidden:%s" user host path)
!     (format "%s:%s" host path)))
  
  (defun tramp-method-out-of-band-p (multi-method method user host)
    "Return t if this is an out-of-band method, nil otherwise.
--- 5949,5961 ----
          (setq hops (concat hops (format-spec hop-format
                                             `((?m . ,m) (?u . ,u) (?h . ,h)))))
          (incf i)))
!     (concat prefix hops localname)))
  
! (defun tramp-make-rcp-program-file-name (user host localname)
    "Create a file name suitable to be passed to `rcp'."
    (if user
!       (format "address@hidden:%s" user host localname)
!     (format "%s:%s" host localname)))
  
  (defun tramp-method-out-of-band-p (multi-method method user host)
    "Return t if this is an out-of-band method, nil otherwise.
***************
*** 6226,6234 ****
  it does the right thing."
    (delete "" (split-string string pattern)))
  
! ;; ------------------------------------------------------------
! ;; -- Kludges section --
! ;; ------------------------------------------------------------
  
  ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
  ;; does not deal well with newline characters.  Newline is replaced by
--- 6252,6260 ----
  it does the right thing."
    (delete "" (split-string string pattern)))
  
! ;; ------------------------------------------------------------ 
! ;; -- Kludges section -- 
! ;; ------------------------------------------------------------ 
  
  ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
  ;; does not deal well with newline characters.  Newline is replaced by
***************
*** 6272,6278 ****
  
  ;; ;; EFS hooks itself into the file name handling stuff in more places
  ;; ;; than just `file-name-handler-alist'. The following tells EFS to stay
! ;; ;; away from tramp.el paths.
  ;; ;;
  ;; ;; This is needed because EFS installs (efs-dired-before-readin) into
  ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP
--- 6298,6304 ----
  
  ;; ;; EFS hooks itself into the file name handling stuff in more places
  ;; ;; than just `file-name-handler-alist'. The following tells EFS to stay
! ;; ;; away from tramp.el file names.
  ;; ;;
  ;; ;; This is needed because EFS installs (efs-dired-before-readin) into
  ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP
***************
*** 6287,6294 ****
  ;; ;; not to call defadvice unless it's necessary.  How do we find out whether
  ;; ;; it is necessary?  (featurep 'efs) is surely the wrong way --
  ;; ;; EFS might nicht be loaded yet.
! ;; (defadvice efs-ftp-path (around dont-match-tramp-path activate protect)
! ;;   "Cause efs-ftp-path to fail when the path is a TRAMP path."
  ;;   (if (tramp-tramp-file-p (ad-get-arg 0))
  ;;       nil
  ;;     ad-do-it))
--- 6313,6320 ----
  ;; ;; not to call defadvice unless it's necessary.  How do we find out whether
  ;; ;; it is necessary?  (featurep 'efs) is surely the wrong way --
  ;; ;; EFS might nicht be loaded yet.
! ;; (defadvice efs-ftp-path (around dont-match-tramp-localname activate 
protect)
! ;;   "Cause efs-ftp-path to fail when the path is a TRAMP localname."
  ;;   (if (tramp-tramp-file-p (ad-get-arg 0))
  ;;       nil
  ;;     ad-do-it))
***************
*** 6309,6315 ****
        ;; If it's a Tramp file, dissect it and look if wildcards
        ;; need to be expanded at all.
        (let ((v (tramp-dissect-file-name name)))
!         (if (string-match "[[*?]" (tramp-file-name-path v))
              (let ((res ad-do-it))
                (setq ad-return-value (or res (list name))))
            (setq ad-return-value (list name))))
--- 6335,6341 ----
        ;; If it's a Tramp file, dissect it and look if wildcards
        ;; need to be expanded at all.
        (let ((v (tramp-dissect-file-name name)))
!         (if (string-match "[[*?]" (tramp-file-name-localname v))
              (let ((res ad-do-it))
                (setq ad-return-value (or res (list name))))
            (setq ad-return-value (list name))))
***************
*** 6373,6378 ****
--- 6399,6405 ----
         tramp-multi-actions
         tramp-terminal-type
         tramp-shell-prompt-pattern
+        tramp-chunksize
  
         ;; Non-tramp variables of interest
         shell-prompt-pattern
***************
*** 6483,6489 ****
  ;;   strange when doing zerop, we should kill the process and start
  ;;   again.  (Greg Stark)
  ;; * Add caching for filename completion.  (Greg Stark)
! ;;   Of course, this has issues with usability (stale cache bites)
  ;;      -- <address@hidden>
  ;; * Provide a local cache of old versions of remote files for the rsync
  ;;   transfer method to use.  (Greg Stark)
--- 6510,6516 ----
  ;;   strange when doing zerop, we should kill the process and start
  ;;   again.  (Greg Stark)
  ;; * Add caching for filename completion.  (Greg Stark)
! ;;   Of course, this has issues with usability (stale cache bites) 
  ;;      -- <address@hidden>
  ;; * Provide a local cache of old versions of remote files for the rsync
  ;;   transfer method to use.  (Greg Stark)
***************
*** 6498,6504 ****
  ;; * Make it work for different encodings, and for different file name
  ;;   encodings, too.  (Daniel Pittman)
  ;; * Change applicable functions to pass a struct tramp-file-name rather
! ;;   than the individual items MULTI-METHOD, METHOD, USER, HOST, PATH.
  ;; * Implement asynchronous shell commands.
  ;; * Clean up unused *tramp/foo* buffers after a while.  (Pete Forman)
  ;; * Progress reports while copying files.  (Michael Kifer)
--- 6525,6531 ----
  ;; * Make it work for different encodings, and for different file name
  ;;   encodings, too.  (Daniel Pittman)
  ;; * Change applicable functions to pass a struct tramp-file-name rather
! ;;   than the individual items MULTI-METHOD, METHOD, USER, HOST, LOCALNAME.
  ;; * Implement asynchronous shell commands.
  ;; * Clean up unused *tramp/foo* buffers after a while.  (Pete Forman)
  ;; * Progress reports while copying files.  (Michael Kifer)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]