[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/net/tramp.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/net/tramp.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:39:51 -0400 |
Index: emacs/lisp/net/tramp.el
diff -c emacs/lisp/net/tramp.el:1.34.2.1 emacs/lisp/net/tramp.el:1.34.2.2
*** emacs/lisp/net/tramp.el:1.34.2.1 Fri Apr 4 01:20:30 2003
--- emacs/lisp/net/tramp.el Tue Oct 14 19:39:26 2003
***************
*** 1,4 ****
! ;;; -*- mode: Emacs-Lisp; coding: iso-8859-1; -*-
;;; tramp.el --- Transparent Remote Access, Multiple Protocol
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
Inc.
--- 1,4 ----
! ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
;;; tramp.el --- Transparent Remote Access, Multiple Protocol
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
Inc.
***************
*** 87,95 ****
(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))
;; Load foreign methods. Because they do require Tramp internally, this
;; must be done with the `eval-after-load' trick.
--- 87,104 ----
(unless (fboundp 'uudecode-decode-region)
(autoload 'uudecode-decode-region "uudecode"))
! ;; XEmacs is distributed with few Lisp packages. Further packages are
! ;; installed using EFS. If we use a unified filename format, then
! ;; Tramp is required in addition to EFS. (But why can't Tramp just
! ;; disable EFS when Tramp is loaded? Then XEmacs can ship with EFS
! ;; just like before.) Another reason for using a separate filename
! ;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but
! ;; Tramp only knows how to deal with `file-name-handler-alist', not
! ;; the other places.
! ;;;###autoload
! (defvar tramp-unified-filenames (not (featurep 'xemacs))
! "Non-nil means to use unified Ange-FTP/Tramp filename syntax.
! Nil means to use a separate filename syntax for Tramp.")
;; Load foreign methods. Because they do require Tramp internally, this
;; must be done with the `eval-after-load' trick.
***************
*** 98,103 ****
--- 107,115 ----
(unless (featurep 'xemacs)
(eval-after-load "tramp"
'(require 'tramp-ftp)))
+ (when (and tramp-unified-filenames (featurep 'xemacs))
+ (eval-after-load "tramp"
+ '(require 'tramp-efs)))
;; tramp-smb uses "smbclient" from Samba.
;; Not available under Cygwin and Windows, because they don't offer
***************
*** 123,141 ****
(when (fboundp 'byte-compiler-options)
(byte-compiler-options (warnings (- unused-vars)))))
- ;; XEmacs is distributed with few Lisp packages. Further packages are
- ;; installed using EFS. If we use a unified filename format, then
- ;; Tramp is required in addition to EFS. (But why can't Tramp just
- ;; disable EFS when Tramp is loaded? Then XEmacs can ship with EFS
- ;; just like before.) Another reason for using a separate filename
- ;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but
- ;; Tramp only knows how to deal with `file-name-handler-alist', not
- ;; the other places.
- ;;;###autoload
- (defvar tramp-unified-filenames (not (featurep 'xemacs))
- "Non-nil means to use unified Ange-FTP/Tramp filename syntax.
- Nil means to use a separate filename syntax for Tramp.")
-
;;; User Customizable Internal Variables:
(defgroup tramp nil
--- 135,140 ----
***************
*** 234,498 ****
(defcustom tramp-methods
'( ("rcp" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "rsh")
! (tramp-rcp-program "rcp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scp" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scp1" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-1" "-e" "none"))
! (tramp-rcp-args ("-1"))
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scp2" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-2" "-e" "none"))
! (tramp-rcp-args ("-2"))
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scp1_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh1")
! (tramp-rcp-program "scp1")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scp2_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh2")
! (tramp-rcp-program "scp2")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("rsync" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program "rsync")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args ("-e" "ssh"))
! (tramp-rcp-keep-date-arg "-t")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("rsh" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "rsh")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("ssh" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("ssh1" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-1" "-e" "none"))
! (tramp-rcp-args ("-1"))
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("ssh2" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-2" "-e" "none"))
! (tramp-rcp-args ("-2"))
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("ssh1_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh1")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("ssh2_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh2")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("telnet"
(tramp-connection-function tramp-open-connection-telnet)
! (tramp-rsh-program nil)
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program "telnet")
! (tramp-telnet-args nil))
("su" (tramp-connection-function tramp-open-connection-su)
! (tramp-rsh-program nil)
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program "su")
! (tramp-su-args ("-" "%u"))
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("sudo" (tramp-connection-function tramp-open-connection-su)
! (tramp-rsh-program nil)
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program "sudo")
! (tramp-su-args ("-u" "%u" "-s"))
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("multi" (tramp-connection-function tramp-open-connection-multi)
! (tramp-rsh-program nil)
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args nil)
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("scpx" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none" "-t" "-t" "/bin/sh"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("sshx" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "ssh")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-e" "none" "-t" "-t" "/bin/sh"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("krlogin"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "krlogin")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-x"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("plink"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "plink")
! (tramp-rcp-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-ssh")) ;optionally add "-v"
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg nil)
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
("pscp"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-rsh-program "plink")
! (tramp-rcp-program "pscp")
(tramp-remote-sh "/bin/sh")
! (tramp-rsh-args ("-ssh"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (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")
(tramp-remote-sh "/bin/sh -i")
! (tramp-rsh-args ("sh" "-i"))
! (tramp-rcp-args nil)
! (tramp-rcp-keep-date-arg "-p")
! (tramp-su-program nil)
! (tramp-su-args nil)
! (tramp-telnet-program nil)
! (tramp-telnet-args nil))
)
"*Alist of methods for remote files.
This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
--- 233,456 ----
(defcustom tramp-methods
'( ("rcp" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "rsh")
! (tramp-copy-program "rcp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("scp" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("scp1" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-1" "-e" "none"))
! (tramp-copy-args ("-1"))
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("scp2" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-2" "-e" "none"))
! (tramp-copy-args ("-2"))
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("scp1_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh1")
! (tramp-copy-program "scp1")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("scp2_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh2")
! (tramp-copy-program "scp2")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("rsync" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program "rsync")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args ("-e" "ssh"))
! (tramp-copy-keep-date-arg "-t")
! (tramp-password-end-of-line nil))
! ("remcp" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "remsh")
! (tramp-copy-program "rcp")
! (tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("rsh" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "rsh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("ssh" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("ssh1" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-1" "-e" "none"))
! (tramp-copy-args ("-1"))
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("ssh2" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-2" "-e" "none"))
! (tramp-copy-args ("-2"))
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("ssh1_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh1")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("ssh2_old"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh2")
! (tramp-copy-program nil)
! (tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
! ("remsh" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "remsh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("telnet"
(tramp-connection-function tramp-open-connection-telnet)
! (tramp-login-program "telnet")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("su" (tramp-connection-function tramp-open-connection-su)
! (tramp-login-program "su")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-" "%u"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("sudo" (tramp-connection-function tramp-open-connection-su)
! (tramp-login-program "sudo")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-u" "%u" "-s"
! "-p" "Password:"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("multi" (tramp-connection-function tramp-open-connection-multi)
! (tramp-login-program nil)
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args nil)
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("scpx" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none" "-t" "-t" "/bin/sh"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
("sshx" (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "ssh")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-e" "none" "-t" "-t" "/bin/sh"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("krlogin"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "krlogin")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-x"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line nil))
("plink"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "plink")
! (tramp-copy-program nil)
! (tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-ssh")) ;optionally add "-v"
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line "xy")) ;see docstring for "xy"
! ("plink1"
! (tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "plink")
! (tramp-copy-program nil)
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-1" "-ssh")) ;optionally add "-v"
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg nil)
! (tramp-password-end-of-line "xy")) ;see docstring for "xy"
("pscp"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "plink")
! (tramp-copy-program "pscp")
(tramp-remote-sh "/bin/sh")
! (tramp-login-args ("-ssh"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line "xy")) ;see docstring for "xy"
("fcp"
(tramp-connection-function tramp-open-connection-rsh)
! (tramp-login-program "fsh")
! (tramp-copy-program "fcp")
(tramp-remote-sh "/bin/sh -i")
! (tramp-login-args ("sh" "-i"))
! (tramp-copy-args nil)
! (tramp-copy-keep-date-arg "-p")
! (tramp-password-end-of-line nil))
)
"*Alist of methods for remote files.
This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
***************
*** 510,566 ****
which groks tilde expansion, but it can search for it. Also note
that \"/bin/sh\" exists on all Unixen, this might not be true for
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,
that is, normally you don't want to put \"-a -b\" or \"-f foo\"
here. Instead, you want two list elements, one for \"-a\" and one
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.
! * `tramp-rcp-keep-date-arg'
! This specifies the parameter to use for `rcp' when the timestamp
! of the original file should be kept. For `rcp', use `-p', for
`rsync', use `-t'.
! * `tramp-su-program'
! This specifies the name of the program to use for `su'.
! * `tramp-su-args'
! This specifies the list of arguments to pass to `su'.
! \"%u\" is replaced by the user name, use \"%%\" for a literal
! percent character.
! * `tramp-telnet-program'
! Specifies the telnet program to use when using
! `tramp-open-connection-telnet' to log in.
! * `tramp-telnet-args'
! Specifies list of arguments to pass to `telnet'. The hints for
! `tramp-rsh-args' also apply here.
!
! What does all this mean? Well, you should specify `tramp-rsh-program',
! `tramp-telnet-program' or `tramp-su-program' for all methods; this program
! is used to log in to the remote site. Then, there are two ways to
! actually transfer the files between the local and the remote side.
! One way is using an additional rcp-like program. If you want to do
! this, set `tramp-rcp-program' in the method.
Another possibility for file transfer is inline transfer, i.e. the
! file is passed through the same buffer used by `tramp-rsh-program'. In
this case, the file contents need to be protected since the
! `tramp-rsh-program' might use escape codes or the connection might not
be eight-bit clean. Therefore, file contents are encoded for transit.
See the variable `tramp-coding-commands' for details.
So, to summarize: if the method is an out-of-band method, then you
! must specify `tramp-rcp-program' and `tramp-rcp-args'. If it is an
inline method, then these two parameters should be nil. Every method,
inline or out of band, must specify `tramp-connection-function' plus
! the associated arguments (for example, the telnet program if you chose
`tramp-open-connection-telnet').
Notes:
--- 468,528 ----
which groks tilde expansion, but it can search for it. Also note
that \"/bin/sh\" exists on all Unixen, this might not be true for
the value that you decide to use. You Have Been Warned.
! * `tramp-login-program'
! This specifies the name of the program to use for logging in to the
! remote host. Depending on `tramp-connection-function', this may be
! the name of rsh or a workalike program (when
! `tramp-connection-function' is `tramp-open-connection-rsh'), or the
! name of telnet or a workalike (for `tramp-open-connection-telnet'),
! or the name of su or a workalike (for `tramp-open-connection-su').
! * `tramp-login-args'
This specifies the list of arguments to pass to the above
mentioned program. Please note that this is a list of arguments,
that is, normally you don't want to put \"-a -b\" or \"-f foo\"
here. Instead, you want two list elements, one for \"-a\" and one
for \"-b\", or one for \"-f\" and one for \"foo\".
! If `tramp-connection-function' is `tramp-open-connection-su', then
! \"%u\" in this list is replaced by the user name, and \"%%\" can
! be used to obtain a literal percent character.
! * `tramp-copy-program'
! This specifies the name of the program to use for remotely copying
! the file; this might be the absolute filename of rcp or the name of
! a workalike program.
! * `tramp-copy-args'
This specifies the list of parameters to pass to the above mentioned
! program, the hints for `tramp-login-args' also apply here.
! * `tramp-copy-keep-date-arg'
! This specifies the parameter to use for the copying program when the
! timestamp of the original file should be kept. For `rcp', use `-p', for
`rsync', use `-t'.
! * `tramp-password-end-of-line'
! This specifies the string to use for terminating the line after
! submitting the password. If this method parameter is nil, then the
! value of the normal variable `tramp-default-password-end-of-line'
! is used. This parameter is necessary because the \"plink\" program
! requires any two characters after sending the password. These do
! not have to be newline or carriage return characters. Other login
! programs are happy with just one character, the newline character.
! We use \"xy\" as the value for methods using \"plink\".
!
! What does all this mean? Well, you should specify `tramp-login-program'
! for all methods; this program is used to log in to the remote site. Then,
! there are two ways to actually transfer the files between the local and the
! remote side. One way is using an additional rcp-like program. If you want
! to do this, set `tramp-copy-program' in the method.
Another possibility for file transfer is inline transfer, i.e. the
! file is passed through the same buffer used by `tramp-login-program'. In
this case, the file contents need to be protected since the
! `tramp-login-program' might use escape codes or the connection might not
be eight-bit clean. Therefore, file contents are encoded for transit.
See the variable `tramp-coding-commands' for details.
So, to summarize: if the method is an out-of-band method, then you
! must specify `tramp-copy-program' and `tramp-copy-args'. If it is an
inline method, then these two parameters should be nil. Every method,
inline or out of band, must specify `tramp-connection-function' plus
! the associated arguments (for example, the login program if you chose
`tramp-open-connection-telnet').
Notes:
***************
*** 574,592 ****
:type '(repeat
(cons string
(set (list (const tramp-connection-function) function)
! (list (const tramp-rsh-program)
(choice (const nil) string))
! (list (const tramp-rcp-program)
(choice (const nil) string))
(list (const tramp-remote-sh)
(choice (const nil) string))
! (list (const tramp-rsh-args) (repeat string))
! (list (const tramp-rcp-args) (repeat string))
! (list (const tramp-rcp-keep-date-arg)
! (choice (const nil) string))
! (list (const tramp-su-program)
(choice (const nil) string))
- (list (const tramp-su-args) (repeat string))
(list (const tramp-encoding-command)
(choice (const nil) string))
(list (const tramp-decoding-command)
--- 536,551 ----
:type '(repeat
(cons string
(set (list (const tramp-connection-function) function)
! (list (const tramp-login-program)
(choice (const nil) string))
! (list (const tramp-copy-program)
(choice (const nil) string))
(list (const tramp-remote-sh)
(choice (const nil) string))
! (list (const tramp-login-args) (repeat string))
! (list (const tramp-copy-args) (repeat string))
! (list (const tramp-copy-keep-date-arg)
(choice (const nil) string))
(list (const tramp-encoding-command)
(choice (const nil) string))
(list (const tramp-decoding-command)
***************
*** 595,603 ****
(choice (const nil) function))
(list (const tramp-decoding-function)
(choice (const nil) function))
! (list (const tramp-telnet-program)
! (choice (const nil) string))
! (list (const tramp-telnet-args) (repeat string))))))
(defcustom tramp-multi-methods '("multi" "multiu")
"*List of multi-hop methods.
--- 554,561 ----
(choice (const nil) function))
(list (const tramp-decoding-function)
(choice (const nil) function))
! (list (const tramp-password-end-of-line)
! (choice (const nil) string))))))
(defcustom tramp-multi-methods '("multi" "multiu")
"*List of multi-hop methods.
***************
*** 609,617 ****
(defcustom tramp-multi-connection-function-alist
'(("telnet" tramp-multi-connect-telnet "telnet %h%n")
("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n")
("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n")
("su" tramp-multi-connect-su "su - %u%n")
! ("sudo" tramp-multi-connect-su "sudo -u %u -s%n"))
"*List of connection functions for multi-hop methods.
Each list item is a list of three items (METHOD FUNCTION COMMAND),
where METHOD is the name as used in the file name, FUNCTION is the
--- 567,576 ----
(defcustom tramp-multi-connection-function-alist
'(("telnet" tramp-multi-connect-telnet "telnet %h%n")
("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n")
+ ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n")
("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n")
("su" tramp-multi-connect-su "su - %u%n")
! ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n"))
"*List of connection functions for multi-hop methods.
Each list item is a list of three items (METHOD FUNCTION COMMAND),
where METHOD is the name as used in the file name, FUNCTION is the
***************
*** 629,635 ****
:group 'tramp
:type '(repeat (list string function string)))
! (defcustom tramp-default-method "ssh"
"*Default method to use for transferring files.
See `tramp-methods' for possibilities.
Also see `tramp-default-method-alist'."
--- 588,598 ----
:group 'tramp
:type '(repeat (list string function string)))
! (defcustom tramp-default-method
! (if (and (fboundp 'executable-find)
! (executable-find "plink"))
! "plink"
! "ssh")
"*Default method to use for transferring files.
See `tramp-methods' for possibilities.
Also see `tramp-default-method-alist'."
***************
*** 659,666 ****
(unless (memq system-type '(windows-nt))
'((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "~/.rhosts")))
! "Default list of (FUNCTION FILE) pairs to be examined for rsh methods."
! )
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-ssh
--- 622,628 ----
(unless (memq system-type '(windows-nt))
'((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "~/.rhosts")))
! "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.")
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-ssh
***************
*** 673,694 ****
(tramp-parse-rhosts "~/.shosts")
(tramp-parse-shosts "~/.ssh/known_hosts")
(tramp-parse-sconfig "~/.ssh/config")))
! "Default list of (FUNCTION FILE) pairs to be examined for ssh methods."
! )
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-telnet
(unless (memq system-type '(windows-nt))
'((tramp-parse-hosts "/etc/hosts")))
! "Default list of (FUNCTION FILE) pairs to be examined for telnet methods."
! )
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-su
(unless (memq system-type '(windows-nt))
'((tramp-parse-passwd "/etc/passwd")))
! "Default list of (FUNCTION FILE) pairs to be examined for su methods."
! )
(defcustom tramp-completion-function-alist
(list (cons "rcp" tramp-completion-function-alist-rsh)
--- 635,653 ----
(tramp-parse-rhosts "~/.shosts")
(tramp-parse-shosts "~/.ssh/known_hosts")
(tramp-parse-sconfig "~/.ssh/config")))
! "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-telnet
(unless (memq system-type '(windows-nt))
'((tramp-parse-hosts "/etc/hosts")))
! "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.")
;; Default values for non-Unices seeked
(defconst tramp-completion-function-alist-su
(unless (memq system-type '(windows-nt))
'((tramp-parse-passwd "/etc/passwd")))
! "Default list of (FUNCTION FILE) pairs to be examined for su methods.")
(defcustom tramp-completion-function-alist
(list (cons "rcp" tramp-completion-function-alist-rsh)
***************
*** 698,709 ****
--- 657,670 ----
(cons "scp1_old" tramp-completion-function-alist-ssh)
(cons "scp2_old" tramp-completion-function-alist-ssh)
(cons "rsync" tramp-completion-function-alist-rsh)
+ (cons "remcp" tramp-completion-function-alist-rsh)
(cons "rsh" tramp-completion-function-alist-rsh)
(cons "ssh" tramp-completion-function-alist-ssh)
(cons "ssh1" tramp-completion-function-alist-ssh)
(cons "ssh2" tramp-completion-function-alist-ssh)
(cons "ssh1_old" tramp-completion-function-alist-ssh)
(cons "ssh2_old" tramp-completion-function-alist-ssh)
+ (cons "remsh" tramp-completion-function-alist-rsh)
(cons "telnet" tramp-completion-function-alist-telnet)
(cons "su" tramp-completion-function-alist-su)
(cons "sudo" tramp-completion-function-alist-su)
***************
*** 712,717 ****
--- 673,679 ----
(cons "sshx" tramp-completion-function-alist-ssh)
(cons "krlogin" tramp-completion-function-alist-rsh)
(cons "plink" tramp-completion-function-alist-ssh)
+ (cons "plink1" tramp-completion-function-alist-ssh)
(cons "pscp" tramp-completion-function-alist-ssh)
(cons "fcp" tramp-completion-function-alist-ssh)
)
***************
*** 739,750 ****
"*String used for end of line in rsh connections.
I don't think this ever needs to be changed, so please tell me about it
if you need to change this.
! Also see `tramp-password-end-of-line'."
:group 'tramp
:type 'string)
! (defcustom tramp-password-end-of-line tramp-rsh-end-of-line
"*String used for end of line after sending a password.
It seems that people using plink under Windows need to send
\"\\r\\n\" (carriage-return, then newline) after a password, but just
\"\\n\" after all other lines. This variable can be used for the
--- 701,717 ----
"*String used for end of line in rsh connections.
I don't think this ever needs to be changed, so please tell me about it
if you need to change this.
! Also see the method parameter `tramp-password-end-of-line' and the normal
! variable `tramp-default-password-end-of-line'."
:group 'tramp
:type 'string)
! (defcustom tramp-default-password-end-of-line
! tramp-rsh-end-of-line
"*String used for end of line after sending a password.
+ This variable provides the default value for the method parameter
+ `tramp-password-end-of-line', see `tramp-methods' for more details.
+
It seems that people using plink under Windows need to send
\"\\r\\n\" (carriage-return, then newline) after a password, but just
\"\\n\" after all other lines. This variable can be used for the
***************
*** 774,787 ****
:type 'regexp)
(defcustom tramp-shell-prompt-pattern
! "^[^#$%>\n]*[#$%>] *"
"Regexp to match prompts from remote shell.
Normally, Tramp expects you to configure `shell-prompt-pattern'
correctly, but sometimes it happens that you are connecting to a
remote host which sends a different kind of shell prompt. Therefore,
Tramp recognizes things matched by `shell-prompt-pattern' as prompt,
and also things matched by this variable. The default value of this
! variable is the same as the default value of `shell-prompt-pattern',
which should work well in many cases."
:group 'tramp
:type 'regexp)
--- 741,754 ----
:type 'regexp)
(defcustom tramp-shell-prompt-pattern
! "^[^#$%>\n]*[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*"
"Regexp to match prompts from remote shell.
Normally, Tramp expects you to configure `shell-prompt-pattern'
correctly, but sometimes it happens that you are connecting to a
remote host which sends a different kind of shell prompt. Therefore,
Tramp recognizes things matched by `shell-prompt-pattern' as prompt,
and also things matched by this variable. The default value of this
! variable is similar to the default value of `shell-prompt-pattern',
which should work well in many cases."
:group 'tramp
:type 'regexp)
***************
*** 876,882 ****
for tilde expansion. The extra arguments should typically prevent the
shell from reading its init file."
:group 'tramp
! :type '(alist :key-type string :value-type string))
(defcustom tramp-prefix-format
(if tramp-unified-filenames "/" "/[")
--- 843,853 ----
for tilde expansion. The extra arguments should typically prevent the
shell from reading its init file."
:group 'tramp
! ;; This might be the wrong way to test whether the widget type
! ;; `alist' is available. Who knows the right way to test it?
! :type (if (get 'alist 'widget-type)
! '(alist :key-type string :value-type string)
! '(repeat (cons string string))))
(defcustom tramp-prefix-format
(if tramp-unified-filenames "/" "/[")
***************
*** 1241,1246 ****
--- 1212,1232 ----
:group 'tramp
:type '(repeat (list variable function)))
+ (defcustom tramp-initial-commands
+ '("unset correct"
+ "unset autocorrect")
+ "List of commands to send to the first remote shell that we see.
+ These commands will be sent to any shell, and thus they should be
+ designed to work in such circumstances. Also, restrict the commands
+ to the bare necessity for getting the remote shell into a state
+ where it is possible to execute the Bourne-ish shell.
+
+ At the moment, the command to execute the Bourne-ish shell uses strange
+ quoting which `tcsh' tries to correct, so we send the command \"unset
+ autocorrect\" to the remote host."
+ :group 'tramp
+ :type '(repeat string))
+
;; 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.
***************
*** 1315,1341 ****
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-rsh-program nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-rsh-args nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-rcp-program nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-rcp-args nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-rcp-keep-date-arg nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
--- 1301,1327 ----
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-login-program nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-login-args nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-copy-program nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-copy-args nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-copy-keep-date-arg nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
***************
*** 1360,1376 ****
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-telnet-program nil
! "This internal variable holds a parameter for `tramp-methods'.
! In the connection buffer, this variable has the value of the like-named
! method parameter, as specified in `tramp-methods' (which see).")
!
! (defvar tramp-telnet-args nil
! "This internal variable holds a parameter for `tramp-methods'.
! In the connection buffer, this variable has the value of the like-named
! method parameter, as specified in `tramp-methods' (which see).")
!
! (defvar tramp-su-program nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
--- 1346,1352 ----
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
! (defvar tramp-password-end-of-line nil
"This internal variable holds a parameter for `tramp-methods'.
In the connection buffer, this variable has the value of the like-named
method parameter, as specified in `tramp-methods' (which see).")
***************
*** 1673,1679 ****
normal Emacs functions.")
;; Handlers for foreign methods, like FTP or SMB, shall be plugged here.
! (defvar tramp-foreign-file-name-handler-alist nil
"Alist of elements (FUNCTION . HANDLER) for foreign methods handled
specially.
If (FUNCTION FILENAME) returns non-nil, then all I/O on that file is done by
calling HANDLER.")
--- 1649,1658 ----
normal Emacs functions.")
;; Handlers for foreign methods, like FTP or SMB, shall be plugged here.
! (defvar tramp-foreign-file-name-handler-alist
! ;; (identity . tramp-sh-file-name-handler) should always be the last
! ;; entry, since `identity' always matches.
! '((identity . tramp-sh-file-name-handler))
"Alist of elements (FUNCTION . HANDLER) for foreign methods handled
specially.
If (FUNCTION FILENAME) returns non-nil, then all I/O on that file is done by
calling HANDLER.")
***************
*** 1944,1949 ****
--- 1923,1939 ----
(setq numchase (1+ numchase))
(when (file-name-absolute-p symlink-target)
(setq result nil))
+ ;; If the symlink was absolute, we'll get a string like
+ ;; "/address@hidden:/some/target"; extract the
+ ;; "/some/target" part from it.
+ (when (tramp-tramp-file-p symlink-target)
+ (with-parsed-tramp-file-name symlink-target sym
+ (unless (equal (list multi-method method user host)
+ (list sym-multi-method sym-method
+ sym-user sym-host))
+ (error "Symlink target `%s' on wrong host"
+ symlink-target))
+ (setq symlink-target localname)))
(setq steps
(append (tramp-split-string symlink-target "/") steps)))
(t
***************
*** 2250,2256 ****
(fa2 (file-attributes file2)))
(if (and (not (equal (nth 5 fa1) '(0 0)))
(not (equal (nth 5 fa2) '(0 0))))
! (> 0 (car (tramp-time-diff (nth 5 fa1) (nth 5 fa2))))
;; If one of them is the dont-know value, then we can
;; still try to run a shell command on the remote host.
;; However, this only works if both files are Tramp
--- 2240,2246 ----
(fa2 (file-attributes file2)))
(if (and (not (equal (nth 5 fa1) '(0 0)))
(not (equal (nth 5 fa2) '(0 0))))
! (> 0 (tramp-time-diff (nth 5 fa1) (nth 5 fa2)))
;; If one of them is the dont-know value, then we can
;; still try to run a shell command on the remote host.
;; However, this only works if both files are Tramp
***************
*** 2321,2327 ****
"Like `file-symlink-p' for tramp files."
(with-parsed-tramp-file-name filename nil
(let ((x (car (tramp-handle-file-attributes filename))))
! (when (stringp x) x))))
(defun tramp-handle-file-writable-p (filename)
"Like `file-writable-p' for tramp files."
--- 2311,2323 ----
"Like `file-symlink-p' for tramp files."
(with-parsed-tramp-file-name filename nil
(let ((x (car (tramp-handle-file-attributes filename))))
! (when (stringp x)
! ;; When Tramp is running on VMS, then `file-name-absolute-p'
! ;; might do weird things.
! (if (file-name-absolute-p x)
! (tramp-make-tramp-file-name
! multi-method method user host x)
! x)))))
(defun tramp-handle-file-writable-p (filename)
"Like `file-writable-p' for tramp files."
***************
*** 2344,2350 ****
;; Other file name ops.
! ;; ;; Matthias Köppe <address@hidden>
;; (defun tramp-handle-directory-file-name (directory)
;; "Like `directory-file-name' for tramp files."
;; (if (and (eq (aref directory (- (length directory) 1)) ?/)
--- 2340,2346 ----
;; Other file name ops.
! ;; ;; Matthias K,Av(Bppe <address@hidden>
;; (defun tramp-handle-directory-file-name (directory)
;; "Like `directory-file-name' for tramp files."
;; (if (and (eq (aref directory (- (length directory) 1)) ?/)
***************
*** 2534,2541 ****
;; At least one file a tramp file?
(if (or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
! (tramp-do-copy-or-rename-file
! 'copy filename newname ok-if-already-exists keep-date)
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date))))
--- 2530,2539 ----
;; At least one file a tramp file?
(if (or (tramp-tramp-file-p filename)
(tramp-tramp-file-p newname))
! (let ((modes (file-modes filename)))
! (tramp-do-copy-or-rename-file
! 'copy filename newname ok-if-already-exists keep-date)
! (set-file-modes newname modes))
(tramp-run-real-handler
'copy-file
(list filename newname ok-if-already-exists keep-date))))
***************
*** 2604,2610 ****
;; source and target file.
;; CCC: If both source and target are Tramp files,
! ;; and both are using the same rcp-program, then we
;; can invoke rcp directly. Note that
;; default-directory should point to a local
;; directory if we want to invoke rcp.
--- 2602,2608 ----
;; source and target file.
;; CCC: If both source and target are Tramp files,
! ;; and both are using the same copy-program, then we
;; can invoke rcp directly. Note that
;; default-directory should point to a local
;; directory if we want to invoke rcp.
***************
*** 2631,2637 ****
(save-excursion
(set-buffer trampbuf) (erase-buffer)
(insert-file-contents-literally filename)
! (let ((coding-system-for-write 'no-conversion))
(write-region (point-min) (point-max) newname)))
;; If the operation was `rename', delete the original file.
(unless (eq op 'copy)
--- 2629,2638 ----
(save-excursion
(set-buffer trampbuf) (erase-buffer)
(insert-file-contents-literally filename)
! ;; We don't want the target file to be compressed, so we let-bind
! ;; `jka-compr-inhibit' to t.
! (let ((coding-system-for-write 'binary)
! (jka-compr-inhibit t))
(write-region (point-min) (point-max) newname)))
;; If the operation was `rename', delete the original file.
(unless (eq op 'copy)
***************
*** 2922,2928 ****
;; 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)))))))))
--- 2923,2930 ----
;; would otherwise use backslash.
(let ((directory-sep-char ?/))
(tramp-make-tramp-file-name
! multi-method (or method (tramp-find-default-method user host))
! user host
(tramp-drop-volume-letter
(tramp-run-real-handler 'expand-file-name
(list localname)))))))))
***************
*** 2955,2962 ****
(let (status)
(when (string-match "&[ \t]*\\'" command)
(error "Tramp doesn't grok asynchronous shell commands, yet"))
! (when error-buffer
! (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet"))
(save-excursion
(tramp-barf-unless-okay
multi-method method user host
--- 2957,2964 ----
(let (status)
(when (string-match "&[ \t]*\\'" command)
(error "Tramp doesn't grok asynchronous shell commands, yet"))
! ;; (when error-buffer
! ;; (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet"))
(save-excursion
(tramp-barf-unless-okay
multi-method method user host
***************
*** 2964,2971 ****
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 "/////"
;; somewhere. Let's just hope for the best...
(tramp-wait-for-output))
--- 2966,2977 ----
nil 'file-error
"tramp-handle-shell-command: Couldn't `cd %s'"
(tramp-shell-quote-argument localname))
! (tramp-send-command
! multi-method method user host
! (if error-buffer
! (format "( %s ) 2>/tmp/tramp.$$.err; tramp_old_status=$?"
! command)
! (format "%s ;tramp_old_status=$?" command)))
;; This will break if the shell command prints "/////"
;; somewhere. Let's just hope for the best...
(tramp-wait-for-output))
***************
*** 2977,2982 ****
--- 2983,3000 ----
(setq output-buffer (current-buffer)))
(set-buffer output-buffer)
(insert-buffer (tramp-get-buffer multi-method method user host))
+ (when error-buffer
+ (save-excursion
+ (unless (bufferp error-buffer)
+ (setq error-buffer (get-buffer-create error-buffer)))
+ (tramp-send-command
+ multi-method method user host
+ "cat /tmp/tramp.$$.err")
+ (tramp-wait-for-output)
+ (set-buffer error-buffer)
+ (insert-buffer (tramp-get-buffer multi-method method user host))
+ (tramp-send-command-and-check
+ multi-method method user host "rm -f /tmp/tramp.$$.err")))
(save-excursion
(tramp-send-command multi-method method user host "cd")
(tramp-wait-for-output)
***************
*** 3012,3025 ****
(with-parsed-tramp-file-name filename nil
(let ((output-buf (get-buffer-create "*tramp output*"))
(tramp-buf (tramp-get-buffer multi-method method user host))
! (rcp-program (tramp-get-rcp-program
! multi-method
! (tramp-find-method multi-method method user host)
! user host))
! (rcp-args (tramp-get-rcp-args
! multi-method
! (tramp-find-method multi-method method user host)
! user host))
;; We used to bind the following as late as possible.
;; loc-enc and loc-dec were bound directly before the if
;; statement that checks them. But the functions
--- 3030,3043 ----
(with-parsed-tramp-file-name filename nil
(let ((output-buf (get-buffer-create "*tramp output*"))
(tramp-buf (tramp-get-buffer multi-method method user host))
! (copy-program (tramp-get-copy-program
! multi-method
! (tramp-find-method multi-method method user host)
! user host))
! (copy-args (tramp-get-copy-args
! multi-method
! (tramp-find-method multi-method method user host)
! user host))
;; We used to bind the following as late as possible.
;; loc-enc and loc-dec were bound directly before the if
;; statement that checks them. But the functions
***************
*** 3035,3041 ****
(error "Cannot make local copy of non-existing file `%s'"
filename))
(setq tmpfil (tramp-make-temp-file))
! (cond (rcp-program
;; Use rcp-like program for file transfer.
(tramp-message-for-buffer
multi-method method user host
--- 3053,3065 ----
(error "Cannot make local copy of non-existing file `%s'"
filename))
(setq tmpfil (tramp-make-temp-file))
! (cond (copy-program
! ;; The following should be changed. We need a more general
! ;; mechanism to parse extra host args.
! (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
! (setq copy-args (cons "-p" (cons (match-string 2 host)
! rsh-args)))
! (setq host (match-string 1 host)))
;; Use rcp-like program for file transfer.
(tramp-message-for-buffer
multi-method method user host
***************
*** 3044,3054 ****
(unless (equal
0
(apply #'call-process
! rcp-program
nil output-buf nil
! (append rcp-args
(list
! (tramp-make-rcp-program-file-name
user host
(tramp-shell-quote-argument localname))
tmpfil))))
--- 3068,3078 ----
(unless (equal
0
(apply #'call-process
! copy-program
nil output-buf nil
! (append copy-args
(list
! (tramp-make-copy-program-file-name
user host
(tramp-shell-quote-argument localname))
tmpfil))))
***************
*** 3056,3062 ****
(error
(concat "tramp-handle-file-local-copy: `%s' didn't work, "
"see buffer `%s' for details")
! rcp-program output-buf))
(tramp-message-for-buffer
multi-method method user host
5 "Fetching %s to tmp file %s...done" filename tmpfil))
--- 3080,3086 ----
(error
(concat "tramp-handle-file-local-copy: `%s' didn't work, "
"see buffer `%s' for details")
! copy-program output-buf))
(tramp-message-for-buffer
multi-method method user host
5 "Fetching %s to tmp file %s...done" filename tmpfil))
***************
*** 3096,3102 ****
;; line from the output here. Go to point-max,
;; search backward for tramp_exit_status, delete
;; between point and point-max if found.
! (let ((coding-system-for-write 'no-conversion))
(funcall loc-dec (point-min) (point-max))
(write-region (point-min) (point-max) tmpfil))
(kill-buffer tmpbuf))
--- 3120,3126 ----
;; line from the output here. Go to point-max,
;; search backward for tramp_exit_status, delete
;; between point and point-max if found.
! (let ((coding-system-for-write 'binary))
(funcall loc-dec (point-min) (point-max))
(write-region (point-min) (point-max) tmpfil))
(kill-buffer tmpbuf))
***************
*** 3133,3139 ****
(signal 'file-error
(format "File `%s' not found on remote host" filename))
(list (expand-file-name filename) 0))
! (let ((local-copy (file-local-copy filename))
(coding-system-used nil)
(result nil))
(when visit
--- 3157,3171 ----
(signal 'file-error
(format "File `%s' not found on remote host" filename))
(list (expand-file-name filename) 0))
! ;; `insert-file-contents-literally' takes care to avoid calling
! ;; jka-compr. By let-binding inhibit-file-name-operation, we
! ;; propagate that care to the file-local-copy operation.
! (let ((local-copy
! (let ((inhibit-file-name-operation
! (when (eq inhibit-file-name-operation
! 'insert-file-contents)
! 'file-local-copy)))
! (file-local-copy filename)))
(coding-system-used nil)
(result nil))
(when visit
***************
*** 3180,3189 ****
(error "File not overwritten")))
(with-parsed-tramp-file-name filename nil
(let ((curbuf (current-buffer))
! (rcp-program (tramp-get-rcp-program
! multi-method (tramp-find-method multi-method method
user host)
! user host))
! (rcp-args (tramp-get-rcp-args
multi-method
(tramp-find-method multi-method method user host)
user host))
--- 3212,3222 ----
(error "File not overwritten")))
(with-parsed-tramp-file-name filename nil
(let ((curbuf (current-buffer))
! (copy-program (tramp-get-copy-program
! multi-method
! (tramp-find-method multi-method method user host)
! user host))
! (copy-args (tramp-get-copy-args
multi-method
(tramp-find-method multi-method method user host)
user host))
***************
*** 3221,3237 ****
;; decoding command must be specified. However, if the method
;; _also_ specifies an encoding function, then that is used for
;; encoding the contents of the tmp file.
! (cond (rcp-program
;; use rcp-like program for file transfer
! (let ((argl (append rcp-args
(list
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)
(save-excursion (set-buffer trampbuf) (erase-buffer))
(when tramp-debug-buffer
(save-excursion
--- 3254,3277 ----
;; decoding command must be specified. However, if the method
;; _also_ specifies an encoding function, then that is used for
;; encoding the contents of the tmp file.
! (cond (copy-program
! ;; The following should be changed. We need a more general
! ;; mechanism to parse extra host args.
! (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
! (setq copy-args (cons "-p" (cons (match-string 2 host)
! rsh-args)))
! (setq host (match-string 1 host)))
!
;; use rcp-like program for file transfer
! (let ((argl (append copy-args
(list
tmpfil
! (tramp-make-copy-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'..." copy-program)
(save-excursion (set-buffer trampbuf) (erase-buffer))
(when tramp-debug-buffer
(save-excursion
***************
*** 3239,3257 ****
method user host))
(goto-char (point-max))
(tramp-insert-with-face
! 'bold (format "$ %s %s\n" rcp-program
(mapconcat 'identity argl " ")))))
(unless (equal 0
(apply #'call-process
! rcp-program nil trampbuf nil argl))
(pop-to-buffer trampbuf)
(error
"Cannot write region to file `%s', command `%s' failed"
! filename rcp-program))
(tramp-message-for-buffer
multi-method method user host
6 "Transferring file using `%s'...done"
! rcp-program)))
((and rem-enc rem-dec)
;; Use inline file transfer
(let ((tmpbuf (get-buffer-create " *tramp file transfer*")))
--- 3279,3297 ----
method user host))
(goto-char (point-max))
(tramp-insert-with-face
! 'bold (format "$ %s %s\n" copy-program
(mapconcat 'identity argl " ")))))
(unless (equal 0
(apply #'call-process
! copy-program nil trampbuf nil argl))
(pop-to-buffer trampbuf)
(error
"Cannot write region to file `%s', command `%s' failed"
! filename copy-program))
(tramp-message-for-buffer
multi-method method user host
6 "Transferring file using `%s'...done"
! copy-program)))
((and rem-enc rem-dec)
;; Use inline file transfer
(let ((tmpbuf (get-buffer-create " *tramp file transfer*")))
***************
*** 3485,3512 ****
(defun tramp-find-foreign-file-name-handler (filename)
"Return foreign file name handler if exists."
(when (tramp-tramp-file-p filename)
! (let (elt res)
! (dolist (elt tramp-foreign-file-name-handler-alist res)
(when (funcall (car elt) filename)
(setq res (cdr elt))))
res)))
;; Main function.
;;;###autoload
(defun tramp-file-name-handler (operation &rest args)
! "Invoke tramp file name handler.
Falls back to normal file name handler if no tramp file name handler exists."
(save-match-data
! (let* ((fn (assoc operation tramp-file-name-handler-alist))
! (filename (apply 'tramp-file-name-for-operation operation args))
(foreign (tramp-find-foreign-file-name-handler filename)))
(cond
(foreign (apply foreign operation args))
- (fn (apply (cdr fn) args))
(t (tramp-run-real-handler operation args))))))
(put 'tramp-file-name-handler 'file-remote-p t) ;for file-remote-p
;;;###autoload
(defun tramp-completion-file-name-handler (operation &rest args)
"Invoke tramp file name completion handler.
--- 3525,3565 ----
(defun tramp-find-foreign-file-name-handler (filename)
"Return foreign file name handler if exists."
(when (tramp-tramp-file-p filename)
! (let (elt
! res
! (handler-alist tramp-foreign-file-name-handler-alist))
! (while handler-alist
! (setq elt (car handler-alist)
! handler-alist (cdr handler-alist))
(when (funcall (car elt) filename)
+ (setq handler-alist nil)
(setq res (cdr elt))))
res)))
;; Main function.
;;;###autoload
(defun tramp-file-name-handler (operation &rest args)
! "Invoke Tramp file name handler.
Falls back to normal file name handler if no tramp file name handler exists."
(save-match-data
! (let* ((filename (apply 'tramp-file-name-for-operation operation args))
(foreign (tramp-find-foreign-file-name-handler filename)))
(cond
(foreign (apply foreign operation args))
(t (tramp-run-real-handler operation args))))))
+ ;;;###autoload
(put 'tramp-file-name-handler 'file-remote-p t) ;for file-remote-p
+ (defun tramp-sh-file-name-handler (operation &rest args)
+ "Invoke remote-shell Tramp file name handler.
+ Fall back to normal file name handler if no Tramp handler exists."
+ (save-match-data
+ (let ((fn (assoc operation tramp-file-name-handler-alist)))
+ (if fn
+ (apply (cdr fn) args)
+ (tramp-run-real-handler operation args)))))
+
;;;###autoload
(defun tramp-completion-file-name-handler (operation &rest args)
"Invoke tramp file name completion handler.
***************
*** 3520,3525 ****
--- 3573,3581 ----
(save-match-data (apply (cdr fn) args))
(tramp-completion-run-real-handler operation args))))
+ ;;;###autoload
+ (put 'tramp-completion-file-name-handler 'safe-magic t)
+
;; Register in file name handler alist
;;;###autoload
(add-to-list 'file-name-handler-alist
***************
*** 4139,4150 ****
(defun tramp-buffer-name (multi-method method user host)
"A name for the connection buffer for USER at HOST using METHOD."
! (cond (multi-method
! (tramp-buffer-name-multi-method "tramp" multi-method method user
host))
! (user
! (format "*tramp/%s address@hidden" method user host))
! (t
! (format "*tramp/%s %s*" method host))))
(defun tramp-buffer-name-multi-method (prefix multi-method method user host)
"A name for the multi method connection buffer.
--- 4195,4206 ----
(defun tramp-buffer-name (multi-method method user host)
"A name for the connection buffer for USER at HOST using METHOD."
! (if multi-method
! (tramp-buffer-name-multi-method "tramp" multi-method method user host)
! (let ((method (tramp-find-method multi-method method user host)))
! (if user
! (format "*tramp/%s address@hidden" method user host))
! (format "*tramp/%s %s*" method host))))
(defun tramp-buffer-name-multi-method (prefix multi-method method user host)
"A name for the multi method connection buffer.
***************
*** 4174,4186 ****
(defun tramp-debug-buffer-name (multi-method method user host)
"A name for the debug buffer for USER at HOST using METHOD."
! (cond (multi-method
! (tramp-buffer-name-multi-method "debug tramp"
! multi-method method user host))
! (user
! (format "*debug tramp/%s address@hidden" method user host))
! (t
! (format "*debug tramp/%s %s*" method host))))
(defun tramp-get-debug-buffer (multi-method method user host)
"Get the debug buffer for USER at HOST using METHOD."
--- 4230,4242 ----
(defun tramp-debug-buffer-name (multi-method method user host)
"A name for the debug buffer for USER at HOST using METHOD."
! (if multi-method
! (tramp-buffer-name-multi-method "debug tramp"
! multi-method method user host)
! (let ((method (tramp-find-method multi-method method user host)))
! (if user
! (format "*debug tramp/%s address@hidden" method user host)
! (format "*debug tramp/%s %s*" method host)))))
(defun tramp-get-debug-buffer (multi-method method user host)
"Get the debug buffer for USER at HOST using METHOD."
***************
*** 4564,4569 ****
--- 4620,4647 ----
(unless (eq exit 'ok)
(error "Login failed"))))
+ ;; Functions to execute when we have seen the remote shell prompt but
+ ;; before we exec the Bourne-ish shell. Note that these commands
+ ;; might be sent to any shell, not just a Bourne-ish shell. This
+ ;; means that the commands need to work in all shells. (It is also
+ ;; okay for some commands to just fail with an error message, but
+ ;; please make sure that they at least don't crash the odd shell people
+ ;; might be running...)
+ (defun tramp-process-initial-commands (p
+ multi-method method user host
+ commands)
+ "Send list of commands to remote host, in order."
+ (let (cmd)
+ (while commands
+ (setq cmd (pop commands))
+ (erase-buffer)
+ (tramp-message 10 "Sending command to remote shell: %s"
+ cmd)
+ (tramp-send-command multi-method method user host cmd)
+ (tramp-barf-if-no-shell-prompt
+ p 60 "Remote shell command failed: %s" cmd))
+ (erase-buffer)))
+
;; The actual functions for opening connections.
(defun tramp-open-connection-telnet (multi-method method user host)
***************
*** 4608,4619 ****
(p (apply 'start-process
(tramp-buffer-name multi-method method user host)
(tramp-get-buffer multi-method method user host)
! (tramp-get-telnet-program
multi-method
(tramp-find-method multi-method method user host)
user host)
host
! (tramp-get-telnet-args
multi-method
(tramp-find-method multi-method method user host)
user host)))
--- 4686,4697 ----
(p (apply 'start-process
(tramp-buffer-name multi-method method user host)
(tramp-get-buffer multi-method method user host)
! (tramp-get-login-program
multi-method
(tramp-find-method multi-method method user host)
user host)
host
! (tramp-get-login-args
multi-method
(tramp-find-method multi-method method user host)
user host)))
***************
*** 4665,4682 ****
(let ((process-environment (copy-sequence process-environment))
(bufnam (tramp-buffer-name multi-method method user host))
(buf (tramp-get-buffer multi-method method user host))
! (rsh-program (tramp-get-rsh-program
multi-method
(tramp-find-method multi-method method user host)
user host))
! (rsh-args (tramp-get-rsh-args
multi-method
(tramp-find-method multi-method method user host)
user host)))
;; The following should be changed. We need a more general
;; mechanism to parse extra host args.
(when (string-match "\\([^#]*\\)#\\(.*\\)" host)
! (setq rsh-args (cons "-p" (cons (match-string 2 host) rsh-args)))
(setq host (match-string 1 host)))
(setenv "TERM" tramp-terminal-type)
(let* ((default-directory (tramp-temporary-file-directory))
--- 4743,4760 ----
(let ((process-environment (copy-sequence process-environment))
(bufnam (tramp-buffer-name multi-method method user host))
(buf (tramp-get-buffer multi-method method user host))
! (login-program (tramp-get-login-program
multi-method
(tramp-find-method multi-method method user host)
user host))
! (login-args (tramp-get-login-args
multi-method
(tramp-find-method multi-method method user host)
user host)))
;; The following should be changed. We need a more general
;; mechanism to parse extra host args.
(when (string-match "\\([^#]*\\)#\\(.*\\)" host)
! (setq login-args (cons "-p" (cons (match-string 2 host) rsh-args)))
(setq host (match-string 1 host)))
(setenv "TERM" tramp-terminal-type)
(let* ((default-directory (tramp-temporary-file-directory))
***************
*** 4687,4696 ****
(> 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)
--- 4765,4774 ----
(> emacs-major-version 20))
tramp-dos-coding-system))
(p (if (and user (not (string= user "")))
! (apply #'start-process bufnam buf login-program
! host "-l" user login-args)
! (apply #'start-process bufnam buf login-program
! host login-args)))
(found nil))
(process-kill-without-query p)
***************
*** 4740,4753 ****
(p (apply 'start-process
(tramp-buffer-name multi-method method user host)
(tramp-get-buffer multi-method method user host)
! (tramp-get-su-program
multi-method
(tramp-find-method multi-method method user host)
user host)
(mapcar
(lambda (x)
(format-spec x `((?u . ,(or user "root")))))
! (tramp-get-su-args
multi-method
(tramp-find-method multi-method method user host)
user host))))
--- 4818,4831 ----
(p (apply 'start-process
(tramp-buffer-name multi-method method user host)
(tramp-get-buffer multi-method method user host)
! (tramp-get-login-program
multi-method
(tramp-find-method multi-method method user host)
user host)
(mapcar
(lambda (x)
(format-spec x `((?u . ,(or user "root")))))
! (tramp-get-login-args
multi-method
(tramp-find-method multi-method method user host)
user host))))
***************
*** 4951,4962 ****
"]]"))))
found))
(defun tramp-enter-password (p prompt)
"Prompt for a password and send it to the remote end.
Uses PROMPT as a prompt and sends the password to process P."
(let ((pw (tramp-read-passwd prompt)))
(erase-buffer)
! (process-send-string p (concat pw tramp-password-end-of-line))))
;; HHH: Not Changed. This might handle the case where USER is not
;; given in the "File name" very poorly. Then, the local
--- 5029,5064 ----
"]]"))))
found))
+ (defun tramp-wait-for-shell-prompt (proc timeout)
+ "Wait for the shell prompt to appear from process PROC within TIMEOUT
seconds.
+ See `tramp-wait-for-regexp' for more details.
+ Shell prompt pattern is determined by variables `shell-prompt-pattern'
+ and `tramp-shell-prompt-pattern'."
+ (tramp-wait-for-regexp
+ proc timeout
+ (format "\\(%s\\|%s\\)\\'"
+ shell-prompt-pattern tramp-shell-prompt-pattern)))
+
+ (defun tramp-barf-if-no-shell-prompt (proc timeout &rest error-args)
+ "Wait for shell prompt and barf if none appears.
+ Looks at process PROC to see if a shell prompt appears in TIMEOUT
+ seconds. If not, it produces an error message with the given ERROR-ARGS."
+ (unless (tramp-wait-for-shell-prompt proc timeout)
+ (pop-to-buffer (buffer-name))
+ (apply 'error error-args)))
+
(defun tramp-enter-password (p prompt)
"Prompt for a password and send it to the remote end.
Uses PROMPT as a prompt and sends the password to process P."
(let ((pw (tramp-read-passwd prompt)))
(erase-buffer)
! (process-send-string
! p (concat pw
! (tramp-get-password-end-of-line
! tramp-current-multi-method
! tramp-current-method
! tramp-current-user
! tramp-current-host)))))
;; HHH: Not Changed. This might handle the case where USER is not
;; given in the "File name" very poorly. Then, the local
***************
*** 4982,4987 ****
--- 5084,5091 ----
;; a Kerberos login.
(sit-for 1)
(tramp-discard-garbage-erase-buffer p multi-method method user host)
+ (tramp-process-initial-commands p multi-method method user host
+ tramp-initial-commands)
;; It is useful to set the prompt in the following command because
;; some people have a setting for $PS1 which /bin/sh doesn't know
;; about and thus /bin/sh will display a strange prompt. For
***************
*** 4994,5048 ****
;; 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))
! (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 "$ exec env PS1='$ ' %s\n"
! (tramp-get-remote-sh multi-method method user host)))))
! (tramp-message 9 "Waiting 30s for remote `%s' to come up..."
! (tramp-get-remote-sh multi-method method user host))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Remote `%s' didn't come up. See buffer `%s' for details"
! (tramp-get-remote-sh multi-method method user host)
! (buffer-name)))
! (tramp-message 9 "Setting up remote shell environment")
(tramp-discard-garbage-erase-buffer p multi-method method user host)
! (process-send-string
! nil (format "stty -inlcr -echo kill '^U'%s" tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `stty -echo', see buffer `%s'" (buffer-name)))
(erase-buffer)
! (process-send-string nil (format "TERM=dumb; export TERM%s"
! tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `TERM=dumb; export TERM', see buffer `%s'"
(buffer-name)))
;; Try to set up the coding system correctly.
;; CCC this can't be the right way to do it. Hm.
(save-excursion
(erase-buffer)
(tramp-message 9 "Determining coding system")
! (process-send-string nil (format "echo foo ; echo bar %s"
! tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `echo foo; echo bar' to determine line endings'"))
(goto-char (point-min))
(if (featurep 'mule)
;; Use MULE to select the right EOL convention for communicating
--- 5098,5128 ----
;; 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.
! (tramp-send-command-internal
! multi-method method user host
! (format "exec env 'ENV=' 'PS1=$ ' %s"
! (tramp-get-remote-sh multi-method method user host))
! (format "remote `%s' to come up"
! (tramp-get-remote-sh multi-method method user host)))
! (tramp-barf-if-no-shell-prompt
! p 30
! "Remote `%s' didn't come up. See buffer `%s' for details"
! (tramp-get-remote-sh multi-method method user host)
! (buffer-name))
! (tramp-message 8 "Setting up remote shell environment")
(tramp-discard-garbage-erase-buffer p multi-method method user host)
! (tramp-send-command-internal multi-method method user host
! "stty -inlcr -echo kill '^U'")
(erase-buffer)
! (tramp-send-command-internal multi-method method user host
! "TERM=dumb; export TERM")
;; Try to set up the coding system correctly.
;; CCC this can't be the right way to do it. Hm.
(save-excursion
(erase-buffer)
(tramp-message 9 "Determining coding system")
! (tramp-send-command-internal multi-method method user host
! "echo foo ; echo bar")
(goto-char (point-min))
(if (featurep 'mule)
;; Use MULE to select the right EOL convention for communicating
***************
*** 5065,5122 ****
;; We have found a ^M but cannot frob the process coding system
;; because we're running on a non-MULE Emacs. Let's try
;; stty, instead.
(tramp-message 9 "Trying `stty -onlcr'")
! (process-send-string nil (format "stty -onlcr%s"
tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `stty -onlcr', see buffer `%s'" (buffer-name))))))
(erase-buffer)
(tramp-message
9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'")
! (process-send-string
! nil (format "HISTFILE=$HOME/.tramp_history; HISTSIZE=1%s"
! tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error (concat "Couldn't `HISTFILE=$HOME/.tramp_history; "
! "HISTSIZE=1', see buffer `%s'")
! (buffer-name)))
(erase-buffer)
(tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
! (process-send-string
! nil (format "set +o vi +o emacs%s" ;mustn't `>/dev/null' with AIX?
! tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `set +o vi +o emacs', see buffer `%s'"
! (buffer-name)))
(erase-buffer)
(tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'")
! (process-send-string
! nil (format "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null%s"
! tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `unset MAIL MAILCHECK MAILPATH', see buffer `%s'"
! (buffer-name)))
(erase-buffer)
(tramp-message 9 "Waiting 30s for `unset CDPATH'")
! (process-send-string
! nil (format "unset CDPATH%s" tramp-rsh-end-of-line))
! (unless (tramp-wait-for-regexp
! p 30 (format "\\(%s\\|%s\\)\\'"
! shell-prompt-pattern tramp-shell-prompt-pattern))
! (pop-to-buffer (buffer-name))
! (error "Couldn't `unset CDPATH', see buffer `%s'"
! (buffer-name)))
(erase-buffer)
(tramp-message 9 "Setting shell prompt")
;; Douglas Gray Stephens <address@hidden> says that we must
--- 5145,5172 ----
;; We have found a ^M but cannot frob the process coding system
;; because we're running on a non-MULE Emacs. Let's try
;; stty, instead.
+ (erase-buffer)
(tramp-message 9 "Trying `stty -onlcr'")
! (tramp-send-command-internal multi-method method user host
! "stty -onlcr"))))
(erase-buffer)
(tramp-message
9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'")
! (tramp-send-command-internal multi-method method user host
! "HISTFILE=$HOME/.tramp_history; HISTSIZE=1")
(erase-buffer)
(tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
! (tramp-send-command-internal multi-method method user host
! "set +o vi +o emacs")
(erase-buffer)
(tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'")
! (tramp-send-command-internal
! multi-method method user host
! "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null")
(erase-buffer)
(tramp-message 9 "Waiting 30s for `unset CDPATH'")
! (tramp-send-command-internal multi-method method user host
! "unset CDPATH")
(erase-buffer)
(tramp-message 9 "Setting shell prompt")
;; Douglas Gray Stephens <address@hidden> says that we must
***************
*** 5240,5246 ****
" -e '" tramp-perl-file-attributes "' $1 2>/dev/null\n"
"}"))
(tramp-wait-for-output)
! (unless (tramp-get-rcp-program
multi-method
(tramp-find-method multi-method method user host)
user host)
--- 5290,5296 ----
" -e '" tramp-perl-file-attributes "' $1 2>/dev/null\n"
"}"))
(tramp-wait-for-output)
! (unless (tramp-get-copy-program
multi-method
(tramp-find-method multi-method method user host)
user host)
***************
*** 5282,5288 ****
(tramp-set-connection-property "ln" ln multi-method method user host)))
(erase-buffer)
;; Find the right encoding/decoding commands to use.
! (unless (tramp-get-rcp-program
multi-method
(tramp-find-method multi-method method user host)
user host)
--- 5332,5338 ----
(tramp-set-connection-property "ln" ln multi-method method user host)))
(erase-buffer)
;; Find the right encoding/decoding commands to use.
! (unless (tramp-get-copy-program
multi-method
(tramp-find-method multi-method method user host)
user host)
***************
*** 5527,5532 ****
--- 5577,5593 ----
(process-send-string proc
(concat command tramp-rsh-end-of-line))))
+ (defun tramp-send-command-internal
+ (multi-method method user host command &optional msg)
+ "Send command to remote host and wait for success.
+ Sends COMMAND, then waits 30 seconds for shell prompt."
+ (tramp-send-command multi-method method user host command t t)
+ (when msg
+ (tramp-message 9 "Waiting 30s for %s..." msg))
+ (tramp-barf-if-no-shell-prompt
+ nil 30
+ "Couldn't `%s', see buffer `%s'" command (buffer-name)))
+
(defun tramp-wait-for-output (&optional timeout)
"Wait for output from remote rsh command."
(let ((proc (get-buffer-process (current-buffer)))
***************
*** 5657,5663 ****
(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)))
--- 5718,5725 ----
(mapconcat 'identity
(split-string string "\n")
tramp-rsh-end-of-line))
! (unless (or (string= string "")
! (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)))
***************
*** 5963,5970 ****
(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)))
--- 6025,6032 ----
(incf i)))
(concat prefix hops localname)))
! (defun tramp-make-copy-program-file-name (user host localname)
! "Create a file name suitable to be passed to `rcp' and workalikes."
(if user
(format "address@hidden:%s" user host localname)
(format "%s:%s" host localname)))
***************
*** 5972,5979 ****
(defun tramp-method-out-of-band-p (multi-method method user host)
"Return t if this is an out-of-band method, nil otherwise.
It is important to check for this condition, since it is not possible
! to enter a password for the `tramp-rcp-program'."
! (tramp-get-rcp-program
multi-method
(tramp-find-method multi-method method user host)
user host))
--- 6034,6041 ----
(defun tramp-method-out-of-band-p (multi-method method user host)
"Return t if this is an out-of-band method, nil otherwise.
It is important to check for this condition, since it is not possible
! to enter a password for the `tramp-copy-program'."
! (tramp-get-copy-program
multi-method
(tramp-find-method multi-method method user host)
user host))
***************
*** 6071,6139 ****
(error "Method `%s' didn't specify a remote shell"
(or multi-method method)))))
! (defun tramp-get-rsh-program (multi-method method user host)
! (second (or (assoc 'tramp-rsh-program
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify an rsh program"
(or multi-method method)))))
! (defun tramp-get-rsh-args (multi-method method user host)
! (second (or (assoc 'tramp-rsh-args
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify rsh args"
(or multi-method method)))))
! (defun tramp-get-rcp-program (multi-method method user host)
! (second (or (assoc 'tramp-rcp-program
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify an rcp program"
(or multi-method method)))))
! (defun tramp-get-rcp-args (multi-method method user host)
! (second (or (assoc 'tramp-rcp-args
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify rcp args"
(or multi-method method)))))
! (defun tramp-get-rcp-keep-date-arg (multi-method method user host)
! (second (or (assoc 'tramp-rcp-keep-date-arg
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
(error "Method `%s' didn't specify `keep-date' arg for tramp"
(or multi-method method)))))
! (defun tramp-get-su-program (multi-method method user host)
! (second (or (assoc 'tramp-su-program
! (assoc (tramp-find-method multi-method method user host)
! tramp-methods))
! (error "Method `%s' didn't specify a su program"
! (or multi-method method)))))
!
! (defun tramp-get-su-args (multi-method method user host)
! (second (or (assoc 'tramp-su-args
! (assoc (tramp-find-method multi-method method user host)
! tramp-methods))
! (error "Method `%s' didn't specify su args"
! (or multi-method method)))))
!
! (defun tramp-get-telnet-program (multi-method method user host)
! (second (or (assoc 'tramp-telnet-program
! (assoc (tramp-find-method multi-method method user host)
! tramp-methods))
! (error "Method `%s' didn't specify a telnet program"
! (or multi-method method)))))
!
! (defun tramp-get-telnet-args (multi-method method user host)
! (second (or (assoc 'tramp-telnet-args
! (assoc (tramp-find-method multi-method method user host)
! tramp-methods))
! (error "Method `%s' didn't specify telnet args"
! (or multi-method method)))))
!
;; Auto saving to a special directory.
--- 6133,6181 ----
(error "Method `%s' didn't specify a remote shell"
(or multi-method method)))))
! (defun tramp-get-login-program (multi-method method user host)
! (second (or (assoc 'tramp-login-program
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify a login program"
(or multi-method method)))))
! (defun tramp-get-login-args (multi-method method user host)
! (second (or (assoc 'tramp-login-args
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify login args"
(or multi-method method)))))
! (defun tramp-get-copy-program (multi-method method user host)
! (second (or (assoc 'tramp-copy-program
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify a copy program"
(or multi-method method)))))
! (defun tramp-get-copy-args (multi-method method user host)
! (second (or (assoc 'tramp-copy-args
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
! (error "Method `%s' didn't specify copy args"
(or multi-method method)))))
! (defun tramp-get-copy-keep-date-arg (multi-method method user host)
! (second (or (assoc 'tramp-copy-keep-date-arg
(assoc (tramp-find-method multi-method method user host)
tramp-methods))
(error "Method `%s' didn't specify `keep-date' arg for tramp"
(or multi-method method)))))
! (defun tramp-get-password-end-of-line (multi-method method user host)
! (let ((entry (assoc 'tramp-password-end-of-line
! (assoc (tramp-find-method multi-method method user host)
! tramp-methods))))
! (unless entry
! (error "Method `%s' didn't specify `password-end-of-line' arg for tramp"
! (or multi-method method)))
! (or (second entry) tramp-default-password-end-of-line)))
;; Auto saving to a special directory.
***************
*** 6221,6238 ****
NOTE: This function will fail if the time difference is too large to
fit in an integer."
;; Pacify byte-compiler with `symbol-function'.
! (cond ((fboundp 'subtract-time)
! (cadr (funcall (symbol-function 'subtract-time) t1 t2)))
((fboundp 'itimer-time-difference)
(floor (funcall
(symbol-function 'itimer-time-difference)
(if (< (length t1) 3) (append t1 '(0)) t1)
(if (< (length t2) 3) (append t2 '(0)) t2))))
(t
! ;; snarfed from Emacs 21 time-date.el
! (cadr (let ((borrow (< (cadr t1) (cadr t2))))
(list (- (car t1) (car t2) (if borrow 1 0))
! (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))))
(defun tramp-coding-system-change-eol-conversion (coding-system eol-type)
"Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
--- 6263,6290 ----
NOTE: This function will fail if the time difference is too large to
fit in an integer."
;; Pacify byte-compiler with `symbol-function'.
! (cond ((and (fboundp 'subtract-time)
! (fboundp 'float-time))
! (funcall (symbol-function 'float-time)
! (funcall (symbol-function 'subtract-time) t1 t2)))
! ((and (fboundp 'subtract-time)
! (fboundp 'time-to-seconds))
! (funcall (symbol-function 'time-to-seconds)
! (funcall (symbol-function 'subtract-time) t1 t2)))
((fboundp 'itimer-time-difference)
(floor (funcall
(symbol-function 'itimer-time-difference)
(if (< (length t1) 3) (append t1 '(0)) t1)
(if (< (length t2) 3) (append t2 '(0)) t2))))
(t
! ;; snarfed from Emacs 21 time-date.el; combining
! ;; time-to-seconds and subtract-time
! (let ((time (let ((borrow (< (cadr t1) (cadr t2))))
(list (- (car t1) (car t2) (if borrow 1 0))
! (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))
! (+ (* (car time) 65536.0)
! (cadr time)
! (/ (or (nth 2 time) 0) 1000000.0))))))
(defun tramp-coding-system-change-eol-conversion (coding-system eol-type)
"Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
***************
*** 6390,6396 ****
tramp-auto-save-directory ; vars to dump
tramp-default-method
tramp-rsh-end-of-line
! tramp-password-end-of-line
tramp-remote-path
tramp-login-prompt-regexp
tramp-password-prompt-regexp
--- 6442,6448 ----
tramp-auto-save-directory ; vars to dump
tramp-default-method
tramp-rsh-end-of-line
! tramp-default-password-end-of-line
tramp-remote-path
tramp-login-prompt-regexp
tramp-password-prompt-regexp
***************
*** 6528,6534 ****
;; transfer method to use. (Greg Stark)
;; * Remove unneeded parameters from methods.
;; * Invoke rsync once for copying a whole directory hierarchy.
! ;; (Francesco Potortì)
;; * Should we set PATH ourselves or should we rely on the remote end
;; to do it?
;; * Do the autoconf thing.
--- 6580,6586 ----
;; transfer method to use. (Greg Stark)
;; * Remove unneeded parameters from methods.
;; * Invoke rsync once for copying a whole directory hierarchy.
! ;; (Francesco Potort,Al(B)
;; * Should we set PATH ourselves or should we rely on the remote end
;; to do it?
;; * Do the autoconf thing.
***************
*** 6590,6593 ****
--- 6642,6646 ----
;; unhandled-file-name-directory
;; vc-registered
+ ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a
;;; tramp.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/net/tramp.el [lexbind],
Miles Bader <=