annotate lisp/net/tramp.el @ 46584:f548d7d0c651

Bump version to 2.0.2. (tramp-methods): Rename methods invoking "ssh1" or "ssh2" to longer names. Use old names "sm1", "sm2" and so on for methods invoking "ssh -1" or "ssh -2". (tramp-multi-file-name-structure-separate): Typo, its name was set to "tramp-file-name-structure-separate". Trivial patch. From Steve Youngs <youngs@xemacs.org>. (tramp-multi-sh-program): New variable. (tramp-open-connection-multi): Use it. Now you can use multi methods from Windows (at least in principle). (tramp-do-copy-or-rename-via-buffer): New function. (tramp-do-copy-or-rename-file): Use it. Change and simplify logic. Omit special case of invoking rcp directly to copy the files. (tramp-open-connection-su, tramp-multi-connect-telnet) (tramp-multi-connect-rlogin, tramp-multi-connect-su) (tramp-make-tramp-file-name, tramp-make-tramp-multi-file-name): Use backticks in format-spec for brevity and to avoid character/number confusion in XEmacs.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sun, 21 Jul 2002 13:49:06 +0000
parents 3996ea20e5e3
children 54b975949d6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- coding: iso-8859-1; -*-
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5 ;; Author: Kai.Grossjohann@CS.Uni-Dortmund.DE
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6 ;; Keywords: comm, processes
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
9
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
13 ;; any later version.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
14
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
18 ;; GNU General Public License for more details.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
19
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
24
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
25 ;;; Commentary:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
26
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
27 ;; This package provides remote file editing, similar to ange-ftp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
28 ;; The difference is that ange-ftp uses FTP to transfer files between
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
29 ;; the local and the remote host, whereas tramp.el uses a combination
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
30 ;; of rsh and rcp or other work-alike programs, such as ssh/scp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
31 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
32 ;; For more detailed instructions, please see the info file, which is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
33 ;; included in the file `tramp.tar.gz' mentioned below.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
34 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
35 ;; Notes:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
36 ;; -----
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
37 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
38 ;; This package only works for Emacs 20 and higher, and for XEmacs 21
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
39 ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
40 ;; 19 is reported to have other problems. For XEmacs 21, you need the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
41 ;; package `fsf-compat' for the `with-timeout' macro.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
42 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
43 ;; This version might not work with pre-Emacs 21 VC unless VC is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
44 ;; loaded before tramp.el. Could you please test this and tell me about
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
45 ;; the result? Thanks.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
46 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
47 ;; Also see the todo list at the bottom of this file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
48 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
49 ;; The current version of tramp.el can be retrieved from the following
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
50 ;; URL: ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/tramp.tar.gz
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
51 ;; For your convenience, the *.el file is available separately from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
52 ;; the same directory.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
53 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
54 ;; There's a mailing list for this, as well. Its name is:
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
55 ;; tramp-devel@mail.freesoftware.fsf.org
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
56 ;; Send a mail with `help' in the subject (!) to the administration
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
57 ;; address for instructions on joining the list. The administration
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
58 ;; address is:
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
59 ;; tramp-devel-request@mail.freesoftware.fsf.org
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
60 ;; You can also use the Web to subscribe, under the following URL:
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
61 ;; http://mail.freesoftware.fsf.org/mailman/listinfo/tramp-devel
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
62 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
63 ;; For the adventurous, the current development sources are available
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
64 ;; via CVS. You can find instructions about this at the following URL:
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
65 ;; http://savannah.gnu.org/projects/tramp/
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
66 ;; Click on "CVS" in the navigation bar near the top.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
67 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
68 ;; Don't forget to put on your asbestos longjohns, first!
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
69
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
70 ;;; Code:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
71
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
72 (defconst tramp-version "2.0.2"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
73 "This version of tramp.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
74 (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
75 "Email address to send bug reports to.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
76
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
77 (require 'timer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
78 (require 'format-spec) ;from Gnus 5.8, also in tar ball
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
79 (require 'base64) ;for the mimencode methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
80 (require 'shell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
81 (require 'advice)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
82
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
83 ;; ;; It does not work to load EFS after loading TRAMP.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
84 ;; (when (fboundp 'efs-file-handler-function)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
85 ;; (require 'efs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
86
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
87 (eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
88 (require 'cl)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
89 (require 'custom)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
90 ;; Emacs 19.34 compatibility hack -- is this needed?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
91 (or (>= emacs-major-version 20)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
92 (load "cl-seq")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
93
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
94 (unless (boundp 'custom-print-functions)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
95 (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
96
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
97 ;;; User Customizable Internal Variables:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
98
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
99 (defgroup tramp nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
100 "Edit remote files with a combination of rsh and rcp or similar programs."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
101 :group 'files)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
102
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
103 (defcustom tramp-verbose 10
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
104 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
105 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
106 :type 'integer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
107
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
108 (defcustom tramp-debug-buffer nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
109 "*Whether to send all commands and responses to a debug buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
110 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
111 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
112
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
113 (defcustom tramp-auto-save-directory nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
114 "*Put auto-save files in this directory, if set.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
115 The idea is to use a local directory so that auto-saving is faster."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
116 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
117 :type '(choice (const nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
118 string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
119
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
120 (defcustom tramp-sh-program "/bin/sh"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
121 "*Use this program for shell commands on the local host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
122 This MUST be a Bourne-like shell. This shell is used to execute
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
123 the encoding and decoding command on the local host, so if you
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
124 want to use `~' in those commands, you should choose a shell here
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
125 which groks tilde expansion. `/bin/sh' normally does not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
126 understand tilde expansion.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
127
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
128 Note that this variable is not used for remote commands. There are
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
129 mechanisms in tramp.el which automatically determine the right shell to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
130 use for the remote host."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
131 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
132 :type '(file :must-match t))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
133
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
134 (defcustom tramp-multi-sh-program
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
135 (if (memq system-type '(windows-nt))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
136 "cmd.exe"
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
137 tramp-sh-program)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
138 "*Use this program for bootstrapping multi-hop connections.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
139 This variable is similar to `tramp-sh-program', but it is only used
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
140 when initializing a multi-hop connection. Therefore, the set of
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
141 commands sent to this shell is quite restricted, and if you are
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
142 careful it works to use CMD.EXE under Windows (instead of a Bourne-ish
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
143 shell which does not normally exist on Windows anyway).
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
144
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
145 To use multi-hop methods from Windows, you also need suitable entries
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
146 in `tramp-multi-connection-function-alist' for the first hop.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
147
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
148 This variable defaults to CMD.EXE on Windows NT, and to the value of
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
149 `tramp-sh-program' on other systems."
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
150 :group 'tramp
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
151 :type '(file :must-match t))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
152
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
153 ;; CCC I have changed all occurrences of comint-quote-filename with
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
154 ;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
155 ;; There, comint-quote-filename was removed altogether. If it turns
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
156 ;; out to be necessary there, something will need to be done.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
157 ;;-(defcustom tramp-file-name-quote-list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
158 ;;- '(?] ?[ ?\| ?& ?< ?> ?\( ?\) ?\; ?\ ?\* ?\? ?\! ?\" ?\' ?\` ?# ?\@ ?\+ )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
159 ;;- "*Protect these characters from the remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
160 ;;-Any character in this list is quoted (preceded with a backslash)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
161 ;;-because it means something special to the shell. This takes effect
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
162 ;;-when sending file and directory names to the remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
163 ;;-
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
164 ;;-See `comint-file-name-quote-list' for details."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
165 ;;- :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
166 ;;- :type '(repeat character))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
167
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
168 (defcustom tramp-methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
169 '( ("rcp" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
170 (tramp-rsh-program "rsh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
171 (tramp-rcp-program "rcp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
172 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
173 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
174 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
175 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
176 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
177 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
178 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
179 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
180 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
181 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
182 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
183 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
184 ("scp" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
185 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
186 (tramp-rcp-program "scp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
187 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
188 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
189 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
190 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
191 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
192 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
193 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
194 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
195 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
196 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
197 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
198 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
199 ("scp1" (tramp-connection-function tramp-open-connection-rsh)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
200 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
201 (tramp-rcp-program "scp")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
202 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
203 (tramp-rsh-args ("-1" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
204 (tramp-rcp-args ("-1"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
205 (tramp-rcp-keep-date-arg "-p")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
206 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
207 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
208 (tramp-encoding-command nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
209 (tramp-decoding-command nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
210 (tramp-encoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
211 (tramp-decoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
212 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
213 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
214 ("scp2" (tramp-connection-function tramp-open-connection-rsh)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
215 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
216 (tramp-rcp-program "scp")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
217 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
218 (tramp-rsh-args ("-2" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
219 (tramp-rcp-args ("-2"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
220 (tramp-rcp-keep-date-arg "-p")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
221 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
222 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
223 (tramp-encoding-command nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
224 (tramp-decoding-command nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
225 (tramp-encoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
226 (tramp-decoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
227 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
228 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
229 ("scp-ssh1" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
230 (tramp-rsh-program "ssh1")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
231 (tramp-rcp-program "scp1")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
232 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
233 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
234 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
235 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
236 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
237 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
238 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
239 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
240 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
241 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
242 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
243 (tramp-telnet-args nil))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
244 ("scp-ssh2" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
245 (tramp-rsh-program "ssh2")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
246 (tramp-rcp-program "scp2")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
247 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
248 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
249 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
250 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
251 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
252 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
253 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
254 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
255 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
256 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
257 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
258 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
259 ("rsync" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
260 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
261 (tramp-rcp-program "rsync")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
262 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
263 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
264 (tramp-rcp-args ("-e" "ssh"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
265 (tramp-rcp-keep-date-arg "-t")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
266 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
267 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
268 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
269 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
270 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
271 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
272 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
273 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
274 ("ru" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
275 (tramp-rsh-program "rsh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
276 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
277 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
278 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
279 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
280 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
281 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
282 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
283 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
284 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
285 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
286 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
287 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
288 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
289 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
290 ("su" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
291 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
292 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
293 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
294 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
295 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
296 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
297 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
298 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
299 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
300 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
301 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
302 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
303 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
304 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
305 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
306 ("su1" (tramp-connection-function tramp-open-connection-rsh)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
307 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
308 (tramp-rcp-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
309 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
310 (tramp-rsh-args ("-1" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
311 (tramp-rcp-args ("-1"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
312 (tramp-rcp-keep-date-arg nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
313 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
314 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
315 (tramp-encoding-command "uuencode xxx")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
316 (tramp-decoding-command
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
317 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
318 (tramp-encoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
319 (tramp-decoding-function uudecode-decode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
320 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
321 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
322 ("su2" (tramp-connection-function tramp-open-connection-rsh)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
323 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
324 (tramp-rcp-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
325 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
326 (tramp-rsh-args ("-2" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
327 (tramp-rcp-args ("-2"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
328 (tramp-rcp-keep-date-arg nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
329 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
330 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
331 (tramp-encoding-command "uuencode xxx")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
332 (tramp-decoding-command
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
333 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
334 (tramp-encoding-function nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
335 (tramp-decoding-function uudecode-decode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
336 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
337 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
338 ("su-ssh1" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
339 (tramp-rsh-program "ssh1")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
340 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
341 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
342 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
343 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
344 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
345 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
346 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
347 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
348 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
349 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
350 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
351 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
352 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
353 (tramp-telnet-args nil))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
354 ("su-ssh2" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
355 (tramp-rsh-program "ssh2")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
356 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
357 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
358 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
359 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
360 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
361 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
362 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
363 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
364 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
365 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
366 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
367 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
368 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
369 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
370 ("rm" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
371 (tramp-rsh-program "rsh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
372 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
373 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
374 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
375 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
376 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
377 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
378 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
379 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
380 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
381 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
382 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
383 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
384 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
385 ("sm" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
386 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
387 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
388 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
389 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
390 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
391 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
392 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
393 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
394 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
395 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
396 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
397 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
398 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
399 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
400 ("smp" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
401 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
402 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
403 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
404 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
405 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
406 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
407 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
408 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
409 (tramp-encoding-command "tramp_mimencode")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
410 (tramp-decoding-command "tramp_mimedecode")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
411 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
412 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
413 (tramp-telnet-program nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
414 ("sm1" (tramp-connection-function tramp-open-connection-rsh)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
415 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
416 (tramp-rcp-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
417 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
418 (tramp-rsh-args ("-1" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
419 (tramp-rcp-args ("-1"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
420 (tramp-rcp-keep-date-arg nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
421 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
422 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
423 (tramp-encoding-command "mimencode -b")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
424 (tramp-decoding-command "mimencode -u -b")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
425 (tramp-encoding-function base64-encode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
426 (tramp-decoding-function base64-decode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
427 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
428 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
429 ("sm2" (tramp-connection-function tramp-open-connection-rsh)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
430 (tramp-rsh-program "ssh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
431 (tramp-rcp-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
432 (tramp-remote-sh "/bin/sh")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
433 (tramp-rsh-args ("-2" "-e" "none"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
434 (tramp-rcp-args ("-2"))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
435 (tramp-rcp-keep-date-arg nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
436 (tramp-su-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
437 (tramp-su-args nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
438 (tramp-encoding-command "mimencode -b")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
439 (tramp-decoding-command "mimencode -u -b")
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
440 (tramp-encoding-function base64-encode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
441 (tramp-decoding-function base64-decode-region)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
442 (tramp-telnet-program nil)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
443 (tramp-telnet-args nil))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
444 ("sm-ssh1" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
445 (tramp-rsh-program "ssh1")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
446 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
447 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
448 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
449 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
450 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
451 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
452 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
453 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
454 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
455 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
456 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
457 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
458 (tramp-telnet-args nil))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
459 ("sm-ssh2" (tramp-connection-function tramp-open-connection-rsh)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
460 (tramp-rsh-program "ssh2")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
461 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
462 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
463 (tramp-rsh-args ("-e" "none"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
464 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
465 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
466 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
467 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
468 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
469 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
470 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
471 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
472 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
473 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
474 ("tm" (tramp-connection-function tramp-open-connection-telnet)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
475 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
476 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
477 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
478 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
479 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
480 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
481 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
482 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
483 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
484 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
485 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
486 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
487 (tramp-telnet-program "telnet")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
488 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
489 ("tu" (tramp-connection-function tramp-open-connection-telnet)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
490 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
491 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
492 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
493 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
494 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
495 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
496 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
497 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
498 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
499 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
500 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
501 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
502 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
503 (tramp-telnet-program "telnet")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
504 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
505 ("sum" (tramp-connection-function tramp-open-connection-su)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
506 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
507 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
508 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
509 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
510 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
511 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
512 (tramp-su-program "su")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
513 (tramp-su-args ("-" "%u"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
514 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
515 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
516 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
517 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
518 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
519 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
520 ("suu" (tramp-connection-function tramp-open-connection-su)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
521 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
522 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
523 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
524 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
525 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
526 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
527 (tramp-su-program "su")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
528 (tramp-su-args ("-" "%u"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
529 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
530 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
531 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
532 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
533 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
534 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
535 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
536 ("sudm" (tramp-connection-function tramp-open-connection-su)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
537 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
538 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
539 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
540 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
541 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
542 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
543 (tramp-su-program "sudo")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
544 (tramp-su-args ("-u" "%u" "-s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
545 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
546 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
547 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
548 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
549 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
550 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
551 ("sudu" (tramp-connection-function tramp-open-connection-su)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
552 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
553 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
554 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
555 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
556 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
557 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
558 (tramp-su-program "sudo")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
559 (tramp-su-args ("-u" "%u" "-s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
560 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
561 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
562 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
563 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
564 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
565 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
566 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
567 ("multi" (tramp-connection-function tramp-open-connection-multi)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
568 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
569 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
570 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
571 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
572 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
573 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
574 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
575 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
576 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
577 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
578 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
579 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
580 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
581 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
582 ("multiu" (tramp-connection-function tramp-open-connection-multi)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
583 (tramp-rsh-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
584 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
585 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
586 (tramp-rsh-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
587 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
588 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
589 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
590 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
591 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
592 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
593 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
594 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
595 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
596 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
597 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
598 ("scpx" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
599 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
600 (tramp-rcp-program "scp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
601 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
602 (tramp-rsh-args ("-e" "none" "-t" "-t" "/bin/sh"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
603 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
604 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
605 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
606 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
607 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
608 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
609 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
610 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
611 ("smx" (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
612 (tramp-rsh-program "ssh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
613 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
614 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
615 (tramp-rsh-args ("-e" "none" "-t" "-t" "/bin/sh"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
616 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
617 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
618 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
619 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
620 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
621 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
622 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
623 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
624 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
625 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
626 ("km"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
627 (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
628 (tramp-rsh-program "krlogin")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
629 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
630 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
631 (tramp-rsh-args ("-x"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
632 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
633 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
634 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
635 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
636 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
637 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
638 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
639 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
640 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
641 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
642 ("plinku"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
643 (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
644 (tramp-rsh-program "plink")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
645 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
646 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
647 (tramp-rsh-args ("-ssh")) ;optionally add "-v"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
648 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
649 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
650 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
651 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
652 (tramp-encoding-command "uuencode xxx")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
653 (tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
654 "( uudecode -o - 2>/dev/null || uudecode -p 2>/dev/null )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
655 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
656 (tramp-decoding-function uudecode-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
657 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
658 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
659 ("plinkm"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
660 (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
661 (tramp-rsh-program "plink")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
662 (tramp-rcp-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
663 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
664 (tramp-rsh-args ("-ssh")) ;optionally add "-v"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
665 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
666 (tramp-rcp-keep-date-arg nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
667 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
668 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
669 (tramp-encoding-command "mimencode -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
670 (tramp-decoding-command "mimencode -u -b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
671 (tramp-encoding-function base64-encode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
672 (tramp-decoding-function base64-decode-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
673 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
674 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
675 ("pscp"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
676 (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
677 (tramp-rsh-program "plink")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
678 (tramp-rcp-program "pscp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
679 (tramp-remote-sh "/bin/sh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
680 (tramp-rsh-args ("-ssh"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
681 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
682 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
683 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
684 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
685 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
686 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
687 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
688 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
689 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
690 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
691 ("fcp"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
692 (tramp-connection-function tramp-open-connection-rsh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
693 (tramp-rsh-program "fsh")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
694 (tramp-rcp-program "fcp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
695 (tramp-remote-sh "/bin/sh -i")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
696 (tramp-rsh-args ("sh" "-i"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
697 (tramp-rcp-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
698 (tramp-rcp-keep-date-arg "-p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
699 (tramp-su-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
700 (tramp-su-args nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
701 (tramp-encoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
702 (tramp-decoding-command nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
703 (tramp-encoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
704 (tramp-decoding-function nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
705 (tramp-telnet-program nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
706 (tramp-telnet-args nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
707 )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
708 "*Alist of methods for remote files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
709 This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
710 Each NAME stands for a remote access method. Each PARAM is a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
711 pair of the form (KEY VALUE). The following KEYs are defined:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
712 * `tramp-connection-function'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
713 This specifies the function to use to connect to the remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
714 Currently, `tramp-open-connection-rsh', `tramp-open-connection-telnet'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
715 and `tramp-open-connection-su' are defined. See the documentation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
716 of these functions for more details.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
717 * `tramp-remote-sh'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
718 This specifies the Bourne shell to use on the remote host. This
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
719 MUST be a Bourne-like shell. It is normally not necessary to set
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
720 this to any value other than \"/bin/sh\": tramp wants to use a shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
721 which groks tilde expansion, but it can search for it. Also note
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
722 that \"/bin/sh\" exists on all Unixen, this might not be true for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
723 the value that you decide to use. You Have Been Warned.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
724 * `tramp-rsh-program'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
725 This specifies the name of the program to use for rsh; this might be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
726 the full path to rsh or the name of a workalike program.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
727 * `tramp-rsh-args'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
728 This specifies the list of arguments to pass to the above
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
729 mentioned program. Please note that this is a list of arguments,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
730 that is, normally you don't want to put \"-a -b\" or \"-f foo\"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
731 here. Instead, you want two list elements, one for \"-a\" and one
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
732 for \"-b\", or one for \"-f\" and one for \"foo\".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
733 * `tramp-rcp-program'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
734 This specifies the name of the program to use for rcp; this might be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
735 the full path to rcp or the name of a workalike program.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
736 * `tramp-rcp-args'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
737 This specifies the list of parameters to pass to the above mentioned
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
738 program, the hints for `tramp-rsh-args' also apply here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
739 * `tramp-rcp-keep-date-arg'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
740 This specifies the parameter to use for `rcp' when the timestamp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
741 of the original file should be kept. For `rcp', use `-p', for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
742 `rsync', use `-t'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
743 * `tramp-su-program'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
744 This specifies the name of the program to use for `su'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
745 * `tramp-su-args'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
746 This specifies the list of arguments to pass to `su'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
747 \"%u\" is replaced by the user name, use \"%%\" for a literal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
748 percent character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
749 * `tramp-encoding-command'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
750 This specifies a command to use to encode the file contents for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
751 transfer. The command should read the raw file contents from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
752 standard input and write the encoded file contents to standard
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
753 output. In this string, the percent escape \"%f\" should be used
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
754 to indicate the file to convert. Use \"%%\" if you need a literal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
755 percent character in your command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
756 * `tramp-decoding-command'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
757 This specifies a command to use to decode file contents encoded
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
758 with `tramp-encoding-command'. The command should read from standard
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
759 input and write to standard output.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
760 * `tramp-encoding-function'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
761 This specifies a function to be called to encode the file contents
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
762 on the local side. This function should accept two arguments
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
763 START and END, the beginning and end of the region to encode. The
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
764 region should be replaced with the encoded contents.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
765 * `tramp-decoding-function'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
766 Same for decoding on the local side.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
767 * `tramp-telnet-program'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
768 Specifies the telnet program to use when using
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
769 `tramp-open-connection-telnet' to log in.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
770 * `tramp-telnet-args'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
771 Specifies list of arguments to pass to `telnet'. The hints for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
772 `tramp-rsh-args' also apply here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
773
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
774 What does all this mean? Well, you should specify `tramp-rsh-program',
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
775 `tramp-telnet-program' or `tramp-su-program' for all methods; this program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
776 is used to log in to the remote site. Then, there are two ways to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
777 actually transfer the files between the local and the remote side.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
778 One way is using an additional rcp-like program. If you want to do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
779 this, set `tramp-rcp-program' in the method.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
780
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
781 Another possibility for file transfer is inline transfer, i.e. the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
782 file is passed through the same buffer used by `tramp-rsh-program'. In
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
783 this case, the file contents need to be protected since the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
784 `tramp-rsh-program' might use escape codes or the connection might not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
785 be eight-bit clean. Therefore, file contents are encoded for transit.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
786
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
787 Two possibilities for encoding are uuencode/uudecode and mimencode.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
788 For uuencode/uudecode you want to set `tramp-encoding-command' to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
789 something like \"uuencode\" and `tramp-decoding-command' to \"uudecode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
790 -p\". For mimencode you want to set `tramp-encoding-command' to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
791 something like \"mimencode -b\" and `tramp-decoding-command' to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
792 \"mimencode -b -u\".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
793
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
794 When using inline transfer, you can use a program or a Lisp function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
795 on the local side to encode or decode the file contents. Set the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
796 `tramp-encoding-function' and `tramp-decoding-function' parameters to nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
797 in order to use the commands or to the function to use. It is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
798 possible to specify one function and the other parameter as nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
799
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
800 So, to summarize: if the method is an inline method, you must specify
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
801 `tramp-encoding-command' and `tramp-decoding-command', and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
802 `tramp-rcp-program' must be nil. If the method is out of band, then
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
803 you must specify `tramp-rcp-program' and `tramp-rcp-args' and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
804 `tramp-encoding-command' and `tramp-decoding-command' must be nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
805 Every method, inline or out of band, must specify
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
806 `tramp-connection-function' plus the associated arguments (for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
807 example, the telnet program if you chose
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
808 `tramp-open-connection-telnet').
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
809
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
810 Notes:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
811
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
812 When using `tramp-open-connection-su' the phrase `open connection to a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
813 remote host' sounds strange, but it is used nevertheless, for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
814 consistency. No connection is opened to a remote host, but `su' is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
815 started on the local host. You are not allowed to specify a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
816 host other than `localhost' or the name of the local host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
817
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
818 Using a uuencode/uudecode inline method is discouraged, please use one
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
819 of the base64 methods instead since base64 encoding is much more
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
820 reliable and the commands are more standardized between the different
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
821 Unix versions. But if you can't use base64 for some reason, please
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
822 note that the default uudecode command does not work well for some
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
823 Unices, in particular AIX and Irix. For AIX, you might want to use
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
824 the following command for uudecode:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
825
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
826 sed '/^begin/d;/^[` ]$/d;/^end/d' | iconv -f uucode -t ISO8859-1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
827
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
828 For Irix, no solution is known yet."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
829 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
830 :type '(repeat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
831 (cons string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
832 (set (list (const tramp-connection-function) function)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
833 (list (const tramp-rsh-program)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
834 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
835 (list (const tramp-rcp-program)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
836 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
837 (list (const tramp-remote-sh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
838 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
839 (list (const tramp-rsh-args) (repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
840 (list (const tramp-rcp-args) (repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
841 (list (const tramp-rcp-keep-date-arg)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
842 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
843 (list (const tramp-su-program)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
844 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
845 (list (const tramp-su-args) (repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
846 (list (const tramp-encoding-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
847 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
848 (list (const tramp-decoding-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
849 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
850 (list (const tramp-encoding-function)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
851 (choice (const nil) function))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
852 (list (const tramp-decoding-function)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
853 (choice (const nil) function))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
854 (list (const tramp-telnet-program)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
855 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
856 (list (const tramp-telnet-args) (repeat string))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
857
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
858 (defcustom tramp-multi-methods '("multi" "multiu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
859 "*List of multi-hop methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
860 Each entry in this list should be a method name as mentioned in the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
861 variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
862 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
863 :type '(repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
864
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
865 (defcustom tramp-multi-connection-function-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
866 '(("telnet" tramp-multi-connect-telnet "telnet %h%n")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
867 ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
868 ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
869 ("su" tramp-multi-connect-su "su - %u%n")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
870 ("sudo" tramp-multi-connect-su "sudo -u %u -s%n"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
871 "*List of connection functions for multi-hop methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
872 Each list item is a list of three items (METHOD FUNCTION COMMAND),
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
873 where METHOD is the name as used in the file name, FUNCTION is the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
874 function to be executed, and COMMAND is the shell command used for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
875 connecting.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
876
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
877 COMMAND may contain percent escapes. `%u' will be replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
878 user name, `%h' will be replaced with the host name, and `%n' will be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
879 replaced with an end-of-line character, as specified in the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
880 `tramp-rsh-end-of-line'. Use `%%' for a literal percent character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
881 Note that the interpretation of the percent escapes also depends on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
882 the FUNCTION. For example, the `%u' escape is forbidden with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
883 function `tramp-multi-connect-telnet'. See the documentation of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
884 various functions for details."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
885 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
886 :type '(repeat (list string function string)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
887
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
888 (defcustom tramp-default-method "sm"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
889 ;;(if (featurep 'xemacs) "sm" "ftp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
890 "*Default method to use for transferring files.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
891 See `tramp-methods' for possibilities.
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
892 Also see `tramp-default-method-alist'.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
893
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
894 Emacs uses a unified filename syntax for Tramp and Ange-FTP.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
895 For backward compatibility, the default value of this variable
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
896 is \"ftp\" on Emacs. But XEmacs uses a separate filename syntax
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
897 for Tramp and EFS, so there the default method is \"sm\"."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
898 :group 'tramp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
899 :type 'string)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
900
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
901 (defcustom tramp-default-method-alist
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
902 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
903 nil
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
904 '(("\\`ftp\\." "" "ftp")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
905 ("" "\\`\\(anonymous\\|ftp\\)\\'" "ftp")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
906 "*Default method to use for specific user/host pairs.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
907 This is an alist of items (HOST USER METHOD). The first matching item
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
908 specifies the method to use for a file name which does not specify a
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
909 method. HOST and USER are regular expressions or nil, which is
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
910 interpreted as a regular expression which always matches. If no entry
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
911 matches, the variable `tramp-default-method' takes effect.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
912
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
913 If the file name does not specify the user, lookup is done using the
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
914 empty string for the user name.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
915
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
916 See `tramp-methods' for a list of possibilities for METHOD."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
917 :group 'tramp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
918 :type '(repeat (list (regexp :tag "Host regexp")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
919 (regexp :tag "User regexp")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
920 (string :tag "Method"))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
921
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
922 (defcustom tramp-ftp-method "ftp"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
923 "*When this method name is used, forward all calls to Ange-FTP."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
924 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
925 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
926
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
927 (defcustom tramp-rsh-end-of-line "\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
928 "*String used for end of line in rsh connections.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
929 I don't think this ever needs to be changed, so please tell me about it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
930 if you need to change this."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
931 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
932 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
933
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
934 (defcustom tramp-remote-path
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
935 '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/ccs/bin"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
936 "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
937 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
938 "*List of directories to search for executables on remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
939 Please notify me about other semi-standard directories to include here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
940
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
941 You can use `~' in this list, but when searching for a shell which groks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
942 tilde expansion, all directory names starting with `~' will be ignored."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
943 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
944 :type '(repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
945
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
946 (defcustom tramp-login-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
947 ".*ogin: *$"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
948 "*Regexp matching login-like prompts.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
949 The regexp should match the whole line."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
950 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
951 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
952
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
953 (defcustom tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
954 "^.*\\([pP]assword\\|passphrase.*\\):\^@? *$"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
955 "*Regexp matching password-like prompts.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
956 The regexp should match the whole line.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
957
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
958 The `sudo' program appears to insert a `^@' character into the prompt."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
959 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
960 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
961
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
962 (defcustom tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
963 (concat "^.*\\(Permission denied.\\|Login [Ii]ncorrect\\|"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
964 "Received signal [0-9]+\\|Connection \\(refused\\|closed\\)\\|"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
965 "Sorry, try again.\\|Name or service not known\\).*$")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
966 "*Regexp matching a `login failed' message.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
967 The regexp should match the whole line."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
968 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
969 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
970
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
971 (defcustom tramp-temp-name-prefix "tramp."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
972 "*Prefix to use for temporary files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
973 If this is a relative file name (such as \"tramp.\"), it is considered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
974 relative to the directory name returned by the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
975 `tramp-temporary-file-directory' (which see). It may also be an
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
976 absolute file name; don't forget to include a prefix for the filename
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
977 part, though."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
978 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
979 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
980
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
981 (defcustom tramp-discard-garbage nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
982 "*If non-nil, try to discard garbage sent by remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
983 Some shells send such garbage upon connection setup."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
984 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
985 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
986
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
987 (defcustom tramp-sh-extra-args '(("/bash\\'" . "--norc"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
988 "*Alist specifying extra arguments to pass to the remote shell.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
989 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
990 matching the shell file name and ARGS is a string specifying the
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
991 arguments.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
992
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
993 This variable is only used when Tramp needs to start up another shell
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
994 for tilde expansion. The extra arguments should typically prevent the
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
995 shell from reading its init file."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
996 :group 'tramp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
997 :type '(alist :key-type string :value-type string))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
998
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
999 ;; File name format.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1000
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1001 (defconst tramp-file-name-structure-unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1002 (list (concat "\\`/\\(\\([a-zA-Z0-9]+\\):\\)?" ;method
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1003 "\\(\\([^:@/]+\\)@\\)?" ;user
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1004 "\\([^:/]+\\):" ;host
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1005 "\\(.*\\)\\'") ;path
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1006 2 4 5 6)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1007 "Default value for `tramp-file-name-structure' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1008 On Emacs (not XEmacs), the Tramp and Ange-FTP packages use a unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1009 filename space. This value is used for this unified namespace.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1010
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1011 (defconst tramp-file-name-structure-separate
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1012 (list (concat "\\`/\\[\\(\\([a-zA-Z0-9]+\\)/\\)?" ;method
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1013 "\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?" ;user
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1014 "\\([-a-zA-Z0-9_#/:@.]+\\)\\]" ;host
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1015 "\\(.*\\)\\'") ;path
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1016 2 4 5 6)
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1017 "Default value for `tramp-file-name-structure' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1018 On XEmacs, the Tramp and EFS packages use a separate namespace for
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1019 remote filenames. This value is used in that case. It is designed
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1020 not to clash with the EFS filename syntax.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1021
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1022 (defcustom tramp-file-name-structure
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1023 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1024 tramp-file-name-structure-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1025 tramp-file-name-structure-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1026 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1027 the tramp file name structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1028
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1029 The first element REGEXP is a regular expression matching a tramp file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1030 name. The regex should contain parentheses around the method name,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1031 the user name, the host name, and the file name parts.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1032
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1033 The second element METHOD is a number, saying which pair of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1034 parentheses matches the method name. The third element USER is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1035 similar, but for the user name. The fourth element HOST is similar,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1036 but for the host name. The fifth element FILE is for the file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1037 These numbers are passed directly to `match-string', which see. That
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1038 means the opening parentheses are counted to identify the pair.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1039
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1040 See also `tramp-file-name-regexp' and `tramp-make-tramp-file-format'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1041 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1042 :type '(list (regexp :tag "File name regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1043 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1044 (integer :tag "Paren pair for user name ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1045 (integer :tag "Paren pair for host name ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1046 (integer :tag "Paren pair for file name ")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1047
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1048 ;;;###autoload
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1049 (defconst tramp-file-name-regexp-unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1050 "\\`/[^/:]+:"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1051 "Value for `tramp-file-name-regexp' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1052 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1053 Tramp. See `tramp-file-name-structure-unified' for more explanations.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1054
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1055 ;;;###autoload
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1056 (defconst tramp-file-name-regexp-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1057 "\\`/\\[.*\\]"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1058 "Value for `tramp-file-name-regexp' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1059 XEmacs uses a separate filename syntax for Tramp and EFS.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1060 See `tramp-file-name-structure-separate' for more explanations.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1061
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1062 ;;;###autoload
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1063 (defcustom tramp-file-name-regexp
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1064 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1065 tramp-file-name-regexp-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1066 tramp-file-name-regexp-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1067 "*Regular expression matching file names handled by tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1068 This regexp should match tramp file names but no other file names.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1069 \(When tramp.el is loaded, this regular expression is prepended to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1070 `file-name-handler-alist', and that is searched sequentially. Thus,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1071 if the tramp entry appears rather early in the `file-name-handler-alist'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1072 and is a bit too general, then some files might be considered tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1073 files which are not really tramp files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1074
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1075 Please note that the entry in `file-name-handler-alist' is made when
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1076 this file (tramp.el) is loaded. This means that this variable must be set
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1077 before loading tramp.el. Alternatively, `file-name-handler-alist' can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1078 updated after changing this variable.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1079
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1080 Also see `tramp-file-name-structure' and `tramp-make-tramp-file-format'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1081 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1082 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1083
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1084 (defconst tramp-make-tramp-file-format-unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1085 "/%m:%u@%h:%p"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1086 "Value for `tramp-make-tramp-file-format' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1087 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1088 See `tramp-file-name-structure-unified' for more details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1089
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1090 (defconst tramp-make-tramp-file-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1091 "/[%m/%u@%h]%p"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1092 "Value for `tramp-make-tramp-file-format' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1093 XEmacs uses a separate filename syntax for EFS and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1094 See `tramp-file-name-structure-separate' for more details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1095
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1096 (defcustom tramp-make-tramp-file-format
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1097 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1098 tramp-make-tramp-file-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1099 tramp-make-tramp-file-format-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1100 "*Format string saying how to construct tramp file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1101 `%m' is replaced by the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1102 `%u' is replaced by the user name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1103 `%h' is replaced by the host name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1104 `%p' is replaced by the file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1105 `%%' is replaced by %.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1106
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1107 Also see `tramp-file-name-structure' and `tramp-file-name-regexp'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1108 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1109 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1110
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1111 (defconst tramp-make-tramp-file-user-nil-format-unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1112 "/%m:%h:%p"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1113 "Value of `tramp-make-tramp-file-user-nil-format' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1114 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1115 See `tramp-file-name-structure-unified' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1116
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1117 (defconst tramp-make-tramp-file-user-nil-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1118 "/[%m/%h]%p"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1119 "Value of `tramp-make-tramp-file-user-nil-format' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1120 XEmacs uses a separate filename syntax for EFS and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1121 See `tramp-file-name-structure-separate' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1122
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1123 (defcustom tramp-make-tramp-file-user-nil-format
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1124 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1125 tramp-make-tramp-file-user-nil-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1126 tramp-make-tramp-file-user-nil-format-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1127 "*Format string saying how to construct tramp file name when the user name is not known.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1128 `%m' is replaced by the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1129 `%h' is replaced by the host name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1130 `%p' is replaced by the file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1131 `%%' is replaced by %.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1132
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1133 Also see `tramp-make-tramp-file-format', `tramp-file-name-structure', and `tramp-file-name-regexp'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1134 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1135 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1136
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1137 (defconst tramp-multi-file-name-structure-unified
46347
3996ea20e5e3 (tramp-multi-file-name-structure-unified): Add
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46307
diff changeset
1138 (list (concat "\\`/\\(\\([a-zA-Z0-9]+\\)?:\\)" ;method
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1139 "\\(\\(%s\\)+\\)" ;hops
46347
3996ea20e5e3 (tramp-multi-file-name-structure-unified): Add
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46307
diff changeset
1140 "\\(.*\\)\\'") ;path
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1141 2 3 -1)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1142 "Value for `tramp-multi-file-name-structure' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1143 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1144 See `tramp-file-name-structure-unified' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1145
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
1146 (defconst tramp-multi-file-name-structure-separate
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1147 (list (concat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1148 ;; prefix
46347
3996ea20e5e3 (tramp-multi-file-name-structure-unified): Add
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46307
diff changeset
1149 "\\`/\\[\\(\\([a-z0-9]+\\)?\\)"
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1150 ;; regexp specifying the hops
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1151 "\\(\\(%s\\)+\\)"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1152 ;; path name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1153 "\\]\\(.*\\)\\'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1154 2 ;number of pair to match method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1155 3 ;number of pair to match hops
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1156 -1) ;number of pair to match path
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1157 "Value of `tramp-multi-file-name-structure' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1158 XEmacs uses a separate filename syntax for EFS and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1159 See `tramp-file-name-structure-separate' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1160
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1161 (defcustom tramp-multi-file-name-structure
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1162 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1163 tramp-multi-file-name-structure-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1164 tramp-multi-file-name-structure-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1165 "*Describes the file name structure of `multi' files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1166 Multi files allow you to contact a remote host in several hops.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1167 This is a list of four elements (REGEXP METHOD HOP PATH).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1168
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1169 The first element, REGEXP, gives a regular expression to match against
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1170 the file name. In this regular expression, `%s' is replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1171 value of `tramp-multi-file-name-hop-structure'. (Note: in order to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1172 allow multiple hops, you normally want to use something like
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1173 \"\\\\(\\\\(%s\\\\)+\\\\)\" in the regular expression. The outer pair
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1174 of parentheses is used for the HOP element, see below.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1175
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1176 All remaining elements are numbers. METHOD gives the number of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1177 paren pair which matches the method name. HOP gives the number of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1178 paren pair which matches the hop sequence. PATH gives the number of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1179 the paren pair which matches the path name on the remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1180
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1181 PATH can also be negative, which means to count from the end. Ie, a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1182 value of -1 means the last paren pair.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1183
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1184 I think it would be good if the regexp matches the whole of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1185 string, but I haven't actually tried what happens if it doesn't..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1186 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1187 :type '(list (regexp :tag "File name regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1188 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1189 (integer :tag "Paren pair for hops")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1190 (integer :tag "Paren pair to match path")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1191
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1192 (defconst tramp-multi-file-name-hop-structure-unified
46347
3996ea20e5e3 (tramp-multi-file-name-structure-unified): Add
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46307
diff changeset
1193 (list (concat "\\([a-zA-z0-9_]+\\):" ;hop method
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1194 "\\([^@:/]+\\)@" ;user
46347
3996ea20e5e3 (tramp-multi-file-name-structure-unified): Add
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46307
diff changeset
1195 "\\([^:/]+\\):") ;host
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1196 1 2 3)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1197 "Value of `tramp-multi-file-name-hop-structure' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1198 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1199 See `tramp-file-name-structure-unified' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1200
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1201 (defconst tramp-multi-file-name-hop-structure-separate
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1202 (list (concat "/\\([a-z0-9_]+\\):" ;hop method
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1203 "\\([a-z0-9_]+\\)@" ;user
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1204 "\\([a-z0-9.-]+\\)") ;host
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1205 1 2 3)
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1206 "Value of `tramp-multi-file-name-hop-structure' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1207 XEmacs uses a separate filename syntax for EFS and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1208 See `tramp-file-name-structure-separate' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1209
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1210 (defcustom tramp-multi-file-name-hop-structure
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1211 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1212 tramp-multi-file-name-hop-structure-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1213 tramp-multi-file-name-hop-structure-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1214 "*Describes the structure of a hop in multi files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1215 This is a list of four elements (REGEXP METHOD USER HOST). First
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1216 element REGEXP is used to match against the hop. Pair number METHOD
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1217 matches the method of one hop, pair number USER matches the user of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1218 one hop, pair number HOST matches the host of one hop.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1219
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1220 This regular expression should match exactly all of one hop."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1221 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1222 :type '(list (regexp :tag "Hop regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1223 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1224 (integer :tag "Paren pair for user name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1225 (integer :tag "Paren pair for host name")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1226
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1227 (defconst tramp-make-multi-tramp-file-format-unified
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1228 (list "/%m" ":%m:%u@%h" ":%p")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1229 "Value of `tramp-make-multi-tramp-file-format' for unified remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1230 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1231 See `tramp-file-name-structure-unified' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1232
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1233 (defconst tramp-make-multi-tramp-file-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1234 (list "/[%m" "/%m:%u@%h" "]%p")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1235 "Value of `tramp-make-multi-tramp-file-format' for separate remoting.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1236 XEmacs uses a separate filename syntax for EFS and Tramp.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1237 See `tramp-file-name-structure-separate' for details.")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1238
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1239 (defcustom tramp-make-multi-tramp-file-format
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1240 (if (featurep 'xemacs)
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1241 tramp-make-multi-tramp-file-format-separate
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1242 tramp-make-multi-tramp-file-format-unified)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1243 "*Describes how to construct a `multi' file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1244 This is a list of three elements PREFIX, HOP and PATH.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1245
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1246 The first element PREFIX says how to construct the prefix, the second
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1247 element HOP specifies what each hop looks like, and the final element
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1248 PATH says how to construct the path name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1249
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1250 In PREFIX, `%%' means `%' and `%m' means the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1251
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1252 In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1253 user and hop host, respectively.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1254
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1255 In PATH, `%%' means `%' and `%p' means the path name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1256
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1257 The resulting file name always contains one copy of PREFIX and one
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1258 copy of PATH, but there is one copy of HOP for each hop in the file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1259 name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1260
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1261 Note: the current implementation requires the prefix to contain the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1262 method name, followed by all the hops, and the path name must come
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1263 last."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1264 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1265 :type '(list string string string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1266
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1267 (defcustom tramp-terminal-type "dumb"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1268 "*Value of TERM environment variable for logging in to remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1269 Because Tramp wants to parse the output of the remote shell, it is easily
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1270 confused by ANSI color escape sequences and suchlike. Often, shell init
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1271 files conditionalize this setup based on the TERM environment variable."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1272 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1273 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1274
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1275 (defcustom tramp-completion-without-shell-p nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1276 "*If nil, use shell wildcards for completion, else rely on Lisp only.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1277 Using shell wildcards for completions has the advantage that it can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1278 fast even in large directories, but completion is always
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1279 case-sensitive. Relying on Lisp only means that case-insensitive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1280 completion is possible (subject to the variable `completion-ignore-case'),
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1281 but it might be slow on large directories."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1282 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1283 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1284
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1285 ;;; Internal Variables:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1286
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1287 (defvar tramp-buffer-file-attributes nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1288 "Holds the `ls -ild' output for the current buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1289 This variable is local to each buffer. It is not used if the remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1290 machine groks Perl. If it is used, it's used as an emulation for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1291 the visited file modtime.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1292 (make-variable-buffer-local 'tramp-buffer-file-attributes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1293
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1294 (defvar tramp-end-of-output "/////"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1295 "String used to recognize end of output.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1296
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1297 (defvar tramp-connection-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1298 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1299 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1300 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1301
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1302 (defvar tramp-remote-sh nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1303 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1304 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1305 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1306
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1307 (defvar tramp-rsh-program nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1308 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1309 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1310 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1311
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1312 (defvar tramp-rsh-args nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1313 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1314 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1315 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1316
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1317 (defvar tramp-rcp-program nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1318 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1319 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1320 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1321
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1322 (defvar tramp-rcp-args nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1323 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1324 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1325 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1326
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1327 (defvar tramp-rcp-keep-date-arg nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1328 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1329 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1330 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1331
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1332 (defvar tramp-encoding-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1333 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1334 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1335 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1336
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1337 (defvar tramp-decoding-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1338 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1339 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1340 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1341
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1342 (defvar tramp-encoding-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1343 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1344 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1345 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1346
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1347 (defvar tramp-decoding-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1348 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1349 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1350 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1351
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1352 (defvar tramp-telnet-program nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1353 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1354 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1355 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1356
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1357 (defvar tramp-telnet-args nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1358 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1359 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1360 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1361
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1362 ;; CCC `local in each buffer'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1363 (defvar tramp-ls-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1364 "This command is used to get a long listing with numeric user and group ids.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1365 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1366 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1367
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1368 (defvar tramp-current-multi-method nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1369 "Name of `multi' connection method for this *tramp* buffer, or nil if not multi.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1370 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1371 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1372
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1373 (defvar tramp-current-method nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1374 "Connection method for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1375 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1376 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1377
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1378 (defvar tramp-current-user nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1379 "Remote login name for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1380 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1381 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1382
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1383 (defvar tramp-current-host nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1384 "Remote host for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1385 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1386 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1387
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1388 (defvar tramp-test-groks-nt nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1389 "Whether the `test' command groks the `-nt' switch.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1390 \(`test A -nt B' tests if file A is newer than file B.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1391 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1392 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1393
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1394 (defvar tramp-file-exists-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1395 "Command to use for checking if a file exists.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1396 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1397 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1398
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1399 ;; Perl script to implement `file-attributes' in a Lisp `read'able output.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1400 ;; If you are hacking on this, note that you get *no* output unless this
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1401 ;; spits out a complete line, including the '\n' at the end.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1402 (defconst tramp-perl-file-attributes (concat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1403 "$f = $ARGV[0];
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1404 @s = lstat($f);
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1405 if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1406 elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1407 else { $l = \"nil\" };
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1408 printf(\"(%s %u %u %u (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\\n\",
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1409 $l, $s[3], $s[4], $s[5], $s[8] >> 16 & 0xffff, $s[8] & 0xffff,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1410 $s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1411 $s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff, $s[0] >> 16 & 0xffff, $s[0] & 0xffff);"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1412 )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1413 "Perl script to produce output suitable for use with `file-attributes'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1414 on the remote file system.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1415
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1416 ;; Perl script to implement `mime-encode'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1417 (defvar tramp-perl-mime-encode (concat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1418 "sub encode_base64 ($);
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1419 my $buf;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1420 while(read(STDIN, $buf, 60*57)) { print encode_base64($buf) }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1421 sub encode_base64 ($) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1422 my $res = \"\";
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1423 my $eol = \"\n\";
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1424 pos($_[0]) = 0; # ensure start at the beginning
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1425 while ($_[0] =~ /(.{1,45})/gs) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1426 $res .= substr(pack(\"u\", $1), 1);
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1427 chop($res);
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1428 }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1429 $res =~ tr|` -_|AA-Za-z0-9+/|; # `# help emacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1430 # fix padding at the end
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1431 my $padding = (3 - length($_[0]) % 3) % 3;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1432 $res =~ s/.{$padding}$/\"=\" x $padding/e if $padding;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1433 # break encoded string into lines of no more than 76 characters each
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1434 if (length $eol) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1435 $res =~ s/(.{1,76})/$1$eol/g;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1436 }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1437 $res;}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1438
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1439 ;; Perl script to implement `mime-decode'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1440 (defvar tramp-perl-mime-decode (concat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1441 "sub decode_base64 ($);
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1442 my $buf;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1443 while(read(STDIN, $buf, 60*57)) { print decode_base64($buf) }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1444 sub decode_base64 ($) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1445 local($^W) = 0; # unpack(\"u\",...) gives bogus warning in 5.00[123]
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1446
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1447 my $str = shift;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1448 my $res = \"\";
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1449
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1450 $str =~ tr|A-Za-z0-9+=/||cd; # remove non-base64 chars
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1451 if (length($str) % 4) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1452 warn(\"Length of base64 data not a multiple of 4\")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1453 }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1454 $str =~ s/=+$//; # remove padding
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1455 $str =~ tr|A-Za-z0-9+/| -_|; # convert to uuencoded format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1456 while ($str =~ /(.{1,60})/gs) {
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1457 my $len = chr(32 + length($1)*3/4); # compute length byte
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1458 $res .= unpack(\"u\", $len . $1 ); # uudecode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1459 }
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1460 $res;}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1461
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1462 ; These values conform to `file-attributes' from XEmacs 21.2.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1463 ; GNU Emacs and other tools not checked.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1464 (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1465 (1 . "p") ; fifo
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1466 (2 . "c") ; character device
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1467 (3 . "m") ; multiplexed character device (v7)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1468 (4 . "d") ; directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1469 (5 . "?") ; Named special file (XENIX)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1470 (6 . "b") ; block device
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1471 (7 . "?") ; multiplexed block device (v7)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1472 (8 . "-") ; regular file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1473 (9 . "n") ; network special file (HP-UX)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1474 (10 . "l") ; symlink
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1475 (11 . "?") ; ACL shadow inode (Solaris, not userspace)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1476 (12 . "s") ; socket
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1477 (13 . "D") ; door special (Solaris)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1478 (14 . "w")) ; whiteout (BSD)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1479 "A list of file types returned from the `stat' system call.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1480 This is used to map a mode number to a permission string.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1481
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1482 (defvar tramp-dos-coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1483 (if (and (fboundp 'coding-system-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1484 (funcall 'coding-system-p '(dos)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1485 'dos
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1486 'undecided-dos)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1487 "Some Emacsen know the `dos' coding system, others need `undecided-dos'.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1488
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1489
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1490 ;; New handlers should be added here. The following operations can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1491 ;; handled using the normal primitives: file-name-as-directory,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1492 ;; file-name-directory, file-name-nondirectory,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1493 ;; file-name-sans-versions, get-file-buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1494 (defconst tramp-file-name-handler-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1495 '(
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1496 (load . tramp-handle-load)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1497 (make-symbolic-link . tramp-handle-make-symbolic-link)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1498 (file-name-directory . tramp-handle-file-name-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1499 (file-name-nondirectory . tramp-handle-file-name-nondirectory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1500 (file-truename . tramp-handle-file-truename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1501 (file-exists-p . tramp-handle-file-exists-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1502 (file-directory-p . tramp-handle-file-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1503 (file-executable-p . tramp-handle-file-executable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1504 (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1505 (file-readable-p . tramp-handle-file-readable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1506 (file-regular-p . tramp-handle-file-regular-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1507 (file-symlink-p . tramp-handle-file-symlink-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1508 (file-writable-p . tramp-handle-file-writable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1509 (file-ownership-preserved-p . tramp-handle-file-ownership-preserved-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1510 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1511 (file-attributes . tramp-handle-file-attributes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1512 (file-modes . tramp-handle-file-modes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1513 (file-directory-files . tramp-handle-file-directory-files)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1514 (directory-files . tramp-handle-directory-files)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1515 (file-name-all-completions . tramp-handle-file-name-all-completions)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1516 (file-name-completion . tramp-handle-file-name-completion)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1517 (add-name-to-file . tramp-handle-add-name-to-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1518 (copy-file . tramp-handle-copy-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1519 (rename-file . tramp-handle-rename-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1520 (set-file-modes . tramp-handle-set-file-modes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1521 (make-directory . tramp-handle-make-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1522 (delete-directory . tramp-handle-delete-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1523 (delete-file . tramp-handle-delete-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1524 (directory-file-name . tramp-handle-directory-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1525 (shell-command . tramp-handle-shell-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1526 (insert-directory . tramp-handle-insert-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1527 (expand-file-name . tramp-handle-expand-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1528 (file-local-copy . tramp-handle-file-local-copy)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1529 (insert-file-contents . tramp-handle-insert-file-contents)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1530 (write-region . tramp-handle-write-region)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1531 (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1532 (dired-call-process . tramp-handle-dired-call-process)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1533 (dired-recursive-delete-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1534 . tramp-handle-dired-recursive-delete-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1535 (set-visited-file-modtime . tramp-handle-set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1536 (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1537 "Alist of handler functions.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1538 Operations not mentioned here will be handled by the normal Emacs functions.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1539
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1540 ;;; For better error reporting.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1541
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1542 (defun tramp-version (arg)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1543 "Print version number of tramp.el in minibuffer or current buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1544 (interactive "P")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1545 (if arg (insert tramp-version) (message tramp-version)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1546
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1547 ;;; Internal functions which must come first.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1548
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1549 (defsubst tramp-message (level fmt-string &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1550 "Emit a message depending on verbosity level.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1551 First arg LEVEL says to be quiet if `tramp-verbose' is less than LEVEL. The
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1552 message is emitted only if `tramp-verbose' is greater than or equal to LEVEL.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1553 Calls function `message' with FMT-STRING as control string and the remaining
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1554 ARGS to actually emit the message (if applicable).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1555
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1556 This function expects to be called from the tramp buffer only!"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1557 (when (<= level tramp-verbose)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1558 (apply #'message (concat "tramp: " fmt-string) args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1559 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1560 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1561 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1562 (tramp-get-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1563 tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1564 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1565 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1566 (tramp-insert-with-face
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1567 'italic
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1568 (concat "# " (apply #'format fmt-string args) "\n"))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1569
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1570 (defun tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1571 (multi-method method user host level fmt-string &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1572 "Like `tramp-message' but temporarily switches to the tramp buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1573 First three args METHOD, USER, and HOST identify the tramp buffer to use,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1574 remaining args passed to `tramp-message'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1575 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1576 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1577 (apply 'tramp-message level fmt-string args)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1578
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1579 (defsubst tramp-line-end-position nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1580 "Return point at end of line.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1581 Calls `line-end-position' or `point-at-eol' if defined, else
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1582 own implementation."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1583 (cond
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1584 ((fboundp 'line-end-position) (funcall 'line-end-position))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1585 ((fboundp 'point-at-eol) (funcall 'point-at-eol))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1586 (t (save-excursion (end-of-line) (point)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1587
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1588 (defmacro with-parsed-tramp-file-name (filename var &rest body)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1589 "Parse a Tramp filename and make components available in the body.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1590
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1591 First arg FILENAME is evaluated and dissected into its components.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1592 Second arg VAR is a symbol. It is used as a variable name to hold
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1593 the filename structure. It is also used as a prefix for the variables
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1594 holding the components. For example, if VAR is the symbol `foo', then
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1595 `foo' will be bound to the whole structure, `foo-multi-method' will
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1596 be bound to the multi-method component, and so on for `foo-method',
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1597 `foo-user', `foo-host', `foo-path'.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1598
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1599 Remaining args are Lisp expressions to be evaluated (inside an implicit
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1600 `progn').
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1601
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1602 If VAR is nil, then we bind `v' to the structure and `multi-method',
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1603 `method', `user', `host', `path' to the components."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1604 `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1605 (,(if var (intern (concat (symbol-name var) "-multi-method")) 'multi-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1606 (tramp-file-name-multi-method ,(or var 'v)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1607 (,(if var (intern (concat (symbol-name var) "-method")) 'method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1608 (tramp-file-name-method ,(or var 'v)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1609 (,(if var (intern (concat (symbol-name var) "-user")) 'user)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1610 (tramp-file-name-user ,(or var 'v)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1611 (,(if var (intern (concat (symbol-name var) "-host")) 'host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1612 (tramp-file-name-host ,(or var 'v)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1613 (,(if var (intern (concat (symbol-name var) "-path")) 'path)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1614 (tramp-file-name-path ,(or var 'v))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1615 ,@body))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1616
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1617 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1618
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1619 ;;; File Name Handler Functions:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1620
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1621 (defun tramp-handle-make-symbolic-link
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1622 (filename linkname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1623 "Like `make-symbolic-link' for tramp files.
46307
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1624 If LINKNAME is a non-Tramp file, it is used verbatim as the target of
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1625 the symlink. If LINKNAME is a Tramp file, only the path component is
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1626 used as the target of the symlink.
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1627
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1628 If LINKNAME is a Tramp file and the path component is relative, then
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1629 it is expanded first, before the path component is taken. Note that
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1630 this can give surprising results if the user/host for the source and
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1631 target of the symlink differ."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1632 (with-parsed-tramp-file-name linkname l
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1633 (when (tramp-ange-ftp-file-name-p l-multi-method l-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1634 (tramp-invoke-ange-ftp 'make-symbolic-link
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1635 filename linkname ok-if-already-exists))
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1636 (let ((ln (tramp-get-remote-ln l-multi-method l-method l-user l-host))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1637 (cwd (file-name-directory l-path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1638 (unless ln
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1639 (signal 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1640 (list "Making a symbolic link."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1641 "ln(1) does not exist on the remote host.")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1642
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1643 ;; Do the 'confirm if exists' thing.
46307
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1644 (when (file-exists-p linkname)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1645 ;; What to do?
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1646 (if (or (null ok-if-already-exists) ; not allowed to exist
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1647 (and (numberp ok-if-already-exists)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1648 (not (yes-or-no-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1649 (format
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1650 "File %s already exists; make it a link anyway? "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1651 l-path)))))
46307
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1652 (signal 'file-already-exists (list "File already exists" l-path))
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1653 (delete-file linkname)))
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1654
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1655 ;; If FILENAME is a Tramp name, use just the path component.
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1656 (when (tramp-tramp-file-p filename)
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1657 (setq filename (tramp-file-name-path
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1658 (tramp-dissect-file-name
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1659 (expand-file-name filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1660
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1661 ;; Right, they are on the same host, regardless of user, method, etc.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1662 ;; We now make the link on the remote machine. This will occur as the user
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1663 ;; that FILENAME belongs to.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1664 (zerop
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1665 (tramp-send-command-and-check
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1666 l-multi-method l-method l-user l-host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1667 (format "cd %s && %s -sf %s %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1668 cwd ln
46307
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1669 filename
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
1670 l-path)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1671 t)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1672
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1673
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1674 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1675 "Like `load' for tramp files. Not implemented!"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1676 (unless (file-name-absolute-p file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1677 (error "Tramp cannot `load' files without absolute path name"))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1678 (with-parsed-tramp-file-name file nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1679 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1680 (tramp-invoke-ange-ftp 'load
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1681 file noerror nomessage nosuffix must-suffix))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1682 (unless nosuffix
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1683 (cond ((file-exists-p (concat file ".elc"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1684 (setq file (concat file ".elc")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1685 ((file-exists-p (concat file ".el"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1686 (setq file (concat file ".el")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1687 (when must-suffix
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1688 ;; The first condition is always true for absolute file names.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1689 ;; Included for safety's sake.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1690 (unless (or (file-name-directory file)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1691 (string-match "\\.elc?\\'" file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1692 (error "File `%s' does not include a `.el' or `.elc' suffix"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1693 file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1694 (unless noerror
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1695 (when (not (file-exists-p file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1696 (error "Cannot load nonexistant file `%s'" file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1697 (if (not (file-exists-p file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1698 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1699 (unless nomessage
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1700 (message "Loading %s..." file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1701 (let ((local-copy (file-local-copy file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1702 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1703 (load local-copy noerror t t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1704 (delete-file local-copy))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1705 (unless nomessage
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1706 (message "Loading %s...done" file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1707 t)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1708
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1709 ;; Path manipulation functions that grok TRAMP paths...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1710 (defun tramp-handle-file-name-directory (file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1711 "Like `file-name-directory' but aware of TRAMP files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1712 ;; everything except the last filename thing is the directory
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1713 (with-parsed-tramp-file-name file nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1714 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1715 (tramp-invoke-ange-ftp 'file-name-directory file))
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1716 ;; For the following condition, two possibilities should be tried:
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1717 ;; (1) (string= path "")
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1718 ;; (2) (or (string= path "") (string= path "/"))
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1719 ;; The second variant fails when completing a "/" directory on
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1720 ;; the remote host, that is a filename which looks like
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1721 ;; "/user@host:/". But maybe wildcards fail with the first variant.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1722 ;; We should do some investigation.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1723 (if (string= path "")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1724 ;; For a filename like "/[foo]", we return "/". The `else'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1725 ;; case would return "/[foo]" unchanged. But if we do that,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1726 ;; then `file-expand-wildcards' ceases to work. It's not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1727 ;; quite clear to me what's the intuition that tells that this
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1728 ;; behavior is the right behavior, but oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1729 "/"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1730 ;; run the command on the path portion only
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1731 ;; CCC: This should take into account the remote machine type, no?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1732 ;; --daniel <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1733 (tramp-make-tramp-file-name multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1734 ;; This will not recurse...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1735 (or (file-name-directory path) "")))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1736
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1737 (defun tramp-handle-file-name-nondirectory (file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1738 "Like `file-name-nondirectory' but aware of TRAMP files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1739 (with-parsed-tramp-file-name file nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1740 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1741 (tramp-invoke-ange-ftp 'file-name-nondirectory file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1742 (file-name-nondirectory path)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1743
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1744 (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1745 "Like `file-truename' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1746 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1747 ;; Ange-FTP does not support truename processing. It returns the
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1748 ;; file name as-is. So that's what we do, too.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1749 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1750 filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1751 (let* ((steps (tramp-split-string path "/"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1752 (pathdir (let ((directory-sep-char ?/))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1753 (file-name-as-directory path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1754 (is-dir (string= path pathdir))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1755 (thisstep nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1756 (numchase 0)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1757 ;; Don't make the following value larger than necessary.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1758 ;; People expect an error message in a timely fashion when
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1759 ;; something is wrong; otherwise they might think that Emacs
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1760 ;; is hung. Of course, correctness has to come first.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1761 (numchase-limit 20)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1762 (result nil) ;result steps in reverse order
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1763 (curstri "")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1764 symlink-target)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1765 (tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1766 multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1767 10 "Finding true name for `%s'" filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1768 (while (and steps (< numchase numchase-limit))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1769 (setq thisstep (pop steps))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1770 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1771 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1772 10 "Check %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1773 (mapconcat 'identity
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1774 (append '("") (reverse result) (list thisstep))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1775 "/"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1776 (setq symlink-target
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1777 (nth 0 (tramp-handle-file-attributes
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1778 (tramp-make-tramp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1779 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1780 (mapconcat 'identity
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1781 (append '("") (reverse result) (list thisstep))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1782 "/")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1783 (cond ((string= "." thisstep)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1784 (tramp-message-for-buffer multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1785 10 "Ignoring step `.'"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1786 ((string= ".." thisstep)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1787 (tramp-message-for-buffer multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1788 10 "Processing step `..'")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1789 (pop result))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1790 ((stringp symlink-target)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1791 ;; It's a symlink, follow it.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1792 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1793 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1794 10 "Follow symlink to %s" symlink-target)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1795 (setq numchase (1+ numchase))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1796 (when (file-name-absolute-p symlink-target)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1797 (setq result nil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1798 (setq steps
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1799 (append (tramp-split-string symlink-target "/") steps)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1800 (t
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1801 ;; It's a file.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1802 (setq result (cons thisstep result)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1803 (when (>= numchase numchase-limit)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1804 (error "Maximum number (%d) of symlinks exceeded" numchase-limit))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1805 (setq result (reverse result))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1806 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1807 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1808 10 "True name of `%s' is `%s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1809 filename (mapconcat 'identity (cons "" result) "/"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1810 (tramp-make-tramp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1811 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1812 (concat (mapconcat 'identity (cons "" result) "/")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1813 (if is-dir "/" ""))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1814
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1815 ;; Basic functions.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1816
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1817 (defun tramp-handle-file-exists-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1818 "Like `file-exists-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1819 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1820 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1821 (tramp-invoke-ange-ftp 'file-exists-p filename))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1822 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1823 (zerop (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1824 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1825 (format
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1826 (tramp-get-file-exists-command multi-method method user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1827 (tramp-shell-quote-argument path)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1828
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1829 ;; CCC: This should check for an error condition and signal failure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1830 ;; when something goes wrong.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1831 ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1832 (defun tramp-handle-file-attributes (filename &optional nonnumeric)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1833 "Like `file-attributes' for tramp files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1834 Optional argument NONNUMERIC means return user and group name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1835 rather than as numbers."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1836 (if (tramp-handle-file-exists-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1837 ;; file exists, find out stuff
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1838 (save-excursion
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1839 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1840 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1841 (tramp-invoke-ange-ftp 'file-attributes file))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1842 (if (tramp-get-remote-perl multi-method method user host)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1843 (tramp-handle-file-attributes-with-perl
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1844 multi-method method user host path nonnumeric)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1845 (tramp-handle-file-attributes-with-ls
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1846 multi-method method user host path nonnumeric))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1847 nil)) ; no file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1848
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1849
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1850 (defun tramp-handle-file-attributes-with-ls
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1851 (multi-method method user host path &optional nonnumeric)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1852 "Implement `file-attributes' for tramp files using the ls(1) command."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1853 (let (symlinkp dirp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1854 res-inode res-filemodes res-numlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1855 res-uid res-gid res-size res-symlink-target)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1856 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1857 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1858 (format "%s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1859 (tramp-get-ls-command multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1860 (if nonnumeric "-ild" "-ildn")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1861 (tramp-shell-quote-argument path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1862 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1863 ;; parse `ls -l' output ...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1864 ;; ... inode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1865 (setq res-inode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1866 (condition-case err
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1867 (read (current-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1868 (invalid-read-syntax
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1869 (when (and (equal (cadr err)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1870 "Integer constant overflow in reader")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1871 (string-match
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1872 "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1873 (caddr err)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1874 (let* ((big (read (substring (caddr err) 0
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1875 (match-beginning 1))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1876 (small (read (match-string 1 (caddr err))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1877 (twiddle (/ small 65536)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1878 (cons (+ big twiddle)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1879 (- small (* twiddle 65536))))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1880 ;; ... file mode flags
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1881 (setq res-filemodes (symbol-name (read (current-buffer))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1882 ;; ... number links
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1883 (setq res-numlinks (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1884 ;; ... uid and gid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1885 (setq res-uid (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1886 (setq res-gid (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1887 (unless nonnumeric
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1888 (unless (numberp res-uid) (setq res-uid -1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1889 (unless (numberp res-gid) (setq res-gid -1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1890 ;; ... size
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1891 (setq res-size (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1892 ;; From the file modes, figure out other stuff.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1893 (setq symlinkp (eq ?l (aref res-filemodes 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1894 (setq dirp (eq ?d (aref res-filemodes 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1895 ;; if symlink, find out file name pointed to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1896 (when symlinkp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1897 (search-forward "-> ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1898 (setq res-symlink-target
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1899 (buffer-substring (point)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1900 (tramp-line-end-position))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1901 ;; return data gathered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1902 (list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1903 ;; 0. t for directory, string (name linked to) for symbolic
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1904 ;; link, or nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1905 (or dirp res-symlink-target nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1906 ;; 1. Number of links to file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1907 res-numlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1908 ;; 2. File uid.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1909 res-uid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1910 ;; 3. File gid.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1911 res-gid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1912 ;; 4. Last access time, as a list of two integers. First
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1913 ;; integer has high-order 16 bits of time, second has low 16
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1914 ;; bits.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1915 ;; 5. Last modification time, likewise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1916 ;; 6. Last status change time, likewise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1917 '(0 0) '(0 0) '(0 0) ;CCC how to find out?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1918 ;; 7. Size in bytes (-1, if number is out of range).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1919 res-size
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1920 ;; 8. File modes, as a string of ten letters or dashes as in ls -l.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1921 res-filemodes
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1922 ;; 9. t iff file's gid would change if file were deleted and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1923 ;; recreated.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1924 nil ;hm?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1925 ;; 10. inode number.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1926 res-inode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1927 ;; 11. Device number.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1928 -1 ;hm?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1929 )))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1930
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1931 (defun tramp-handle-file-attributes-with-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1932 (multi-method method user host path &optional nonnumeric)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1933 "Implement `file-attributes' for tramp files using a Perl script.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1934
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1935 The Perl command is sent to the remote machine when the connection
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1936 is initially created and is kept cached by the remote shell."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1937 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1938 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1939 (format "tramp_file_attributes %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1940 (tramp-shell-quote-argument path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1941 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1942 (let ((result (read (current-buffer))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1943 (setcar (nthcdr 8 result)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1944 (tramp-file-mode-from-int (nth 8 result)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1945 result))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1946
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1947 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1948 "Like `set-visited-file-modtime' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1949 (unless (buffer-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1950 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1951 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1952 (when time-list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1953 (tramp-run-real-handler 'set-visited-file-modtime (list time-list)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1954 (let ((f (buffer-file-name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1955 (coding-system-used nil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1956 (with-parsed-tramp-file-name f nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1957 ;; This operation is not handled by Ange-FTP!
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1958 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1959 (throw 'tramp-forward-to-ange-ftp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1960 (tramp-run-real-handler 'set-visited-file-modtime
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1961 (list time-list))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1962 (let* ((attr (file-attributes f))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1963 (modtime (nth 5 attr)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1964 ;; We use '(0 0) as a don't-know value. See also
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1965 ;; `tramp-handle-file-attributes-with-ls'.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1966 (when (boundp 'last-coding-system-used)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1967 (setq coding-system-used last-coding-system-used))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1968 (if (not (equal modtime '(0 0)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1969 (tramp-run-real-handler 'set-visited-file-modtime (list modtime))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1970 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1971 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1972 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1973 (format "%s -ild %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1974 (tramp-get-ls-command multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1975 (tramp-shell-quote-argument path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1976 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1977 (setq attr (buffer-substring (point)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1978 (progn (end-of-line) (point)))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1979 (setq tramp-buffer-file-attributes attr))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1980 (when (boundp 'last-coding-system-used)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1981 (setq last-coding-system-used coding-system-used))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1982 nil))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1983
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1984 ;; CCC continue here
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1985
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1986 ;; This function makes the same assumption as
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1987 ;; `tramp-handle-set-visited-file-modtime'.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1988 (defun tramp-handle-verify-visited-file-modtime (buf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1989 "Like `verify-visited-file-modtime' for tramp files."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1990 (with-current-buffer buf
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1991 (let ((f (buffer-file-name)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1992 (with-parsed-tramp-file-name f nil
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
1993 (when (tramp-ange-ftp-file-name-p multi-method method)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1994 ;; This one requires a hack since the file name is not passed
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1995 ;; on the arg list.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1996 (let ((buffer-file-name (tramp-make-ange-ftp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1997 user host path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1998 (tramp-invoke-ange-ftp 'verify-visited-file-modtime buf)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1999 (let* ((attr (file-attributes f))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2000 (modtime (nth 5 attr)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2001 (cond ((and attr (not (equal modtime '(0 0))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2002 ;; Why does `file-attributes' return a list (HIGH
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2003 ;; LOW), but `visited-file-modtime' returns a cons
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2004 ;; (HIGH . LOW)?
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2005 (let ((mt (visited-file-modtime)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2006 (< (abs (tramp-time-diff
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2007 modtime (list (car mt) (cdr mt)))) 2)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2008 (attr
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2009 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2010 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2011 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2012 (format "%s -ild %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2013 (tramp-get-ls-command multi-method method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2014 user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2015 (tramp-shell-quote-argument path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2016 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2017 (setq attr (buffer-substring
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2018 (point) (progn (end-of-line) (point)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2019 (equal tramp-buffer-file-attributes attr))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2020 ;; If file does not exist, say it is not modified.
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2021 (t nil)))))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2022
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2023 (defadvice clear-visited-file-modtime (after tramp activate)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2024 "Set `tramp-buffer-file-attributes' back to nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2025 Tramp uses this variable as an emulation for the actual modtime of the file,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2026 if the remote host can't provide the modtime."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2027 (setq tramp-buffer-file-attributes nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2028
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2029 (defun tramp-handle-set-file-modes (filename mode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2030 "Like `set-file-modes' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2031 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2032 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2033 (tramp-invoke-ange-ftp 'set-file-modes filename mode))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2034 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2035 (unless (zerop (tramp-send-command-and-check
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2036 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2037 (format "chmod %s %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2038 (tramp-decimal-to-octal mode)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2039 (tramp-shell-quote-argument path))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2040 (signal 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2041 (list "Doing chmod"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2042 ;; FIXME: extract the proper text from chmod's stderr.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2043 "error while changing file's mode"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2044 filename))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2045
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2046 ;; Simple functions using the `test' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2047
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2048 (defun tramp-handle-file-executable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2049 "Like `file-executable-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2050 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2051 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2052 (tramp-invoke-ange-ftp 'file-executable-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2053 (zerop (tramp-run-test "-x" filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2054
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2055 (defun tramp-handle-file-readable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2056 "Like `file-readable-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2057 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2058 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2059 (tramp-invoke-ange-ftp 'file-readable-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2060 (zerop (tramp-run-test "-r" filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2061
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2062 (defun tramp-handle-file-accessible-directory-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2063 "Like `file-accessible-directory-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2064 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2065 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2066 (tramp-invoke-ange-ftp 'file-accessible-directory-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2067 (and (zerop (tramp-run-test "-d" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2068 (zerop (tramp-run-test "-r" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2069 (zerop (tramp-run-test "-x" filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2070
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2071 ;; When the remote shell is started, it looks for a shell which groks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2072 ;; tilde expansion. Here, we assume that all shells which grok tilde
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2073 ;; expansion will also provide a `test' command which groks `-nt' (for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2074 ;; newer than). If this breaks, tell me about it and I'll try to do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2075 ;; something smarter about it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2076 (defun tramp-handle-file-newer-than-file-p (file1 file2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2077 "Like `file-newer-than-file-p' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2078 (cond ((not (file-exists-p file1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2079 nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2080 ((not (file-exists-p file2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2081 t)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2082 ;; We are sure both files exist at this point. We assume that
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2083 ;; both files are Tramp files, otherwise we issue an error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2084 ;; message. Todo: make a better error message.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2085 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2086 (save-excursion
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2087 (with-parsed-tramp-file-name file1 v1
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2088 (with-parsed-tramp-file-name file2 v2
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2089 (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2090 (tramp-ange-ftp-file-name-p v2-multi-method v2-method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2091 (tramp-invoke-ange-ftp 'file-newer-than-file-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2092 file1 file2))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2093 (unless (and (equal v1-multi-method v2-multi-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2094 (equal v1-method v2-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2095 (equal v1-user v2-user)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2096 (equal v1-host v2-host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2097 (signal 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2098 (list "Files must have same method, user, host"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2099 file1 file2)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2100 (unless (and (tramp-tramp-file-p file1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2101 (tramp-tramp-file-p file2))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2102 (signal 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2103 (list "Files must be tramp files on same host"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2104 file1 file2)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2105 (if (tramp-get-test-groks-nt
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2106 v1-multi-method v1-method v1-user v1-host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2107 (zerop (tramp-run-test2 "test" file1 file2 "-nt"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2108 (zerop (tramp-run-test2 "tramp_test_nt" file1 file2)))))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2109
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2110 ;; Functions implemented using the basic functions above.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2111
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2112 (defun tramp-handle-file-modes (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2113 "Like `file-modes' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2114 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2115 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2116 (tramp-invoke-ange-ftp 'file-modes filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2117 (when (file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2118 (tramp-mode-string-to-int
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2119 (nth 8 (tramp-handle-file-attributes filename))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2120
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2121 (defun tramp-handle-file-directory-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2122 "Like `file-directory-p' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2123 ;; Care must be taken that this function returns `t' for symlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2124 ;; pointing to directories. Surely the most obvious implementation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2125 ;; would be `test -d', but that returns false for such symlinks.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2126 ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2127 ;; I now think he's right. So we could be using `test -d', couldn't
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2128 ;; we?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2129 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2130 ;; Alternatives: `cd %s', `test -d %s'
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2131 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2132 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2133 (tramp-invoke-ange-ftp 'file-directory-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2134 (save-excursion
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2135 (zerop
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2136 (tramp-send-command-and-check
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2137 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2138 (format "test -d %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2139 (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2140 t))))) ;run command in subshell
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2141
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2142 (defun tramp-handle-file-regular-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2143 "Like `file-regular-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2144 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2145 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2146 (tramp-invoke-ange-ftp 'file-regular-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2147 (and (tramp-handle-file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2148 (eq ?- (aref (nth 8 (tramp-handle-file-attributes filename)) 0)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2149
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2150 (defun tramp-handle-file-symlink-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2151 "Like `file-symlink-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2152 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2153 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2154 (tramp-invoke-ange-ftp 'file-symlink-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2155 (let ((x (car (tramp-handle-file-attributes filename))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2156 (when (stringp x) x))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2157
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2158 (defun tramp-handle-file-writable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2159 "Like `file-writable-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2160 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2161 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2162 (tramp-invoke-ange-ftp 'file-writable-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2163 (if (tramp-handle-file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2164 ;; Existing files must be writable.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2165 (zerop (tramp-run-test "-w" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2166 ;; If file doesn't exist, check if directory is writable.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2167 (and (zerop (tramp-run-test
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2168 "-d" (tramp-handle-file-name-directory filename)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2169 (zerop (tramp-run-test
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2170 "-w" (tramp-handle-file-name-directory filename)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2171
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2172 (defun tramp-handle-file-ownership-preserved-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2173 "Like `file-ownership-preserved-p' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2174 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2175 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2176 (tramp-invoke-ange-ftp 'file-ownership-preserved-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2177 (or (not (tramp-handle-file-exists-p filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2178 ;; Existing files must be writable.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2179 (zerop (tramp-run-test "-O" filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2180
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2181 ;; Other file name ops.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2182
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2183 ;; ;; Matthias Köppe <mkoeppe@mail.math.uni-magdeburg.de>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2184 ;; (defun tramp-handle-directory-file-name (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2185 ;; "Like `directory-file-name' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2186 ;; (if (and (eq (aref directory (- (length directory) 1)) ?/)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2187 ;; (not (eq (aref directory (- (length directory) 2)) ?:)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2188 ;; (substring directory 0 (- (length directory) 1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2189 ;; directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2190
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2191 ;; Philippe Troin <phil@fifi.org>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2192 (defun tramp-handle-directory-file-name (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2193 "Like `directory-file-name' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2194 (with-parsed-tramp-file-name directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2195 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2196 (tramp-invoke-ange-ftp 'directory-file-name directory))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2197 (let ((directory-length-1 (1- (length directory))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2198 (save-match-data
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2199 (if (and (eq (aref directory directory-length-1) ?/)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2200 (eq (string-match tramp-file-name-regexp directory) 0)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2201 (/= (match-end 0) directory-length-1))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2202 (substring directory 0 directory-length-1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2203 directory)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2204
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2205 ;; Directory listings.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2206
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2207 (defun tramp-handle-directory-files (directory &optional full match nosort)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2208 "Like `directory-files' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2209 (with-parsed-tramp-file-name directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2210 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2211 (tramp-invoke-ange-ftp 'directory-files
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2212 directory full match nosort))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2213 (let (result x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2214 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2215 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2216 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2217 (concat "cd " (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2218 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2219 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2220 "tramp-handle-directory-files: couldn't `cd %s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2221 (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2222 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2223 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2224 (concat (tramp-get-ls-command multi-method method user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2225 " -a | cat"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2226 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2227 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2228 (while (zerop (forward-line -1))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2229 (setq x (buffer-substring (point)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2230 (tramp-line-end-position)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2231 (when (or (not match) (string-match match x))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2232 (if full
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2233 (push (concat (file-name-as-directory directory)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2234 x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2235 result)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2236 (push x result))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2237 (tramp-send-command multi-method method user host "cd")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2238 (tramp-wait-for-output))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2239 result)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2240
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2241 ;; This function should return "foo/" for directories and "bar" for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2242 ;; files. We use `ls -ad' to get a list of files (including
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2243 ;; directories), and `find . -type d \! -name . -prune' to get a list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2244 ;; of directories.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2245 (defun tramp-handle-file-name-all-completions (filename directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2246 "Like `file-name-all-completions' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2247 (with-parsed-tramp-file-name directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2248 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2249 (tramp-invoke-ange-ftp 'file-name-all-completions
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2250 filename directory))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2251 (unless (save-match-data (string-match "/" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2252 (let* ((nowild tramp-completion-without-shell-p)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2253 result)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2254 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2255 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2256 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2257 (format "cd %s" (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2258 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2259 "tramp-handle-file-name-all-completions: Couldn't `cd %s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2260 (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2261
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2262 ;; Get a list of directories and files, including reliably
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2263 ;; tagging the directories with a trailing '/'. Because I
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2264 ;; rock. --daniel@danann.net
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2265 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2266 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2267 (format (concat "%s -a %s 2>/dev/null | while read f; do "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2268 "if test -d \"$f\" 2>/dev/null; "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2269 "then echo \"$f/\"; else echo \"$f\"; fi; done")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2270 (tramp-get-ls-command multi-method method user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2271 (if (or nowild (zerop (length filename)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2272 ""
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2273 (format "-d %s*"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2274 (tramp-shell-quote-argument filename)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2275
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2276 ;; Now grab the output.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2277 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2278 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2279 (while (zerop (forward-line -1))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2280 (push (buffer-substring (point)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2281 (tramp-line-end-position))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2282 result))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2283
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2284 (tramp-send-command multi-method method user host "cd")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2285 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2286
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2287 ;; Return the list.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2288 (if nowild
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2289 (all-completions filename (mapcar 'list result))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2290 result))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2291
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2292
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2293 ;; The following isn't needed for Emacs 20 but for 19.34?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2294 (defun tramp-handle-file-name-completion (filename directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2295 "Like `file-name-completion' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2296 (unless (tramp-tramp-file-p directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2297 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2298 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2299 directory))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2300 (with-parsed-tramp-file-name directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2301 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2302 (tramp-invoke-ange-ftp 'file-name-completion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2303 filename directory))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2304 (try-completion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2305 filename
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2306 (mapcar (lambda (x) (cons x nil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2307 (tramp-handle-file-name-all-completions filename directory)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2308
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2309 ;; cp, mv and ln
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2310
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2311 (defun tramp-handle-add-name-to-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2312 (filename newname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2313 "Like `add-name-to-file' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2314 (with-parsed-tramp-file-name filename v1
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2315 (with-parsed-tramp-file-name newname v2
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2316 (let ((ln (when v1 (tramp-get-remote-ln
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2317 v1-multi-method v1-method v1-user v1-host))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2318 (unless (and v1-method v2-method v1-user v2-user v1-host v2-host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2319 (equal v1-multi-method v2-multi-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2320 (equal v1-method v2-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2321 (equal v1-user v2-user)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2322 (equal v1-host v2-host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2323 (error "add-name-to-file: %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2324 "only implemented for same method, same user, same host"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2325 (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2326 (tramp-ange-ftp-file-name-p v2-multi-method v2-method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2327 (tramp-invoke-ange-ftp 'add-name-to-file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2328 filename newname ok-if-already-exists))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2329 (when (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2330 (tramp-invoke-ange-ftp 'add-name-to-file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2331 filename newname ok-if-already-exists))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2332 (when (tramp-ange-ftp-file-name-p v2-multi-method v2-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2333 (tramp-invoke-ange-ftp 'add-name-to-file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2334 filename newname ok-if-already-exists))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2335 (when (and (not ok-if-already-exists)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2336 (file-exists-p newname)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2337 (not (numberp ok-if-already-exists))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2338 (y-or-n-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2339 (format
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2340 "File %s already exists; make it a new name anyway? "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2341 newname)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2342 (error "add-name-to-file: file %s already exists" newname))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2343 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2344 v1-multi-method v1-method v1-user v1-host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2345 (format "%s %s %s" ln (tramp-shell-quote-argument v1-path)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2346 (tramp-shell-quote-argument v2-path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2347 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2348 "error with add-name-to-file, see buffer `%s' for details"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2349 (buffer-name))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2350
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2351 (defun tramp-handle-copy-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2352 (filename newname &optional ok-if-already-exists keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2353 "Like `copy-file' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2354 ;; Check if both files are local -- invoke normal copy-file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2355 ;; Otherwise, use tramp from local system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2356 (setq filename (expand-file-name filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2357 (setq newname (expand-file-name newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2358 ;; At least one file a tramp file?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2359 (if (or (tramp-tramp-file-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2360 (tramp-tramp-file-p newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2361 (tramp-do-copy-or-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2362 'copy filename newname ok-if-already-exists keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2363 (tramp-run-real-handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2364 'copy-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2365 (list filename newname ok-if-already-exists keep-date))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2366
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2367 (defun tramp-handle-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2368 (filename newname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2369 "Like `rename-file' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2370 ;; Check if both files are local -- invoke normal rename-file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2371 ;; Otherwise, use tramp from local system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2372 (setq filename (expand-file-name filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2373 (setq newname (expand-file-name newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2374 ;; At least one file a tramp file?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2375 (if (or (tramp-tramp-file-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2376 (tramp-tramp-file-p newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2377 (tramp-do-copy-or-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2378 'rename filename newname ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2379 (tramp-run-real-handler 'rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2380 (list filename newname ok-if-already-exists))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2381
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2382 (defun tramp-do-copy-or-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2383 (op filename newname &optional ok-if-already-exists keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2384 "Copy or rename a remote file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2385 OP must be `copy' or `rename' and indicates the operation to perform.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2386 FILENAME specifies the file to copy or rename, NEWNAME is the name of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2387 the new file (for copy) or the new name of the file (for rename).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2388 OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2389 KEEP-DATE means to make sure that NEWNAME has the same timestamp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2390 as FILENAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2391
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2392 This function is invoked by `tramp-handle-copy-file' and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2393 `tramp-handle-rename-file'. It is an error if OP is neither of `copy'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2394 and `rename'. FILENAME and NEWNAME must be absolute file names."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2395 (unless (memq op '(copy rename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2396 (error "Unknown operation `%s', must be `copy' or `rename'" op))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2397 (unless ok-if-already-exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2398 (when (file-exists-p newname)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2399 (signal 'file-already-exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2400 (list newname))))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2401 (let ((t1 (tramp-tramp-file-p filename))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2402 (t2 (tramp-tramp-file-p newname)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2403 ;; Check which ones of source and target are Tramp files.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2404 (cond
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2405 ((and t1 t2)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2406 ;; Both are Tramp files.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2407 (with-parsed-tramp-file-name filename v1
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2408 (with-parsed-tramp-file-name newname v2
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2409 ;; Possibly invoke Ange-FTP.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2410 (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2411 (tramp-ange-ftp-file-name-p v2-multi-method v2-method))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2412 (tramp-invoke-ange-ftp
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2413 (if (eq op 'copy) 'copy-file 'rename-file)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2414 filename newname ok-if-already-exists keep-date))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2415 ;; Check if we can use a shortcut.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2416 (if (and (equal v1-multi-method v2-multi-method)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2417 (equal v1-method v2-method)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2418 (equal v1-host v2-host)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2419 (equal v1-user v2-user))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2420 ;; Shortcut: if method, host, user are the same for both
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2421 ;; files, we invoke `cp' or `mv' on the remote host
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2422 ;; directly.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2423 (tramp-do-copy-or-rename-file-directly
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2424 op v1-multi-method v1-method v1-user v1-host
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2425 v1-path v2-path keep-date)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2426 ;; The shortcut was not possible. So we copy the
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2427 ;; file first. If the operation was `rename', we go
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2428 ;; back and delete the original file (if the copy was
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2429 ;; successful). The approach is simple-minded: we
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2430 ;; create a new buffer, insert the contents of the
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2431 ;; source file into it, then write out the buffer to
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2432 ;; the target file. The advantage is that it doesn't
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2433 ;; matter which filename handlers are used for the
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2434 ;; source and target file.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2435
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2436 ;; CCC: If both source and target are Tramp files,
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2437 ;; and both are using the same rcp-program, then we
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2438 ;; can invoke rcp directly. Note that
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2439 ;; default-directory should point to a local
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2440 ;; directory if we want to invoke rcp.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2441 (tramp-do-copy-or-rename-via-buffer
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2442 op filename newname keep-date)))))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2443 ((or t1 t2)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2444 ;; Use the generic method via a Tramp buffer.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2445 (tramp-do-copy-or-rename-via-buffer op filename newname keep-date))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2446 (t
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2447 ;; One of them must be a Tramp file.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2448 (error "Tramp implementation says this cannot happen")))))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2449
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2450 (defun tramp-do-copy-or-rename-via-buffer (op filename newname keep-date)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2451 "Use an Emacs buffer to copy or rename a file.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2452 First arg OP is either `copy' or `rename' and indicates the operation.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2453 FILENAME is the source file, NEWNAME the target file.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2454 KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME."
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2455 (let ((trampbuf (get-buffer-create "*tramp output*")))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2456 (when keep-date
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2457 (tramp-message
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2458 1 (concat "Warning: cannot preserve file time stamp"
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2459 " with inline copying across machines")))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2460 (save-excursion
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2461 (set-buffer trampbuf) (erase-buffer)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2462 (insert-file-contents-literally filename)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2463 (let ((coding-system-for-write 'no-conversion))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2464 (write-region (point-min) (point-max) newname)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2465 ;; If the operation was `rename', delete the original file.
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2466 (unless (eq op 'copy)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2467 (delete-file filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2468
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2469 (defun tramp-do-copy-or-rename-file-directly
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2470 (op multi-method method user host path1 path2 keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2471 "Invokes `cp' or `mv' on the remote system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2472 OP must be one of `copy' or `rename', indicating `cp' or `mv',
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2473 respectively. METHOD, USER, and HOST specify the connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2474 PATH1 and PATH2 specify the two arguments of `cp' or `mv'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2475 If KEEP-DATE is non-nil, preserve the time stamp when copying."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2476 ;; CCC: What happens to the timestamp when renaming?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2477 (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2478 ((eq op 'copy) "cp -f")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2479 ((eq op 'rename) "mv -f")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2480 (t (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2481 "Unknown operation `%s', must be `copy' or `rename'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2482 op)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2483 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2484 (tramp-barf-unless-okay
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2485 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2486 (format "%s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2487 cmd
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2488 (tramp-shell-quote-argument path1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2489 (tramp-shell-quote-argument path2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2490 nil 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2491 "Copying directly failed, see buffer `%s' for details."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2492 (buffer-name)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2493
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2494 ;; mkdir
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2495 (defun tramp-handle-make-directory (dir &optional parents)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2496 "Like `make-directory' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2497 (with-parsed-tramp-file-name dir nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2498 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2499 (tramp-invoke-ange-ftp 'make-directory dir parents))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2500 (tramp-barf-unless-okay
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2501 multi-method method user host
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2502 (format " %s %s"
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2503 (if parents "mkdir -p" "mkdir")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2504 (tramp-shell-quote-argument path))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2505 nil 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2506 "Couldn't make directory %s" dir)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2507
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2508 ;; CCC error checking?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2509 (defun tramp-handle-delete-directory (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2510 "Like `delete-directory' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2511 (with-parsed-tramp-file-name directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2512 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2513 (tramp-invoke-ange-ftp 'delete-directory directory))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2514 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2515 (tramp-send-command
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2516 multi-method method user host
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2517 (format "rmdir %s ; echo ok"
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2518 (tramp-shell-quote-argument path)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2519 (tramp-wait-for-output))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2520
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2521 (defun tramp-handle-delete-file (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2522 "Like `delete-file' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2523 (with-parsed-tramp-file-name filename nil
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2524 (when (tramp-ange-ftp-file-name-p multi-method method)
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2525 (tramp-invoke-ange-ftp 'delete-file filename))
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2526 (save-excursion
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2527 (unless (zerop (tramp-send-command-and-check
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2528 multi-method method user host
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2529 (format "rm -f %s"
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2530 (tramp-shell-quote-argument path))))
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2531 (signal 'file-error "Couldn't delete Tramp file")))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2532
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2533 ;; Dired.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2534
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2535 ;; CCC: This does not seem to be enough. Something dies when
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2536 ;; we try and delete two directories under TRAMP :/
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2537 (defun tramp-handle-dired-recursive-delete-directory (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2538 "Recursively delete the directory given.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2539 This is like `dired-recursive-delete-directory' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2540 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2541 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2542 (tramp-invoke-ange-ftp 'dired-recursive-delete-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2543 filename))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2544 ;; run a shell command 'rm -r <path>'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2545 ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2546 (or (tramp-handle-file-exists-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2547 (signal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2548 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2549 (list "Removing old file name" "no such directory" filename)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2550 ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2551 (tramp-send-command multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2552 (format "rm -r %s" (tramp-shell-quote-argument path)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2553 ;; Wait for the remote system to return to us...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2554 ;; This might take a while, allow it plenty of time.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2555 (tramp-wait-for-output 120)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2556 ;; Make sure that it worked...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2557 (and (tramp-handle-file-exists-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2558 (error "Failed to recusively delete %s" filename))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2559
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2560
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2561 (defun tramp-handle-dired-call-process (program discard &rest arguments)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2562 "Like `dired-call-process' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2563 (with-parsed-tramp-file-name default-directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2564 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2565 (let ((default-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2566 (tramp-make-ange-ftp-file-name user host path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2567 (tramp-invoke-ange-ftp 'dired-call-process
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2568 program discard arguments)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2569 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2570 (tramp-barf-unless-okay
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2571 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2572 (format "cd %s" (tramp-shell-quote-argument path))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2573 nil 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2574 "tramp-handle-dired-call-process: Couldn't `cd %s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2575 (tramp-shell-quote-argument path))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2576 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2577 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2578 (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2579 (tramp-wait-for-output))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2580 (unless discard
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2581 (insert-buffer (tramp-get-buffer multi-method method user host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2582 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2583 (prog1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2584 (tramp-send-command-and-check multi-method method user host nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2585 (tramp-send-command multi-method method user host "cd")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2586 (tramp-wait-for-output)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2587
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2588 ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2589 ;; not sure at all that this is the right way to do it, but let's hope
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2590 ;; it works for now, and wait for a guru to point out the Right Way to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2591 ;; achieve this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2592 ;;(eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2593 ;; (unless (fboundp 'dired-insert-set-properties)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2594 ;; (fset 'dired-insert-set-properties 'ignore)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2595 ;; Gerd suggests this:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2596 (eval-when-compile (require 'dired))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2597 ;; Note that dired is required at run-time, too, when it is needed.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2598 ;; It is only needed on XEmacs for the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2599 ;; `dired-insert-set-properties'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2600
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2601 (defun tramp-handle-insert-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2602 (filename switches &optional wildcard full-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2603 "Like `insert-directory' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2604 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2605 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2606 (tramp-invoke-ange-ftp 'insert-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2607 filename switches wildcard full-directory-p))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2608 (tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2609 multi-method method user host 10
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2610 "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2611 switches filename (if wildcard "yes" "no")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2612 (if full-directory-p "yes" "no"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2613 (when wildcard
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2614 (setq wildcard (file-name-nondirectory path))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2615 (setq path (file-name-directory path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2616 (when (listp switches)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2617 (setq switches (mapconcat 'identity switches " ")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2618 (unless full-directory-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2619 (setq switches (concat "-d " switches)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2620 (when wildcard
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2621 (setq switches (concat switches " " wildcard)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2622 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2623 ;; If `full-directory-p', we just say `ls -l FILENAME'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2624 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2625 (if full-directory-p
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2626 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2627 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2628 (format "%s %s %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2629 (tramp-get-ls-command multi-method method user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2630 switches
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2631 (if wildcard
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2632 path
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2633 (tramp-shell-quote-argument (concat path ".")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2634 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2635 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2636 (format "cd %s" (tramp-shell-quote-argument
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2637 (file-name-directory path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2638 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2639 "Couldn't `cd %s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2640 (tramp-shell-quote-argument (file-name-directory path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2641 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2642 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2643 (format "%s %s %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2644 (tramp-get-ls-command multi-method method user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2645 switches
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2646 (if full-directory-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2647 ;; Add "/." to make sure we got complete dir
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2648 ;; listing for symlinks, too.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2649 (concat (file-name-as-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2650 (file-name-nondirectory path)) ".")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2651 (file-name-nondirectory path)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2652 (sit-for 1) ;needed for rsh but not ssh?
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2653 (tramp-wait-for-output))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2654 (insert-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2655 ;; On XEmacs, we want to call (exchange-point-and-mark t), but
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2656 ;; that doesn't exist on Emacs, so we use this workaround instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2657 ;; Since zmacs-region-stays doesn't exist in Emacs, this ought to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2658 ;; be safe. Thanks to Daniel Pittman <daniel@danann.net>.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2659 (let ((zmacs-region-stays t))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2660 (exchange-point-and-mark))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2661 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2662 (tramp-send-command multi-method method user host "cd")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2663 (tramp-wait-for-output))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2664 ;; Another XEmacs specialty follows. What's the right way to do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2665 ;; it?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2666 (when (and (featurep 'xemacs)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2667 (eq major-mode 'dired-mode))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2668 (save-excursion
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2669 (require 'dired)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2670 (dired-insert-set-properties (point) (mark t))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2671
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2672 ;; Continuation of kluge to pacify byte-compiler.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2673 ;;(eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2674 ;; (when (eq (symbol-function 'dired-insert-set-properties) 'ignore)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2675 ;; (fmakunbound 'dired-insert-set-properties)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2676
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2677 ;; CCC is this the right thing to do?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2678 (defun tramp-handle-unhandled-file-name-directory (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2679 "Like `unhandled-file-name-directory' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2680 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2681 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2682 (tramp-invoke-ange-ftp 'unhandled-file-name-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2683 filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2684 (expand-file-name "~/")))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2685
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2686 ;; Canonicalization of file names.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2687
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2688 (defun tramp-drop-volume-letter (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2689 "Cut off unnecessary drive letter from file NAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2690 The function `tramp-handle-expand-file-name' calls `expand-file-name'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2691 locally on a remote file name. When the local system is a W32 system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2692 but the remote system is Unix, this introduces a superfluous drive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2693 letter into the file name. This function removes it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2694
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2695 Doesn't do anything if the NAME does not start with a drive letter."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2696 (if (and (> (length name) 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2697 (char-equal (aref name 1) ?:)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2698 (let ((c1 (aref name 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2699 (or (and (>= c1 ?A) (<= c1 ?Z))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2700 (and (>= c1 ?a) (<= c1 ?z)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2701 (substring name 2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2702 name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2703
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2704 (defun tramp-handle-expand-file-name (name &optional dir)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2705 "Like `expand-file-name' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2706 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2707 (setq dir (or dir default-directory "/"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2708 ;; Unless NAME is absolute, concat DIR and NAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2709 (unless (file-name-absolute-p name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2710 (setq name (concat (file-name-as-directory dir) name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2711 ;; If NAME is not a tramp file, run the real handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2712 (if (not (tramp-tramp-file-p name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2713 (tramp-run-real-handler 'expand-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2714 (list name nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2715 ;; Dissect NAME.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2716 (with-parsed-tramp-file-name name nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2717 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2718 (tramp-invoke-ange-ftp 'expand-file-name name nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2719 (unless (file-name-absolute-p path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2720 (setq path (concat "~/" path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2721 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2722 ;; Tilde expansion if necessary. This needs a shell which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2723 ;; groks tilde expansion! The function `tramp-find-shell' is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2724 ;; supposed to find such a shell on the remote host. Please
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2725 ;; tell me about it when this doesn't work on your system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2726 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2727 (let ((uname (match-string 1 path))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2728 (fname (match-string 2 path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2729 ;; CCC fanatic error checking?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2730 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2731 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2732 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2733 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2734 (format "cd %s; pwd" uname)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2735 t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2736 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2737 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2738 (setq uname (buffer-substring (point) (tramp-line-end-position)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2739 (setq path (concat uname fname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2740 (erase-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2741 ;; No tilde characters in file name, do normal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2742 ;; expand-file-name (this does "/./" and "/../"). We bind
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2743 ;; directory-sep-char here for XEmacs on Windows, which would
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2744 ;; otherwise use backslash.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2745 (let ((directory-sep-char ?/))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2746 (tramp-make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2747 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2748 (tramp-drop-volume-letter
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2749 (tramp-run-real-handler 'expand-file-name (list path)))))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2750
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2751 ;; Remote commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2752
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2753 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2754 "Like `shell-command' for tramp files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2755 This will break if COMMAND prints a newline, followed by the value of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2756 `tramp-end-of-output', followed by another newline."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2757 (if (tramp-tramp-file-p default-directory)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2758 (with-parsed-tramp-file-name default-directory nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2759 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2760 (let ((default-directory (tramp-make-ange-ftp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2761 user host path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2762 (tramp-invoke-ange-ftp 'shell-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2763 command output-buffer error-buffer)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2764 (let (status)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2765 (when (string-match "&[ \t]*\\'" command)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2766 (error "Tramp doesn't grok asynchronous shell commands, yet"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2767 (when error-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2768 (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2769 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2770 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2771 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2772 (format "cd %s" (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2773 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2774 "tramp-handle-shell-command: Couldn't `cd %s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2775 (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2776 (tramp-send-command multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2777 (concat command "; tramp_old_status=$?"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2778 ;; This will break if the shell command prints "/////"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2779 ;; somewhere. Let's just hope for the best...
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2780 (tramp-wait-for-output))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2781 (unless output-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2782 (setq output-buffer (get-buffer-create "*Shell Command Output*"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2783 (set-buffer output-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2784 (erase-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2785 (unless (bufferp output-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2786 (setq output-buffer (current-buffer)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2787 (set-buffer output-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2788 (insert-buffer (tramp-get-buffer multi-method method user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2789 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2790 (tramp-send-command multi-method method user host "cd")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2791 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2792 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2793 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2794 (concat "tramp_set_exit_status $tramp_old_status;"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2795 " echo tramp_exit_status $?"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2796 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2797 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2798 (unless (search-backward "tramp_exit_status " nil t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2799 (error "Couldn't find exit status of `%s'" command))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2800 (skip-chars-forward "^ ")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2801 (setq status (read (current-buffer))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2802 (unless (zerop (buffer-size))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2803 (pop-to-buffer output-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2804 status)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2805 ;; The following is only executed if something strange was
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2806 ;; happening. Emit a helpful message and do it anyway.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2807 (message "tramp-handle-shell-command called with non-tramp directory: `%s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2808 default-directory)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2809 (tramp-run-real-handler 'shell-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2810 (list command output-buffer error-buffer)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2811
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2812 ;; File Editing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2813
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2814 (defsubst tramp-make-temp-file ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2815 (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2816 (expand-file-name tramp-temp-name-prefix
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2817 (tramp-temporary-file-directory))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2818
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2819 (defun tramp-handle-file-local-copy (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2820 "Like `file-local-copy' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2821 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2822 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2823 (tramp-invoke-ange-ftp 'file-local-copy filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2824 (let ((trampbuf (get-buffer-create "*tramp output*"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2825 tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2826 (unless (file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2827 (error "Cannot make local copy of non-existing file `%s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2828 filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2829 (setq tmpfil (tramp-make-temp-file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2830 (cond ((tramp-get-rcp-program multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2831 ;; Use tramp-like program for file transfer.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2832 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2833 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2834 5 "Fetching %s to tmp file %s..." filename tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2835 (save-excursion (set-buffer trampbuf) (erase-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2836 (unless (equal
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2837 0
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2838 (apply #'call-process
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2839 (tramp-get-rcp-program multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2840 nil trampbuf nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2841 (append (tramp-get-rcp-args multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2842 (list
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2843 (tramp-make-rcp-program-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2844 user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2845 (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2846 tmpfil))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2847 (pop-to-buffer trampbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2848 (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2849 (concat "tramp-handle-file-local-copy: `%s' didn't work, "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2850 "see buffer `%s' for details")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2851 (tramp-get-rcp-program multi-method method) trampbuf))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2852 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2853 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2854 5 "Fetching %s to tmp file %s...done" filename tmpfil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2855 ((and (tramp-get-encoding-command multi-method method)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2856 (tramp-get-decoding-command multi-method method))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2857 ;; Use inline encoding for file transfer.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2858 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2859 ;; Following line for setting tramp-current-method,
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2860 ;; tramp-current-user, tramp-current-host.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2861 (set-buffer (tramp-get-buffer multi-method method user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2862 (tramp-message 5 "Encoding remote file %s..." filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2863 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2864 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2865 (concat (tramp-get-encoding-command multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2866 " < " (tramp-shell-quote-argument path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2867 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2868 "Encoding remote file failed, see buffer `%s' for details"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2869 (tramp-get-buffer multi-method method user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2870 ;; Remove trailing status code
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2871 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2872 (delete-region (point) (progn (forward-line -1) (point)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2873
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2874 (tramp-message 5 "Decoding remote file %s..." filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2875 (if (and (tramp-get-decoding-function multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2876 (fboundp (tramp-get-decoding-function
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2877 multi-method method)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2878 ;; If tramp-decoding-function is defined for this
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2879 ;; method, we call it.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2880 (let ((tmpbuf (get-buffer-create " *tramp tmp*")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2881 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2882 (erase-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2883 (insert-buffer (tramp-get-buffer multi-method method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2884 user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2885 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2886 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2887 6 "Decoding remote file %s with function %s..."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2888 filename
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2889 (tramp-get-decoding-function multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2890 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2891 (let ((coding-system-for-write 'no-conversion))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2892 (funcall (tramp-get-decoding-function
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2893 multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2894 (point-min)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2895 (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2896 (write-region (point-min) (point-max) tmpfil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2897 (kill-buffer tmpbuf))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2898 ;; If tramp-decoding-function is not defined for this
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2899 ;; method, we invoke tramp-decoding-command instead.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2900 (let ((tmpfil2 (tramp-make-temp-file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2901 (write-region (point-min) (point-max) tmpfil2)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2902 (tramp-message
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2903 6 "Decoding remote file %s with command %s..."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2904 filename
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2905 (tramp-get-decoding-command multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2906 (call-process
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2907 tramp-sh-program
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2908 tmpfil2 ;input
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2909 nil ;output
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2910 nil ;display
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2911 "-c" (concat (tramp-get-decoding-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2912 multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2913 " > " tmpfil))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2914 (delete-file tmpfil2)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2915 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2916 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2917 5 "Decoding remote file %s...done" filename)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2918
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2919 (t (error "Wrong method specification for `%s'" method)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2920 tmpfil)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2921
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2922
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2923 (defun tramp-handle-insert-file-contents
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2924 (filename &optional visit beg end replace)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2925 "Like `insert-file-contents' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2926 (barf-if-buffer-read-only)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2927 (setq filename (expand-file-name filename))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2928 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2929 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2930 (tramp-invoke-ange-ftp 'insert-file-contents
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2931 filename visit beg end replace))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2932 (if (not (tramp-handle-file-exists-p filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2933 (progn
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2934 (when visit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2935 (setq buffer-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2936 (set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2937 (set-buffer-modified-p nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2938 (signal 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2939 (format "File `%s' not found on remote host" filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2940 (list (tramp-handle-expand-file-name filename) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2941 (let ((local-copy (tramp-handle-file-local-copy filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2942 (coding-system-used nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2943 (result nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2944 (when visit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2945 (setq buffer-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2946 (set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2947 (set-buffer-modified-p nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2948 (tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2949 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2950 9 "Inserting local temp file `%s'..." local-copy)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2951 (setq result
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2952 (tramp-run-real-handler 'insert-file-contents
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2953 (list local-copy nil beg end replace)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2954 ;; Now `last-coding-system-used' has right value. Remember it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2955 (when (boundp 'last-coding-system-used)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2956 (setq coding-system-used last-coding-system-used))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2957 (tramp-message 9 "Inserting local temp file `%s'...done" local-copy)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2958 (delete-file local-copy)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2959 (when (boundp 'last-coding-system-used)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2960 (setq last-coding-system-used coding-system-used))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2961 (list (expand-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2962 (second result))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2963
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2964 ;; CCC grok APPEND, LOCKNAME, CONFIRM
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2965 (defun tramp-handle-write-region
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2966 (start end filename &optional append visit lockname confirm)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2967 "Like `write-region' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2968 (unless (eq append nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2969 (error "Cannot append to file using tramp (`%s')" filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2970 (setq filename (expand-file-name filename))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2971 ;; Following part commented out because we don't know what to do about
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2972 ;; file locking, and it does not appear to be a problem to ignore it.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2973 ;; Ange-ftp ignores it, too.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2974 ;; (when (and lockname (stringp lockname))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2975 ;; (setq lockname (expand-file-name lockname)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2976 ;; (unless (or (eq lockname nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2977 ;; (string= lockname filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2978 ;; (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2979 ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2980 ;; XEmacs takes a coding system as the sevent argument, not `confirm'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2981 (when (and (not (featurep 'xemacs))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2982 confirm (file-exists-p filename))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2983 (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2984 filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2985 (error "File not overwritten")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2986 (with-parsed-tramp-file-name filename nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2987 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2988 (tramp-invoke-ange-ftp 'write-region
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2989 start end filename append visit lockname confirm))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2990 (let ((curbuf (current-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2991 (rcp-program (tramp-get-rcp-program multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2992 (rcp-args (tramp-get-rcp-args multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2993 (encoding-command (tramp-get-encoding-command multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2994 (encoding-function
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2995 (tramp-get-encoding-function multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2996 (decoding-command (tramp-get-decoding-command multi-method method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2997 (trampbuf (get-buffer-create "*tramp output*"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2998 ;; We use this to save the value of `last-coding-system-used'
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2999 ;; after writing the tmp file. At the end of the function,
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3000 ;; we set `last-coding-system-used' to this saved value.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3001 ;; This way, any intermediary coding systems used while
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3002 ;; talking to the remote shell or suchlike won't hose this
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3003 ;; variable. This approach was snarfed from ange-ftp.el.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3004 coding-system-used
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3005 tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3006 ;; Write region into a tmp file. This isn't really needed if we
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3007 ;; use an encoding function, but currently we use it always
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3008 ;; because this makes the logic simpler.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3009 (setq tmpfil (tramp-make-temp-file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3010 ;; We say `no-message' here because we don't want the visited file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3011 ;; modtime data to be clobbered from the temp file. We call
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3012 ;; `set-visited-file-modtime' ourselves later on.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3013 (tramp-run-real-handler
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3014 'write-region
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3015 (if confirm ; don't pass this arg unless defined for backward compat.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3016 (list start end tmpfil append 'no-message lockname confirm)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3017 (list start end tmpfil append 'no-message lockname)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3018 ;; Now, `last-coding-system-used' has the right value. Remember it.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3019 (when (boundp 'last-coding-system-used)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3020 (setq coding-system-used last-coding-system-used))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3021 ;; This is a bit lengthy due to the different methods possible for
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3022 ;; file transfer. First, we check whether the method uses an rcp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3023 ;; program. If so, we call it. Otherwise, both encoding and
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3024 ;; decoding command must be specified. However, if the method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3025 ;; _also_ specifies an encoding function, then that is used for
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3026 ;; encoding the contents of the tmp file.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3027 (cond (rcp-program
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3028 ;; use rcp-like program for file transfer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3029 (let ((argl (append rcp-args
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3030 (list
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3031 tmpfil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3032 (tramp-make-rcp-program-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3033 user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3034 (tramp-shell-quote-argument path))))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3035 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3036 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3037 6 "Writing tmp file using `%s'..." rcp-program)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3038 (save-excursion (set-buffer trampbuf) (erase-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3039 (when tramp-debug-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3040 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3041 (set-buffer (tramp-get-debug-buffer multi-method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3042 method user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3043 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3044 (tramp-insert-with-face
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3045 'bold (format "$ %s %s\n" rcp-program
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3046 (mapconcat 'identity argl " ")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3047 (unless (equal 0
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3048 (apply #'call-process
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3049 rcp-program nil trampbuf nil argl))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3050 (pop-to-buffer trampbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3051 (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3052 "Cannot write region to file `%s', command `%s' failed"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3053 filename rcp-program))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3054 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3055 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3056 6 "Transferring file using `%s'...done"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3057 rcp-program)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3058 ((and encoding-command decoding-command)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3059 ;; Use inline file transfer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3060 (let ((tmpbuf (get-buffer-create " *tramp file transfer*")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3061 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3062 ;; Encode tmpfil into tmpbuf
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3063 (tramp-message-for-buffer multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3064 5 "Encoding region...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3065 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3066 (erase-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3067 ;; Use encoding function or command.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3068 (if (and encoding-function
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3069 (fboundp encoding-function))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3070 (progn
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3071 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3072 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3073 6 "Encoding region using function...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3074 (insert-file-contents-literally tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3075 ;; CCC. The following `let' is a workaround for
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3076 ;; the base64.el that comes with pgnus-0.84. If
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3077 ;; both of the following conditions are
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3078 ;; satisfied, it tries to write to a local file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3079 ;; in default-directory, but at this point,
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3080 ;; default-directory is remote.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3081 ;; (CALL-PROCESS-REGION can't write to remote
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3082 ;; files, it seems.) The file in question is a
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3083 ;; tmp file anyway.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3084 (let ((default-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3085 (tramp-temporary-file-directory)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3086 (funcall encoding-function (point-min) (point-max)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3087 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3088 (unless (bolp)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3089 (newline)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3090 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3091 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3092 6 "Encoding region using command...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3093 (unless (equal 0
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3094 (call-process
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3095 tramp-sh-program
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3096 tmpfil ;input = local tmp file
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3097 t ;output is current buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3098 nil ;don't redisplay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3099 "-c"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3100 encoding-command))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3101 (pop-to-buffer trampbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3102 (error (concat "Cannot write to `%s', local encoding"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3103 " command `%s' failed")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3104 filename encoding-command)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3105 ;; Send tmpbuf into remote decoding command which
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3106 ;; writes to remote file. Because this happens on the
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3107 ;; remote host, we cannot use the function.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3108 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3109 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3110 5 "Decoding region into remote file %s..." filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3111 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3112 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3113 (format "%s >%s <<'EOF'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3114 decoding-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3115 (tramp-shell-quote-argument path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3116 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3117 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3118 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3119 6 "Sending data to remote host...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3120 (tramp-send-region multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3121 (point-min) (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3122 ;; wait for remote decoding to complete
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3123 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3124 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3125 6 "Sending end of data token...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3126 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3127 multi-method method user host "EOF")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3128 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3129 multi-method method user host 6
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3130 "Waiting for remote host to process data...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3131 (set-buffer (tramp-get-buffer multi-method method user host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3132 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3133 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3134 multi-method method user host nil nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3135 (concat "Couldn't write region to `%s',"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3136 " decode using `%s' failed")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3137 filename decoding-command)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3138 (tramp-message 5 "Decoding region into remote file %s...done"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3139 filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3140 (kill-buffer tmpbuf))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3141 (t
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3142 (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3143 (concat "Method `%s' should specify both encoding and "
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3144 "decoding command or an rcp program")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3145 method)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3146 (delete-file tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3147 (unless (equal curbuf (current-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3148 (error "Buffer has changed from `%s' to `%s'"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3149 curbuf (current-buffer)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3150 (when (eq visit t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3151 (set-visited-file-modtime))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3152 ;; Make `last-coding-system-used' have the right value.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3153 (when (boundp 'last-coding-system-used)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3154 (setq last-coding-system-used coding-system-used))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3155 (when (or (eq visit t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3156 (eq visit nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3157 (stringp visit))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3158 (message "Wrote %s" filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3159
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3160 ;; Call down to the real handler.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3161 ;; Because EFS does not play nicely with TRAMP (both systems match an
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3162 ;; TRAMP path) it is needed to disable efs as well as tramp for the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3163 ;; operation.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3164 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3165 ;; Other than that, this is the canon file-handler code that the doco
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3166 ;; says should be used here. Which is nice.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3167 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3168 ;; Under XEmacs current, EFS also hooks in as
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3169 ;; efs-sifn-handler-function to handle any path with environment
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3170 ;; variables. This has two implications:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3171 ;; 1) That EFS may not be completely dead (yet) for TRAMP paths
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3172 ;; 2) That TRAMP might want to do the same thing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3173 ;; Details as they come in.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3174 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3175 ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3176
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3177 ;; (defun tramp-run-real-handler (operation args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3178 ;; "Invoke normal file name handler for OPERATION.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3179 ;; This inhibits EFS and Ange-FTP, too, because they conflict with tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3180 ;; First arg specifies the OPERATION, remaining ARGS are passed to the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3181 ;; OPERATION."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3182 ;; (let ((inhibit-file-name-handlers
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3183 ;; (list 'tramp-file-name-handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3184 ;; 'efs-file-handler-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3185 ;; 'ange-ftp-hook-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3186 ;; (and (eq inhibit-file-name-operation operation)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3187 ;; inhibit-file-name-handlers)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3188 ;; (inhibit-file-name-operation operation))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3189 ;; (apply operation args)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3190
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3191 (defun tramp-run-real-handler (operation args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3192 "Invoke normal file name handler for OPERATION.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3193 First arg specifies the OPERATION, second arg is a list of arguments to
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3194 pass to the OPERATION."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3195 (let ((inhibit-file-name-handlers
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3196 (list 'tramp-file-name-handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3197 (and (eq inhibit-file-name-operation operation)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3198 inhibit-file-name-handlers)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3199 (inhibit-file-name-operation operation))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3200 (apply operation args)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3201
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3202 ;; Main function.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3203 ;;;###autoload
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3204 (defun tramp-file-name-handler (operation &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3205 "Invoke tramp file name handler.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3206 Falls back to normal file name handler if no tramp file name handler exists."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3207 (let ((fn (assoc operation tramp-file-name-handler-alist)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3208 (if fn
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3209 (catch 'tramp-forward-to-ange-ftp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3210 (save-match-data (apply (cdr fn) args)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3211 (tramp-run-real-handler operation args))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3212
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3213 ;; Register in file name handler alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3214 ;;;###autoload
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3215 (add-to-list 'file-name-handler-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3216 (cons tramp-file-name-regexp 'tramp-file-name-handler))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3217
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3218 ;; To handle EFS, the following functions need to be dealt with:
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3219 ;;
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3220 ;; * dired-before-readin-hook contains efs-dired-before-readin
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3221 ;; * file-name-handler-alist contains efs-file-handler-function
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3222 ;; and efs-root-handler-function and efs-sifn-handler-function
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3223 ;; * find-file-hooks contains efs-set-buffer-mode
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3224 ;;
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3225 ;; But it won't happen for EFS since the XEmacs maintainers
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3226 ;; don't want to use a unified filename syntax.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3227 (defun tramp-disable-ange-ftp ()
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3228 "Turn Ange-FTP off.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3229 This is useful for unified remoting. See
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3230 `tramp-file-name-structure-unified' and
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3231 `tramp-file-name-structure-separate' for details. Requests suitable
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3232 for Ange-FTP will be forwarded to Ange-FTP. Also see the variables
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3233 `tramp-ftp-method', `tramp-default-method', and
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3234 `tramp-default-method-alist'.
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3235
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3236 This function is not needed in Emacsen which include Tramp, but is
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3237 present for backward compatibility."
46060
40298ba8e901 (tramp-handle-ange-ftp): Fix typo.
Andreas Schwab <schwab@suse.de>
parents: 46048
diff changeset
3238 (let ((a1 (rassq 'ange-ftp-hook-function file-name-handler-alist))
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3239 (a2 (rassq 'ange-ftp-completion-hook-function file-name-handler-alist)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3240 (setq file-name-handler-alist
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3241 (delete a1 (delete a2 file-name-handler-alist)))))
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
3242 (tramp-disable-ange-ftp)
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3243
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3244 (defun tramp-repair-jka-compr ()
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3245 "If jka-compr is already loaded, move it to the front of
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3246 `file-name-handler-alist'. On Emacs 21.4 or so this will not be
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3247 necessary anymore."
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3248 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3249 (when jka
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3250 (setq file-name-handler-alist
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3251 (cons jka (delete jka file-name-handler-alist))))))
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3252 (tramp-repair-jka-compr)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3253
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3254 (defun tramp-invoke-ange-ftp (operation &rest args)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3255 "Invoke the Ange-FTP handler function and throw."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3256 (let ((ange-ftp-name-format
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3257 (list (nth 0 tramp-file-name-structure)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3258 (nth 3 tramp-file-name-structure)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3259 (nth 2 tramp-file-name-structure)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3260 (nth 4 tramp-file-name-structure))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3261 (throw 'tramp-forward-to-ange-ftp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3262 (apply 'ange-ftp-hook-function operation args))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3263
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3264 (defun tramp-ange-ftp-file-name-p (multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3265 "Check if it's a filename that should be forwarded to Ange-FTP."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3266 (and (null multi-method) (string= method tramp-ftp-method)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3267
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3268
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3269 ;;; Interactions with other packages:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3270
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3271 ;; -- complete.el --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3272
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3273 ;; This function contributed by Ed Sabol
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3274 (defun tramp-handle-expand-many-files (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3275 "Like `PC-expand-many-files' for tramp files."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3276 (with-parsed-tramp-file-name name nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3277 (when (tramp-ange-ftp-file-name-p multi-method method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3278 (tramp-invoke-ange-ftp 'expand-many-files name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3279 (save-match-data
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3280 (if (or (string-match "\\*" name)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3281 (string-match "\\?" name)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3282 (string-match "\\[.*\\]" name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3283 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3284 ;; Dissect NAME.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3285 (let (bufstr)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3286 ;; Perhaps invoke Ange-FTP.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3287 (when (string= method tramp-ftp-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3288 (signal 'tramp-run-ange-ftp (list 0)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3289 ;; CCC: To do it right, we should quote certain characters
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3290 ;; in the file name, but since the echo command is going to
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3291 ;; break anyway when there are spaces in the file names, we
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3292 ;; don't bother.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3293 ;;-(let ((comint-file-name-quote-list
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3294 ;;- (set-difference tramp-file-name-quote-list
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3295 ;;- '(?\* ?\? ?[ ?]))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3296 ;;- (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3297 ;;- multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3298 ;;- (format "echo %s" (comint-quote-filename path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3299 ;;- (tramp-wait-for-output))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3300 (tramp-send-command multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3301 (format "echo %s" path))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3302 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3303 (setq bufstr (buffer-substring (point-min)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3304 (tramp-line-end-position)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3305 (goto-char (point-min))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3306 (if (string-equal path bufstr)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3307 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3308 (insert "(\"")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3309 (while (search-forward " " nil t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3310 (delete-backward-char 1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3311 (insert "\" \""))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3312 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3313 (delete-backward-char 1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3314 (insert "\")")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3315 (goto-char (point-min))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3316 (mapcar
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3317 (function (lambda (x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3318 (tramp-make-tramp-file-name multi-method method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3319 user host x)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3320 (read (current-buffer))))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3321 (list (tramp-handle-expand-file-name name))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3322
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3323 ;; Check for complete.el and override PC-expand-many-files if appropriate.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3324 (eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3325 (defun tramp-save-PC-expand-many-files (name))); avoid compiler warning
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3326
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3327 (defun tramp-setup-complete ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3328 (fset 'tramp-save-PC-expand-many-files
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3329 (symbol-function 'PC-expand-many-files))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3330 (defun PC-expand-many-files (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3331 (if (tramp-tramp-file-p name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3332 (tramp-handle-expand-many-files name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3333 (tramp-save-PC-expand-many-files name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3334
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3335 ;; Why isn't eval-after-load sufficient?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3336 (if (fboundp 'PC-expand-many-files)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3337 (tramp-setup-complete)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3338 (eval-after-load "complete" '(tramp-setup-complete)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3339
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3340
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3341
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3342
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3343 ;;; Internal Functions:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3344
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3345 (defun tramp-set-auto-save ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3346 (when (and (buffer-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3347 (tramp-tramp-file-p (buffer-file-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3348 auto-save-default)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3349 (auto-save-mode 1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3350 (add-hook 'find-file-hooks 'tramp-set-auto-save t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3351
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3352 (defun tramp-run-test (switch filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3353 "Run `test' on the remote system, given a SWITCH and a FILENAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3354 Returns the exit code of the `test' program."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3355 (let ((v (tramp-dissect-file-name filename)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3356 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3357 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3358 (tramp-file-name-multi-method v) (tramp-file-name-method v)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3359 (tramp-file-name-user v) (tramp-file-name-host v)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3360 (format "test %s %s" switch
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3361 (tramp-shell-quote-argument (tramp-file-name-path v)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3362
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3363 (defun tramp-run-test2 (program file1 file2 &optional switch)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3364 "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3365 The optional SWITCH is inserted between the two files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3366 Returns the exit code of the `test' PROGRAM. Barfs if the methods,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3367 hosts, or files, disagree."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3368 (let* ((v1 (tramp-dissect-file-name file1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3369 (v2 (tramp-dissect-file-name file2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3370 (mmethod1 (tramp-file-name-multi-method v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3371 (mmethod2 (tramp-file-name-multi-method v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3372 (method1 (tramp-file-name-method v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3373 (method2 (tramp-file-name-method v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3374 (user1 (tramp-file-name-user v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3375 (user2 (tramp-file-name-user v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3376 (host1 (tramp-file-name-host v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3377 (host2 (tramp-file-name-host v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3378 (path1 (tramp-file-name-path v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3379 (path2 (tramp-file-name-path v2)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3380 (unless (and method1 method2 host1 host2
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3381 (equal mmethod1 mmethod2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3382 (equal method1 method2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3383 (equal user1 user2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3384 (equal host1 host2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3385 (error "tramp-run-test2: %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3386 "only implemented for same method, same user, same host"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3387 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3388 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3389 mmethod1 method1 user1 host1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3390 (format "%s %s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3391 program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3392 (tramp-shell-quote-argument path1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3393 (or switch "")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3394 (tramp-shell-quote-argument path2))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3395
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3396 (defun tramp-buffer-name (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3397 "A name for the connection buffer for USER at HOST using METHOD."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3398 (cond (multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3399 (tramp-buffer-name-multi-method "tramp" multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3400 (user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3401 (format "*tramp/%s %s@%s*" method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3402 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3403 (format "*tramp/%s %s*" method host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3404
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3405 (defun tramp-buffer-name-multi-method (prefix multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3406 "A name for the multi method connection buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3407 MULTI-METHOD gives the multi method, METHOD the array of methods,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3408 USER the array of user names, HOST the array of host names."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3409 (unless (and (= (length method) (length user))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3410 (= (length method) (length host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3411 (error "Syntax error in multi method (implementation error)"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3412 (let ((len (length method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3413 (i 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3414 string-list)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3415 (while (< i len)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3416 (setq string-list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3417 (cons (if (aref user i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3418 (format "%s#%s@%s:" (aref method i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3419 (aref user i) (aref host i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3420 (format "%s@%s:" (aref method i) (aref host i)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3421 string-list))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3422 (incf i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3423 (format "*%s/%s %s*"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3424 prefix multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3425 (apply 'concat (reverse string-list)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3426
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3427 (defun tramp-get-buffer (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3428 "Get the connection buffer to be used for USER at HOST using METHOD."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3429 (get-buffer-create (tramp-buffer-name multi-method method user host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3430
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3431 (defun tramp-debug-buffer-name (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3432 "A name for the debug buffer for USER at HOST using METHOD."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3433 (cond (multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3434 (tramp-buffer-name-multi-method "debug tramp"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3435 multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3436 (user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3437 (format "*debug tramp/%s %s@%s*" method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3438 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3439 (format "*debug tramp/%s %s*" method host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3440
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3441 (defun tramp-get-debug-buffer (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3442 "Get the debug buffer for USER at HOST using METHOD."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3443 (get-buffer-create (tramp-debug-buffer-name multi-method method user host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3444
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3445 (defun tramp-find-executable (multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3446 progname dirlist ignore-tilde)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3447 "Searches for PROGNAME in all directories mentioned in DIRLIST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3448 First args METHOD, USER and HOST specify the connection, PROGNAME
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3449 is the program to search for, and DIRLIST gives the list of directories
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3450 to search. If IGNORE-TILDE is non-nil, directory names starting
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3451 with `~' will be ignored.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3452
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3453 Returns the full path name of PROGNAME, if found, and nil otherwise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3454
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3455 This function expects to be in the right *tramp* buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3456 (let (result)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3457 (when ignore-tilde
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3458 ;; Remove all ~/foo directories from dirlist. In Emacs 20,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3459 ;; `remove' is in CL, and we want to avoid CL dependencies.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3460 (let (newdl d)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3461 (while dirlist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3462 (setq d (car dirlist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3463 (setq dirlist (cdr dirlist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3464 (unless (char-equal ?~ (aref d 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3465 (setq newdl (cons d newdl))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3466 (setq dirlist (nreverse newdl))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3467 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3468 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3469 (format (concat "while read d; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3470 "do if test -x $d/%s -a -f $d/%s; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3471 "then echo tramp_executable $d/%s; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3472 "break; fi; done <<'EOF'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3473 progname progname progname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3474 (mapcar (lambda (d)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3475 (tramp-send-command multi-method method user host d))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3476 dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3477 (tramp-send-command multi-method method user host "EOF")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3478 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3479 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3480 (when (search-backward "tramp_executable " nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3481 (skip-chars-forward "^ ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3482 (skip-chars-forward " ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3483 (buffer-substring (point) (tramp-line-end-position)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3484
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3485 (defun tramp-set-remote-path (multi-method method user host var dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3486 "Sets the remote environment VAR to existing directories from DIRLIST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3487 I.e., for each directory in DIRLIST, it is tested whether it exists and if
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3488 so, it is added to the environment variable VAR."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3489 (let ((existing-dirs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3490 (mapcar
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3491 (lambda (x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3492 (when (and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3493 (file-exists-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3494 (tramp-make-tramp-file-name multi-method method user host x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3495 (file-directory-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3496 (tramp-make-tramp-file-name multi-method method user host x)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3497 x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3498 dirlist)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3499 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3500 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3501 (concat var "="
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3502 (mapconcat 'identity (delq nil existing-dirs) ":")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3503 "; export " var))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3504 (tramp-wait-for-output)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3505
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3506 ;; -- communication with external shell --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3507
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3508 (defun tramp-find-file-exists-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3509 "Find a command on the remote host for checking if a file exists.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3510 Here, we are looking for a command which has zero exit status if the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3511 file exists and nonzero exit status otherwise."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3512 (make-local-variable 'tramp-file-exists-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3513 (tramp-message 10 "Finding command to check if file exists")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3514 (let ((existing
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3515 (tramp-make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3516 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3517 "/")) ;assume this file always exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3518 (nonexisting
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3519 (tramp-make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3520 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3521 "/ this file does not exist "))) ;assume this never exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3522 ;; The algorithm is as follows: we try a list of several commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3523 ;; For each command, we first run `$cmd /' -- this should return
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3524 ;; true, as the root directory always exists. And then we run
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3525 ;; `$cmd /this\ file\ does\ not\ exist', hoping that the file indeed
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3526 ;; does not exist. This should return false. We use the first
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3527 ;; command we find that seems to work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3528 ;; The list of commands to try is as follows:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3529 ;; `ls -d' This works on most systems, but NetBSD 1.4
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3530 ;; has a bug: `ls' always returns zero exit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3531 ;; status, even for files which don't exist.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3532 ;; `test -e' Some Bourne shells have a `test' builtin
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3533 ;; which does not know the `-e' option.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3534 ;; `/bin/test -e' For those, the `test' binary on disk normally
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3535 ;; provides the option. Alas, the binary
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3536 ;; is sometimes `/bin/test' and sometimes it's
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3537 ;; `/usr/bin/test'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3538 ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3539 (unless (or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3540 (and (setq tramp-file-exists-command "ls -d %s")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3541 (tramp-handle-file-exists-p existing)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3542 (not (tramp-handle-file-exists-p nonexisting)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3543 (and (setq tramp-file-exists-command "test -e %s")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3544 (tramp-handle-file-exists-p existing)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3545 (not (tramp-handle-file-exists-p nonexisting)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3546 (and (setq tramp-file-exists-command "/bin/test -e %s")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3547 (tramp-handle-file-exists-p existing)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3548 (not (tramp-handle-file-exists-p nonexisting)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3549 (and (setq tramp-file-exists-command "/usr/bin/test -e %s")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3550 (tramp-handle-file-exists-p existing)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3551 (not (tramp-handle-file-exists-p nonexisting))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3552 (error "Couldn't find command to check if file exists."))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3553
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3554
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3555 ;; CCC test ksh or bash found for tilde expansion?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3556 (defun tramp-find-shell (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3557 "Find a shell on the remote host which groks tilde expansion."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3558 (let ((shell nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3559 (tramp-send-command multi-method method user host "echo ~root")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3560 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3561 (cond
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3562 ((string-match "^~root$" (buffer-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3563 (setq shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3564 (or (tramp-find-executable multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3565 "bash" tramp-remote-path t)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3566 (tramp-find-executable multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3567 "ksh" tramp-remote-path t)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3568 (unless shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3569 (error "Couldn't find a shell which groks tilde expansion"))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3570 ;; Find arguments for this shell.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3571 (let ((alist tramp-sh-extra-args)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3572 item extra-args)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3573 (while (and alist (null extra-args))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3574 (setq item (pop alist))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3575 (when (string-match (car item) shell)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3576 (setq extra-args (cdr item))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3577 (when extra-args (setq shell (concat shell " " extra-args))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3578 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3579 5 "Starting remote shell `%s' for tilde expansion..." shell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3580 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3581 multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3582 (concat "PS1='$ ' ; exec " shell)) ;
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3583 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3584 (get-buffer-process (current-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3585 60 (format "\\(\\$ *\\|\\(%s\\)\\'\\)" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3586 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3587 (error "Couldn't find remote `%s' prompt." shell))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3588 (process-send-string nil (format "PS1='%s%s%s'; PS2=''; PS3=''%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3589 tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3590 tramp-end-of-output
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3591 tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3592 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3593 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3594 (tramp-send-command multi-method method user host "echo hello")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3595 (tramp-message 5 "Waiting for remote `%s' to start up..." shell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3596 (unless (tramp-wait-for-output 5)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3597 (unless (tramp-wait-for-output 5)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3598 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3599 (error "Couldn't start remote `%s', see buffer `%s' for details"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3600 shell (buffer-name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3601 (tramp-message 5 "Waiting for remote `%s' to start up...done" shell))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3602 (t (tramp-message 5 "Remote `%s' groks tilde expansion, good"
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3603 (tramp-get-remote-sh multi-method method))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3604
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3605 (defun tramp-check-ls-command (multi-method method user host cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3606 "Checks whether the given `ls' executable groks `-n'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3607 METHOD, USER and HOST specify the connection, CMD (the full path name of)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3608 the `ls' executable. Returns t if CMD supports the `-n' option, nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3609 otherwise."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3610 (tramp-message 9 "Checking remote `%s' command for `-n' option"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3611 cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3612 (when (tramp-handle-file-executable-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3613 (tramp-make-tramp-file-name multi-method method user host cmd))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3614 (let ((result nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3615 (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3616 (setq result
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3617 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3618 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3619 (format "%s -lnd / >/dev/null"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3620 cmd)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3621 (tramp-message 7 "Testing remote command `%s' for -n...%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3622 cmd
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3623 (if (zerop result) "okay" "failed"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3624 (zerop result))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3625
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3626 (defun tramp-check-ls-commands (multi-method method user host cmd dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3627 "Checks whether the given `ls' executable in one of the dirs groks `-n'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3628 Returns nil if none was found, else the command is returned."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3629 (let ((dl dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3630 (result nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3631 ;; It would be better to use the CL function `find', but
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3632 ;; we don't want run-time dependencies on CL.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3633 (while (and dl (not result))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3634 (let ((x (concat (file-name-as-directory (car dl)) cmd)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3635 (when (tramp-check-ls-command multi-method method user host x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3636 (setq result x)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3637 (setq dl (cdr dl)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3638 result))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3639
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3640 (defun tramp-find-ls-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3641 "Finds an `ls' command which groks the `-n' option, returning nil if failed.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3642 \(This option prints numeric user and group ids in a long listing.)"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3643 (tramp-message 9 "Finding a suitable `ls' command")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3644 (or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3645 (tramp-check-ls-commands multi-method method user host "ls" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3646 (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3647 (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3648
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3649 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3650 ;; -- Functions for establishing connection --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3651 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3652
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3653 (defun tramp-process-actions
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3654 (multi-method method user host actions &optional timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3655 "Process given ACTIONS for login specified via first four args.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3656 ACTIONS is a list of items (REGEXP FUN), where REGEXP specifies what
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3657 output from the remote end to look for, and FUN specifies the action
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3658 to take when the regexp matches."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3659 nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3660
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3661 (defun tramp-open-connection-telnet (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3662 "Open a connection using a telnet METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3663 This starts the command `telnet HOST ARGS'[*], then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3664 login prompt, then sends the user name USER, then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3665 password prompt. It queries the user for the password, then sends the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3666 password to the remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3667
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3668 If USER is nil, uses value returned by `(user-login-name)' instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3669
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3670 Recognition of the remote shell prompt is based on the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3671 `shell-prompt-pattern' which must be set up correctly.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3672
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3673 Please note that it is NOT possible to use this connection method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3674 together with an out-of-band transfer method! You must use an inline
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3675 transfer method.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3676
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3677 Maybe the different regular expressions need to be tuned.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3678
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3679 * Actually, the telnet program as well as the args to be used can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3680 specified in the method parameters, see the variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3681 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3682 (when (tramp-method-out-of-band-p multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3683 (error "Cannot use out-of-band method `%s' with telnet connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3684 method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3685 (when multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3686 (error "Cannot multi-connect using telnet connection method"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3687 (tramp-pre-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3688 (tramp-message 7 "Opening connection for %s@%s using %s..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3689 (or user (user-login-name)) host method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3690 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3691 (setenv "TERM" tramp-terminal-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3692 (let* ((default-directory (tramp-temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3693 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3694 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3695 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3696 (p (apply 'start-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3697 (tramp-buffer-name multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3698 (tramp-get-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3699 (tramp-get-telnet-program multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3700 host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3701 (tramp-get-telnet-args multi-method method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3702 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3703 (pw nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3704 (process-kill-without-query p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3705 (tramp-message 9 "Waiting for login prompt...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3706 (unless (tramp-wait-for-regexp p nil tramp-login-prompt-regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3707 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3708 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3709 (error "Couldn't find remote login prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3710 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3711 ;; Remote login defaults to local one.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3712 (tramp-message 9 "Sending login name %s" (or user (user-login-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3713 (process-send-string p (concat (or user (user-login-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3714 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3715 (tramp-message 9 "Waiting for password prompt...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3716 (unless (setq found (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3717 p nil tramp-password-prompt-regexp))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3718 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3719 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3720 (error "Couldn't find remote password prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3721 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3722 (setq pw (tramp-read-passwd (car found)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3723 (tramp-message 9 "Sending password")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3724 (process-send-string p (concat pw tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3725 (tramp-message 9 "Waiting 30s for remote shell to come up...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3726 (unless (setq found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3727 (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3728 p 30 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3729 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3730 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3731 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3732 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3733 (error "Couldn't find remote shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3734 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3735 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3736 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3737 (error "Login failed: %s" (nth 1 found)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3738 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3739 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3740 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3741
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3742 ;; HHH: Changed to handle the case when USER is nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3743 (defun tramp-open-connection-rsh (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3744 "Open a connection using an rsh METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3745 This starts the command `rsh HOST -l USER'[*], then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3746 password or shell prompt. If a password prompt is seen, the user is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3747 queried for a password, this function sends the password to the remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3748 host and waits for a shell prompt.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3749
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3750 If USER is nil, start the command `rsh HOST'[*] instead
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3751
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3752 Recognition of the remote shell prompt is based on the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3753 `shell-prompt-pattern' which must be set up correctly.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3754
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3755 Please note that it is NOT possible to use this connection method with
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3756 an out-of-band transfer method if this function asks the user for a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3757 password! You must use an inline transfer method in this case.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3758 Sadly, the transfer method cannot be switched on the fly, instead you
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3759 must specify the right method in the file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3760
46010
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3761 Kludgy feature: if HOST has the form \"xx#yy\", then yy is assumed to
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3762 be a port number for ssh, and \"-p yy\" will be added to the list of
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3763 arguments, and xx will be used as the host name to connect to.
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3764
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3765 * Actually, the rsh program to be used can be specified in the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3766 method parameters, see the variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3767 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3768 (when multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3769 (error "Cannot multi-connect using rsh connection method"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3770 (tramp-pre-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3771 (if user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3772 (tramp-message 7 "Opening connection for %s@%s using %s..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3773 user host method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3774 (tramp-message 7 "Opening connection at %s using %s..." host method))
46010
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3775 (let ((process-environment (copy-sequence process-environment))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3776 (bufnam (tramp-buffer-name multi-method method user host))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3777 (buf (tramp-get-buffer multi-method method user host))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3778 (rsh-program (tramp-get-rsh-program multi-method method))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3779 (rsh-args (tramp-get-rsh-args multi-method method)))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3780 ;; The following should be changed. We need a more general
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3781 ;; mechanism to parse extra host args.
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3782 (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3783 (setq rsh-args (cons "-p" (cons (match-string 2 host) rsh-args)))
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3784 (setq host (match-string 1 host)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3785 (setenv "TERM" tramp-terminal-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3786 (let* ((default-directory (tramp-temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3787 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3788 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3789 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3790 (p (if user
46010
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3791 (apply #'start-process bufnam buf rsh-program
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3792 host "-l" user rsh-args)
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3793 (apply #'start-process bufnam buf rsh-program
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
3794 host rsh-args)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3795 (found nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3796 (process-kill-without-query p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3797 (tramp-message 9 "Waiting 60s for shell or passwd prompt from %s" host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3798 (setq found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3799 (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3800 p 60
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3801 (format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3802 "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3803 tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3804 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3805 (unless found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3806 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3807 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3808 (error "Couldn't find remote shell or passwd prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3809 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3810 (when (tramp-method-out-of-band-p multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3811 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3812 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3813 (error (concat "Out of band method `%s' not applicable"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3814 " for remote shell asking for a password")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3815 method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3816 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3817 (tramp-message 9 "Sending password...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3818 (tramp-enter-password p (nth 1 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3819 (tramp-message 9 "Sent password, waiting 60s for remote shell prompt")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3820 (setq found (tramp-wait-for-regexp p 60
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3821 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3822 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3823 shell-prompt-pattern))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3824 (unless found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3825 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3826 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3827 (error "Couldn't find remote shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3828 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3829 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3830 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3831 (error "Login failed: %s" (nth 1 found)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3832 (tramp-message 7 "Initializing remote shell")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3833 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3834 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3835 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3836
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3837 ;; HHH: Changed. Now utilizes (or user (user-login-name)) instead of USER.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3838 (defun tramp-open-connection-su (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3839 "Open a connection using the `su' program with METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3840 This starts `su - USER', then waits for a password prompt. The HOST
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3841 name must be equal to the local host name or to `localhost'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3842
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3843 If USER is nil, uses value returned by user-login-name instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3844
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3845 Recognition of the remote shell prompt is based on the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3846 `shell-prompt-pattern' which must be set up correctly. Note that the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3847 other user may have a different shell prompt than you do, so it is not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3848 at all unlikely that this variable is set up wrongly!"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3849 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3850 (when (tramp-method-out-of-band-p multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3851 (error "Cannot use out-of-band method `%s' with `su' connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3852 method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3853 (unless (or (string-match (concat "^" (regexp-quote host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3854 (system-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3855 (string= "localhost" host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3856 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3857 "Cannot connect to different host `%s' with `su' connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3858 host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3859 (when (not user)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3860 (error "Must give user name for `su' connection method"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3861 (tramp-pre-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3862 (tramp-message 7 "Opening connection for `%s' using `%s'..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3863 (or user (user-login-name)) method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3864 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3865 (setenv "TERM" tramp-terminal-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3866 (let* ((default-directory (tramp-temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3867 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3868 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3869 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3870 (p (apply 'start-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3871 (tramp-buffer-name multi-method method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3872 user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3873 (tramp-get-buffer multi-method method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3874 user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3875 (tramp-get-su-program multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3876 (mapcar
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3877 '(lambda (x)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3878 (format-spec x `((?u ,user))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3879 (tramp-get-su-args multi-method method))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3880 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3881 (pw nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3882 (process-kill-without-query p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3883 (tramp-message 9 "Waiting 30s for shell or password prompt...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3884 (unless (setq found (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3885 p 30
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3886 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3887 tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3888 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3889 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3890 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3891 (error "Couldn't find shell or password prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3892 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3893 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3894 (setq pw (tramp-read-passwd (car found)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3895 (tramp-message 9 "Sending password")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3896 (process-send-string p (concat pw tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3897 (tramp-message 9 "Waiting 30s for remote shell to come up...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3898 (unless (setq found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3899 (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3900 p 30 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3901 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3902 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3903 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3904 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3905 (error "Couldn't find remote shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3906 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3907 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3908 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3909 (error "`su' failed: %s" (nth 1 found))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3910 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3911 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3912 (tramp-post-connection multi-method method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3913 user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3914
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3915 ;; HHH: Not Changed. Multi method. It is not clear to me how this can
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3916 ;; handle not giving a user name in the "file name".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3917 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3918 ;; This is more difficult than for the single-hop method. In the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3919 ;; multi-hop-method, the desired behaviour should be that the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3920 ;; user must specify names for the telnet hops of which the user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3921 ;; name is different than the "original" name (or different from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3922 ;; the previous hop.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3923 (defun tramp-open-connection-multi (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3924 "Open a multi-hop connection using METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3925 This uses a slightly changed file name syntax. The idea is to say
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3926 [multi/telnet:u1@h1/rsh:u2@h2]/path/to/file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3927 This will use telnet to log in as u1 to h1, then use rsh from there to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3928 log in as u2 to h2."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3929 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3930 (unless multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3931 (error "Multi-hop open connection function called on non-multi method"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3932 (when (tramp-method-out-of-band-p multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3933 (error "No out of band multi-hop connections"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3934 (unless (and (arrayp method) (not (stringp method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3935 (error "METHOD must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3936 (unless (and (arrayp user) (not (stringp user)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3937 (error "USER must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3938 (unless (and (arrayp host) (not (stringp host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3939 (error "HOST must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3940 (unless (and (= (length method) (length user))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3941 (= (length method) (length host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3942 (error "Arrays METHOD, USER, HOST must have equal length"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3943 (tramp-pre-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3944 (tramp-message 7 "Opening `%s' connection..." multi-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3945 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3946 (setenv "TERM" tramp-terminal-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3947 (let* ((default-directory (tramp-temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3948 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3949 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3950 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3951 (p (start-process (tramp-buffer-name multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3952 (tramp-get-buffer multi-method method user host)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3953 tramp-multi-sh-program))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3954 (num-hops (length method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3955 (i 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3956 (process-kill-without-query p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3957 (tramp-message 9 "Waiting 60s for local shell to come up...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3958 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3959 p 60 (format "%s\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3960 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3961 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3962 (error "Couldn't find local shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3963 ;; Now do all the connections as specified.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3964 (while (< i num-hops)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3965 (let* ((m (aref method i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3966 (u (aref user i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3967 (h (aref host i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3968 (entry (assoc m tramp-multi-connection-function-alist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3969 (multi-func (nth 1 entry))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3970 (command (nth 2 entry)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3971 ;; The multi-funcs don't need to do save-match-data, as that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3972 ;; is done here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3973 (funcall multi-func p m u h command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3974 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3975 (incf i)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3976 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3977 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3978 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3979
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3980 ;; HHH: Changed. Multi method. Don't know how to handle this in the case
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3981 ;; of no user name provided. Hack to make it work as it did before:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3982 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3983 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3984 (defun tramp-multi-connect-telnet (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3985 "Issue `telnet' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3986 Uses shell COMMAND to issue a `telnet' command to log in as USER to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3987 HOST. You can use percent escapes in COMMAND: `%h' is replaced with
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3988 the host name, and `%n' is replaced with an end of line character, as
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3989 set in `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3990 character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3991
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3992 If USER is nil, uses the return value of (user-login-name) instead."
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3993 (let ((cmd (format-spec command `((?h ,host) (?n ,tramp-rsh-end-of-line))))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3994 (cmd1 (format-spec command `((?h ,host) (?n ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3995 found pw)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3996 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3997 (tramp-message 9 "Sending telnet command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3998 (process-send-string p cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3999 (tramp-message 9 "Waiting 30s for login prompt from %s" host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4000 (unless (tramp-wait-for-regexp p 30 tramp-login-prompt-regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4001 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4002 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4003 (error "Couldn't find login prompt from host %s" host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4004 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4005 (tramp-message 9 "Sending login name %s" (or user (user-login-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4006 (process-send-string p (concat (or user (user-login-name)) tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4007 (tramp-message 9 "Waiting for password prompt")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4008 (unless (setq found (tramp-wait-for-regexp p nil tramp-password-prompt-regexp))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4009 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4010 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4011 (error "Couldn't find password prompt from host %s" host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4012 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4013 (setq pw (tramp-read-passwd
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4014 (format "Password for %s@%s, %s" (or user (user-login-name)) host found)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4015 (tramp-message 9 "Sending password")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4016 (process-send-string p (concat pw tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4017 (tramp-message 9 "Waiting 60s for remote shell to come up...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4018 (unless (setq found (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4019 p 60 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4020 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4021 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4022 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4023 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4024 (error "Couldn't find shell prompt from host %s" host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4025 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4026 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4027 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4028 (error "Login to %s failed: %s" (nth 2 found)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4029
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4030 ;; HHH: Changed. Multi method. Don't know how to handle this in the case
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4031 ;; of no user name provided. Hack to make it work as it did before:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4032 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4033 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4034 (defun tramp-multi-connect-rlogin (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4035 "Issue `rlogin' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4036 Uses shell COMMAND to issue an `rlogin' command to log in as USER to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4037 HOST. You can use percent escapes in COMMAND. `%u' will be replaced
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4038 with the user name, `%h' will be replaced with the host name, and `%n'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4039 will be replaced with the value of `tramp-rsh-end-of-line'. You can use
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4040 `%%' if you want to use a literal percent character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4041
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4042 If USER is nil, uses the return value of (user-login-name) instead."
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4043 (let ((cmd (format-spec command `((?h ,host)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4044 (?u ,(or user (user-login-name)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4045 (?n ,tramp-rsh-end-of-line))))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4046 (cmd1 (format-spec command `((?h ,host)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4047 (?u ,(or user (user-login-name)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4048 (?n ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4049 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4050 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4051 (tramp-message 9 "Sending rlogin command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4052 (process-send-string p cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4053 (tramp-message 9 "Waiting 60s for shell or passwd prompt from %s" host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4054 (unless (setq found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4055 (tramp-wait-for-regexp p 60
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4056 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4057 tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4058 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4059 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4060 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4061 (error "Couldn't find remote shell or passwd prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4062 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4063 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4064 (tramp-message 9 "Sending password...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4065 (tramp-enter-password p (nth 1 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4066 (tramp-message 9 "Sent password, waiting 60s for remote shell prompt")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4067 (setq found (tramp-wait-for-regexp p 60
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4068 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4069 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4070 shell-prompt-pattern))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4071 (unless found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4072 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4073 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4074 (error "Couldn't find remote shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4075 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4076 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4077 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4078 (error "Login failed: %s" (nth 1 found)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4079
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4080 ;; HHH: Changed. Multi method. Don't know how to handle this in the case
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4081 ;; of no user name provided. Hack to make it work as it did before:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4082 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4083 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4084 (defun tramp-multi-connect-su (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4085 "Issue `su' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4086 Uses shell COMMAND to issue a `su' command to log in as USER on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4087 HOST. The HOST name is ignored, this just changes the user id on the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4088 host currently logged in to.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4089
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4090 If USER is nil, uses the return value of (user-login-name) instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4091
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4092 You can use percent escapes in the COMMAND. `%u' is replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4093 user name, and `%n' is replaced with the value of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4094 `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4095 character."
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4096 (let ((cmd (format-spec command `((?u ,(or user (user-login-name)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4097 (?n ,tramp-rsh-end-of-line))))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4098 (cmd1 (format-spec command `((?u ,(or user (user-login-name)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4099 (?n ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4100 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4101 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4102 (tramp-message 9 "Sending su command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4103 (process-send-string p cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4104 (tramp-message 9 "Waiting 60s for shell or passwd prompt for %s" (or user (user-login-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4105 (unless (setq found (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4106 p 60 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4107 tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4108 shell-prompt-pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4109 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4110 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4111 (error "Couldn't find shell or passwd prompt for %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4112 (or user (user-login-name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4113 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4114 (tramp-message 9 "Sending password...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4115 (tramp-enter-password p (nth 1 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4116 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4117 (tramp-message 9 "Sent password, waiting 60s for remote shell prompt")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4118 (setq found (tramp-wait-for-regexp p 60
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4119 (format "\\(%s\\)\\|\\(%s\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4120 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4121 shell-prompt-pattern))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4122 (unless found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4123 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4124 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4125 (error "Couldn't find remote shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4126 (when (nth 1 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4127 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4128 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4129 (error "Login failed: %s" (nth 1 found)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4130
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4131 ;; Utility functions.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4132
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4133 (defun tramp-wait-for-regexp (proc timeout regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4134 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4135 Expects the output of PROC to be sent to the current buffer. Returns
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4136 the string that matched, or nil. Waits indefinitely if TIMEOUT is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4137 nil."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4138 (let ((found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4139 (start-time (current-time)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4140 (cond (timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4141 ;; Work around a bug in XEmacs 21, where the timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4142 ;; expires faster than it should. This degenerates
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4143 ;; to polling for buggy XEmacsen, but oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4144 (while (and (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4145 (< (tramp-time-diff (current-time) start-time)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4146 timeout))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4147 (with-timeout (timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4148 (while (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4149 (accept-process-output proc 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4150 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4151 (setq found (when (re-search-forward regexp nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4152 (tramp-match-string-list)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4153 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4154 (while (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4155 (accept-process-output proc 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4156 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4157 (setq found (when (re-search-forward regexp nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4158 (tramp-match-string-list))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4159 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4160 (append-to-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4161 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4162 tramp-current-user tramp-current-host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4163 (point-min) (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4164 (when (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4165 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4166 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4167 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4168 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4169 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4170 (insert "[[Regexp `" regexp "' not found"
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
4171 (if timeout (format " in %d secs" timeout) "")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4172 "]]"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4173 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4174
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4175 (defun tramp-enter-password (p prompt)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4176 "Prompt for a password and send it to the remote end.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4177 Uses PROMPT as a prompt and sends the password to process P."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4178 (let ((pw (tramp-read-passwd prompt)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4179 (process-send-string p (concat pw tramp-rsh-end-of-line))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4180
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4181 ;; HHH: Not Changed. This might handle the case where USER is not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4182 ;; given in the "File name" very poorly. Then, the local
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4183 ;; variable tramp-current user will be set to nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4184 (defun tramp-pre-connection (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4185 "Do some setup before actually logging in.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4186 METHOD, USER and HOST specify the connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4187 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4188 (set (make-local-variable 'tramp-current-multi-method) multi-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4189 (set (make-local-variable 'tramp-current-method) method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4190 (set (make-local-variable 'tramp-current-user) user)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4191 (set (make-local-variable 'tramp-current-host) host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4192 (set (make-local-variable 'inhibit-eol-conversion) nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4193 (erase-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4194
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4195 (defun tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4196 (p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4197 "Set up an interactive shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4198 Mainly sets the prompt and the echo correctly. P is the shell process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4199 to set up. METHOD, USER and HOST specify the connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4200 ;; Wait a bit in case the remote end feels like sending a little
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4201 ;; junk first. It seems that fencepost.gnu.org does this when doing
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4202 ;; a Kerberos login.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4203 (sit-for 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4204 (tramp-discard-garbage-erase-buffer p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4205 (process-send-string nil (format "exec %s%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4206 (tramp-get-remote-sh multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4207 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4208 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4209 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4210 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4211 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4212 (tramp-insert-with-face
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4213 'bold (format "$ exec %s\n" (tramp-get-remote-sh multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4214 (tramp-message 9 "Waiting 30s for remote `%s' to come up..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4215 (tramp-get-remote-sh multi-method method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4216 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4217 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4218 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4219 (error "Remote `%s' didn't come up. See buffer `%s' for details"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4220 (tramp-get-remote-sh multi-method method) (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4221 (tramp-message 9 "Setting up remote shell environment")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4222 (tramp-discard-garbage-erase-buffer p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4223 (process-send-string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4224 nil (format "stty -inlcr -echo kill '^U'%s" tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4225 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4226 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4227 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4228 (error "Couldn't `stty -echo', see buffer `%s'" (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4229 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4230 (process-send-string nil (format "TERM=dumb; export TERM%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4231 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4232 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4233 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4234 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4235 (error "Couldn't `TERM=dumb; export TERM', see buffer `%s'" (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4236 ;; Try to set up the coding system correctly.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4237 ;; CCC this can't be the right way to do it. Hm.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4238 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4239 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4240 (tramp-message 9 "Determining coding system")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4241 (process-send-string nil (format "echo foo ; echo bar %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4242 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4243 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4244 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4245 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4246 (error "Couldn't `echo foo; echo bar' to determine line endings'"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4247 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4248 (if (featurep 'mule)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4249 ;; Use MULE to select the right EOL convention for communicating
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4250 ;; with the process.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4251 (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4252 cs-decode cs-encode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4253 (when (symbolp cs) (setq cs (cons cs cs)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4254 (setq cs-decode (car cs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4255 (setq cs-encode (cdr cs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4256 (unless cs-decode (setq cs-decode 'undecided))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4257 (unless cs-encode (setq cs-encode 'undecided))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4258 (setq cs-encode (tramp-coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4259 cs-encode 'unix))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4260 (when (search-forward "\r" nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4261 (setq cs-decode (tramp-coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4262 cs-decode 'dos)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4263 (set-buffer-process-coding-system cs-decode cs-encode))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4264 ;; Look for ^M and do something useful if found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4265 (when (search-forward "\r" nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4266 ;; We have found a ^M but cannot frob the process coding system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4267 ;; because we're running on a non-MULE Emacs. Let's try
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4268 ;; stty, instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4269 (tramp-message 9 "Trying `stty -onlcr'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4270 (process-send-string nil (format "stty -onlcr%s" tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4271 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4272 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4273 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4274 (error "Couldn't `stty -onlcr', see buffer `%s'" (buffer-name))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4275 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4276 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4277 9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4278 (process-send-string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4279 nil (format "HISTFILE=$HOME/.tramp_history; HISTSIZE=1%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4280 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4281 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4282 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4283 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4284 (error (concat "Couldn't `HISTFILE=$HOME/.tramp_history; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4285 "HISTSIZE=1', see buffer `%s'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4286 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4287 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4288 (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4289 (process-send-string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4290 nil (format "set +o vi +o emacs%s" ;mustn't `>/dev/null' with AIX?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4291 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4292 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4293 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4294 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4295 (error "Couldn't `set +o vi +o emacs', see buffer `%s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4296 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4297 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4298 (tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4299 (process-send-string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4300 nil (format "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4301 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4302 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4303 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4304 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4305 (error "Couldn't `unset MAIL MAILCHECK MAILPATH', see buffer `%s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4306 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4307 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4308 (tramp-message 9 "Waiting 30s for `unset CDPATH'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4309 (process-send-string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4310 nil (format "unset CDPATH%s" tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4311 (unless (tramp-wait-for-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4312 p 30 (format "\\(\\$ *\\|%s\\)\\'" shell-prompt-pattern))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4313 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4314 (error "Couldn't `unset CDPATH', see buffer `%s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4315 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4316 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4317 (tramp-message 9 "Setting shell prompt")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4318 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4319 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4320 (format "PS1='%s%s%s'; PS2=''; PS3=''"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4321 tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4322 tramp-end-of-output
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4323 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4324 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4325 (tramp-send-command multi-method method user host "echo hello")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4326 (tramp-message 9 "Waiting for remote `%s' to come up..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4327 (tramp-get-remote-sh multi-method method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4328 (unless (tramp-wait-for-output 5)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4329 (unless (tramp-wait-for-output 5)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4330 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4331 (error "Couldn't set remote shell prompt. See buffer `%s' for details"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4332 (buffer-name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4333 (tramp-message 7 "Waiting for remote `%s' to come up...done"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4334 (tramp-get-remote-sh multi-method method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4335
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4336 (defun tramp-post-connection (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4337 "Prepare a remote shell before being able to work on it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4338 METHOD, USER and HOST specify the connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4339 Among other things, this finds a shell which groks tilde expansion,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4340 tries to find an `ls' command which groks the `-n' option, sets the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4341 locale to C and sets up the remote shell search path."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4342 ;; Search for a good shell before searching for a command which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4343 ;; checks if a file exists. This is done because Tramp wants to use
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4344 ;; "test foo; echo $?" to check if various conditions hold, and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4345 ;; there are buggy /bin/sh implementations which don't execute the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4346 ;; "echo $?" part if the "test" part has an error. In particular,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4347 ;; the Solaris /bin/sh is a problem. I'm betting that all systems
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4348 ;; with buggy /bin/sh implementations will have a working bash or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4349 ;; ksh. Whee...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4350 (tramp-find-shell multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4351 (tramp-find-file-exists-command multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4352 (sit-for 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4353 ;; Without (sit-for 0.1) at least, my machine will almost always blow
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4354 ;; up on 'not numberp /root' - a race that causes the 'echo ~root'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4355 ;; output of (tramp-find-shell) to show up along with the output of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4356 ;; (tramp-find-ls-command) testing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4357 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4358 ;; I can't work out why this is a problem though. The (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4359 ;; call in (tramp-find-shell) *should* make this not happen, I thought.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4360 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4361 ;; After much debugging I couldn't find any problem with the implementation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4362 ;; of that function though. The workaround stays for me at least. :/
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4363 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4364 ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4365 (make-local-variable 'tramp-ls-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4366 (setq tramp-ls-command (tramp-find-ls-command multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4367 (unless tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4368 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4369 1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4370 "Danger! Couldn't find ls which groks -n. Muddling through anyway")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4371 (setq tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4372 (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4373 "ls" tramp-remote-path nil)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4374 (unless tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4375 (error "Fatal error: Couldn't find remote executable `ls'"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4376 (tramp-message 5 "Using remote command `%s' for getting directory listings"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4377 tramp-ls-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4378 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4379 (concat "tramp_set_exit_status () {" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4380 "return $1" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4381 "}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4382 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4383 ;; Set remote PATH variable.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4384 (tramp-set-remote-path multi-method method user host "PATH" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4385 ;; Tell remote shell to use standard time format, needed for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4386 ;; parsing `ls -l' output.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4387 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4388 "LC_TIME=C; export LC_TIME; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4389 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4390 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4391 "mesg n; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4392 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4393 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4394 "biff n ; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4395 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4396 ;; Unalias ls(1) to work around issues with those silly people who make it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4397 ;; spit out ANSI escapes or whatever.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4398 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4399 "unalias ls; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4400 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4401 ;; Does `test A -nt B' work? Use abominable `find' construct if it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4402 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4403 ;; for otherwise the shell crashes.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4404 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4405 (make-local-variable 'tramp-test-groks-nt)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4406 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4407 "( test / -nt / )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4408 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4409 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4410 (setq tramp-test-groks-nt
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4411 (looking-at (format "\n%s\n" (regexp-quote tramp-end-of-output))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4412 (unless tramp-test-groks-nt
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4413 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4414 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4415 (concat "tramp_test_nt () {" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4416 "test -n \"`find $1 -prune -newer $2 -print`\"" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4417 "}")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4418 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4419 ;; Find a `perl'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4420 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4421 (let ((tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4422 (or (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4423 "perl5" tramp-remote-path nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4424 (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4425 "perl" tramp-remote-path nil))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4426 (when tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4427 (tramp-set-connection-property "perl" tramp-remote-perl multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4428 ;; Set up stat in Perl if we can.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4429 (when tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4430 (tramp-message 5 "Sending the Perl `file-attributes' implementation.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4431 (tramp-send-linewise
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4432 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4433 (concat "tramp_file_attributes () {\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4434 tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4435 " -e '" tramp-perl-file-attributes "' $1 2>/dev/null\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4436 "}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4437 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4438 (when (string= (tramp-get-encoding-command multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4439 "tramp_mimencode")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4440 (tramp-message 5 "Sending the Perl `mime-encode' implementation.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4441 (tramp-send-linewise
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4442 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4443 (concat "tramp_mimencode () {\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4444 (if (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4445 "mimencode" tramp-remote-path t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4446 "mimencode -b $1"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4447 (concat tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4448 " -e '" tramp-perl-mime-encode "' $1 2>/dev/null"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4449 "\n}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4450 (tramp-wait-for-output))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4451 (when (string= (tramp-get-decoding-command multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4452 "tramp_mimedecode")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4453 (tramp-message 5 "Sending the Perl `mime-decode' implementation.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4454 (tramp-send-linewise
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4455 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4456 (concat "tramp_mimedecode () {\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4457 (if (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4458 "mimencode" tramp-remote-path t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4459 "mimencode -u -b $1"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4460 (concat tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4461 " -e '" tramp-perl-mime-decode "' $1 2>/dev/null"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4462 "\n}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4463 (tramp-wait-for-output)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4464 ;; Find ln(1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4465 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4466 (let ((ln (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4467 "ln" tramp-remote-path nil)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4468 (when ln
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4469 (tramp-set-connection-property "ln" ln multi-method method user host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4470 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4471 ;; If encoding/decoding command are given, test to see if they work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4472 ;; CCC: Maybe it would be useful to run the encoder both locally and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4473 ;; remotely to see if they produce the same result.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4474 (let ((decoding (tramp-get-decoding-command multi-method method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4475 (encoding (tramp-get-encoding-command multi-method method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4476 (magic-string "xyzzy"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4477 (when (and (or decoding encoding) (not (and decoding encoding)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4478 (tramp-kill-process multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4479 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4480 "Must give both decoding and encoding command in method definition"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4481 (when (and decoding encoding)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4482 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4483 5
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4484 "Checking to see if encoding/decoding commands work on remote host...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4485 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4486 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4487 (format "echo %s | %s | %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4488 (tramp-shell-quote-argument magic-string) encoding decoding))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4489 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4490 (unless (looking-at (regexp-quote magic-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4491 (tramp-kill-process multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4492 (error "Remote host cannot execute de/encoding commands. See buffer `%s' for details"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4493 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4494 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4495 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4496 5 "Checking to see if encoding/decoding commands work on remote host...done"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4497
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4498
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4499 (defun tramp-maybe-open-connection (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4500 "Maybe open a connection to HOST, logging in as USER, using METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4501 Does not do anything if a connection is already open, but re-opens the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4502 connection if a previous connection has died for some reason."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4503 (let ((p (get-buffer-process (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4504 (unless (and p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4505 (processp p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4506 (memq (process-status p) '(run open)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4507 (when (and p (processp p))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4508 (delete-process p))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4509 (funcall (tramp-get-connection-function multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4510 multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4511
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4512 (defun tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4513 (multi-method method user host command &optional noerase)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4514 "Send the COMMAND to USER at HOST (logged in using METHOD).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4515 Erases temporary buffer before sending the command (unless NOERASE
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4516 is true)."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4517 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4518 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4519 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4520 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4521 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4522 (tramp-insert-with-face 'bold (format "$ %s\n" command))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4523 (let ((proc nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4524 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4525 (unless noerase (erase-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4526 (setq proc (get-buffer-process (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4527 (process-send-string proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4528 (concat command tramp-rsh-end-of-line))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4529
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4530 ;; It seems that Tru64 Unix does not like it if long strings are sent
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4531 ;; to it in one go. (This happens when sending the Perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4532 ;; `file-attributes' implementation, for instance.) Therefore, we
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4533 ;; have this function which waits a bit at each line.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4534 (defun tramp-send-linewise
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4535 (multi-method method user host string &optional noerase)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4536 "Send the STRING to USER at HOST linewise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4537 Erases temporary buffer before sending the STRING (unless NOERASE
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4538 is true).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4539
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4540 The STRING is expected to use Unix line-endings, but the lines sent to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4541 the remote host use line-endings as defined in the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4542 `tramp-rsh-end-of-line'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4543 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4544 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4545 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4546 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4547 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4548 (tramp-insert-with-face 'bold (format "$ %s\n" string))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4549 (let ((proc nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4550 (lines (split-string string "\n")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4551 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4552 (unless noerase (erase-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4553 (setq proc (get-buffer-process (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4554 (mapcar (lambda (x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4555 (sleep-for 0.1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4556 (process-send-string proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4557 (concat x tramp-rsh-end-of-line)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4558 lines)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4559
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4560 (defun tramp-wait-for-output (&optional timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4561 "Wait for output from remote rsh command."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4562 (let ((proc (get-buffer-process (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4563 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4564 (start-time (current-time))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4565 (end-of-output (concat "^"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4566 (regexp-quote tramp-end-of-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4567 "$")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4568 ;; Algorithm: get waiting output. See if last line contains
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4569 ;; end-of-output sentinel. If not, wait a bit and again get
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4570 ;; waiting output. Repeat until timeout expires or end-of-output
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4571 ;; sentinel is seen. Will hang if timeout is nil and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4572 ;; end-of-output sentinel never appears.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4573 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4574 (cond (timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4575 ;; Work around an XEmacs bug, where the timeout expires
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4576 ;; faster than it should. This degenerates into polling
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4577 ;; for buggy XEmacsen, but oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4578 (while (and (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4579 (< (tramp-time-diff (current-time) start-time)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4580 timeout))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4581 (with-timeout (timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4582 (while (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4583 (accept-process-output proc 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4584 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4585 (forward-line -1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4586 (setq found (looking-at end-of-output))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4587 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4588 (while (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4589 (accept-process-output proc 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4590 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4591 (forward-line -1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4592 (setq found (looking-at end-of-output))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4593 ;; At this point, either the timeout has expired or we have found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4594 ;; the end-of-output sentinel.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4595 (when found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4596 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4597 (forward-line -2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4598 (delete-region (point) (point-max)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4599 ;; Add output to debug buffer if appropriate.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4600 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4601 (append-to-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4602 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4603 tramp-current-user tramp-current-host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4604 (point-min) (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4605 (when (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4606 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4607 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4608 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4609 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4610 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4611 (insert "[[Remote prompt `" end-of-output "' not found"
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
4612 (if timeout (format " in %d secs" timeout) "")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4613 "]]"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4614 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4615 ;; Return value is whether end-of-output sentinel was found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4616 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4617
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4618 (defun tramp-match-string-list (&optional string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4619 "Returns list of all match strings.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4620 That is, (list (match-string 0) (match-string 1) ...), according to the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4621 number of matches."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4622 (let* ((nmatches (/ (length (match-data)) 2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4623 (i (- nmatches 1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4624 (res nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4625 (while (>= i 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4626 (setq res (cons (match-string i string) res))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4627 (setq i (- i 1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4628 res))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4629
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4630 (defun tramp-send-command-and-check (multi-method method user host command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4631 &optional subshell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4632 "Run COMMAND and check its exit status.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4633 MULTI-METHOD and METHOD specify how to log in (as USER) to the remote HOST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4634 Sends `echo $?' along with the COMMAND for checking the exit status. If
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4635 COMMAND is nil, just sends `echo $?'. Returns the exit status found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4636
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4637 If the optional argument SUBSHELL is non-nil, the command is executed in
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4638 a subshell, ie surrounded by parentheses."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4639 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4640 (concat (if subshell "( " "")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4641 command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4642 (if command " 2>/dev/null; " "")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4643 "echo tramp_exit_status $?"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4644 (if subshell " )" " ")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4645 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4646 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4647 (unless (search-backward "tramp_exit_status " nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4648 (error "Couldn't find exit status of `%s'" command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4649 (skip-chars-forward "^ ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4650 (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4651
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4652 (defun tramp-barf-unless-okay (multi-method method user host command subshell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4653 signal fmt &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4654 "Run COMMAND, check exit status, throw error if exit status not okay.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4655 Similar to `tramp-send-command-and-check' but accepts two more arguments
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4656 FMT and ARGS which are passed to `error'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4657 (unless (zerop (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4658 multi-method method user host command subshell))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4659 ;; CCC: really pop-to-buffer? Maybe it's appropriate to be more
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4660 ;; silent.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4661 (pop-to-buffer (current-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4662 (funcall 'signal signal (apply 'format fmt args))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4663
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4664 (defun tramp-send-region (multi-method method user host start end)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4665 "Send the region from START to END to remote command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4666 running as USER on HOST using METHOD."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4667 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4668 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4669 (unless proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4670 (error "Can't send region to remote host -- not logged in"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4671 (process-send-region proc start end)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4672 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4673 (append-to-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4674 (tramp-get-debug-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4675 start end))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4676
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4677 (defun tramp-send-eof (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4678 "Send EOF to the remote end.
46151
eff75835ac2e (tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 46060
diff changeset
4679 METHOD, HOST and USER specify the connection."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4680 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4681 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4682 (unless proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4683 (error "Can't send EOF to remote host -- not logged in"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4684 (process-send-eof proc)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4685 ; (process-send-string proc "\^D")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4686
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4687 (defun tramp-kill-process (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4688 "Kill the connection process used by Tramp.
46151
eff75835ac2e (tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 46060
diff changeset
4689 MULTI-METHOD, METHOD, USER, and HOST specify the connection."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4690 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4691 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4692 (kill-process proc)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4693
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4694 (defun tramp-discard-garbage-erase-buffer (p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4695 "Erase buffer, then discard subsequent garbage.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4696 If `tramp-discard-garbage' is nil, just erase buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4697 (if (not tramp-discard-garbage)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4698 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4699 (while (prog1 (erase-buffer) (accept-process-output p 0.25))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4700 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4701 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4702 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4703 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4704 (tramp-insert-with-face
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4705 'bold (format "Additional characters detected\n")))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4706
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4707 (defun tramp-mode-string-to-int (mode-string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4708 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4709 (let* ((mode-chars (string-to-vector mode-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4710 (owner-read (aref mode-chars 1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4711 (owner-write (aref mode-chars 2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4712 (owner-execute-or-setid (aref mode-chars 3))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4713 (group-read (aref mode-chars 4))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4714 (group-write (aref mode-chars 5))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4715 (group-execute-or-setid (aref mode-chars 6))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4716 (other-read (aref mode-chars 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4717 (other-write (aref mode-chars 8))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4718 (other-execute-or-sticky (aref mode-chars 9)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4719 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4720 (logior
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4721 (case owner-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4722 (?r (tramp-octal-to-decimal "00400")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4723 (t (error "Second char `%c' must be one of `r-'" owner-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4724 (case owner-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4725 (?w (tramp-octal-to-decimal "00200")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4726 (t (error "Third char `%c' must be one of `w-'" owner-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4727 (case owner-execute-or-setid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4728 (?x (tramp-octal-to-decimal "00100"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4729 (?S (tramp-octal-to-decimal "04000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4730 (?s (tramp-octal-to-decimal "04100"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4731 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4732 (t (error "Fourth char `%c' must be one of `xsS-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4733 owner-execute-or-setid)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4734 (case group-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4735 (?r (tramp-octal-to-decimal "00040")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4736 (t (error "Fifth char `%c' must be one of `r-'" group-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4737 (case group-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4738 (?w (tramp-octal-to-decimal "00020")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4739 (t (error "Sixth char `%c' must be one of `w-'" group-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4740 (case group-execute-or-setid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4741 (?x (tramp-octal-to-decimal "00010"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4742 (?S (tramp-octal-to-decimal "02000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4743 (?s (tramp-octal-to-decimal "02010"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4744 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4745 (t (error "Seventh char `%c' must be one of `xsS-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4746 group-execute-or-setid)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4747 (case other-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4748 (?r (tramp-octal-to-decimal "00004")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4749 (t (error "Eighth char `%c' must be one of `r-'" other-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4750 (case other-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4751 (?w (tramp-octal-to-decimal "00002")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4752 (t (error "Nineth char `%c' must be one of `w-'" other-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4753 (case other-execute-or-sticky
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4754 (?x (tramp-octal-to-decimal "00001"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4755 (?T (tramp-octal-to-decimal "01000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4756 (?t (tramp-octal-to-decimal "01001"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4757 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4758 (t (error "Tenth char `%c' must be one of `xtT-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4759 other-execute-or-sticky)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4760
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4761
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4762 (defun tramp-file-mode-from-int (mode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4763 "Turn an integer representing a file mode into an ls(1)-like string."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4764 (let ((type (cdr (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4765 (user (logand (lsh mode -6) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4766 (group (logand (lsh mode -3) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4767 (other (logand (lsh mode -0) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4768 (suid (> (logand (lsh mode -9) 4) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4769 (sgid (> (logand (lsh mode -9) 2) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4770 (sticky (> (logand (lsh mode -9) 1) 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4771 (setq user (tramp-file-mode-permissions user suid "s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4772 (setq group (tramp-file-mode-permissions group sgid "s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4773 (setq other (tramp-file-mode-permissions other sticky "t"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4774 (concat type user group other)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4775
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4776
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4777 (defun tramp-file-mode-permissions (perm suid suid-text)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4778 "Convert a permission bitset into a string.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4779 This is used internally by `tramp-file-mode-from-int'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4780 (let ((r (> (logand perm 4) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4781 (w (> (logand perm 2) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4782 (x (> (logand perm 1) 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4783 (concat (or (and r "r") "-")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4784 (or (and w "w") "-")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4785 (or (and suid x suid-text) ; suid, execute
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4786 (and suid (upcase suid-text)) ; suid, !execute
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4787 (and x "x") "-")))) ; !suid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4788
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4789
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4790 (defun tramp-decimal-to-octal (i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4791 "Return a string consisting of the octal digits of I.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4792 Not actually used. Use `(format \"%o\" i)' instead?"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4793 (cond ((< i 0) (error "Cannot convert negative number to octal"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4794 ((not (integerp i)) (error "Cannot convert non-integer to octal"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4795 ((zerop i) "0")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4796 (t (concat (tramp-decimal-to-octal (/ i 8))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4797 (number-to-string (% i 8))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4798
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4799
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4800 ;;(defun tramp-octal-to-decimal (ostr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4801 ;; "Given a string of octal digits, return a decimal number."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4802 ;; (cond ((null ostr) 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4803 ;; ((string= "" ostr) 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4804 ;; (t (let ((last (aref ostr (1- (length ostr))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4805 ;; (rest (substring ostr 0 (1- (length ostr)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4806 ;; (unless (and (>= last ?0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4807 ;; (<= last ?7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4808 ;; (error "Not an octal digit: %c" last))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4809 ;; (+ (- last ?0) (* 8 (tramp-octal-to-decimal rest)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4810 ;; Kudos to Gerd Moellmann for this suggestion.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4811 (defun tramp-octal-to-decimal (ostr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4812 "Given a string of octal digits, return a decimal number."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4813 (let ((x (or ostr "")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4814 ;; `save-match' is in `tramp-mode-string-to-int' which calls this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4815 (unless (string-match "\\`[0-7]*\\'" x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4816 (error "Non-octal junk in string `%s'" x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4817 (string-to-number ostr 8)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4818
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4819 (defun tramp-shell-case-fold (string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4820 "Converts STRING to shell glob pattern which ignores case."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4821 (mapconcat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4822 (lambda (c)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4823 (if (equal (downcase c) (upcase c))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4824 (vector c)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4825 (format "[%c%c]" (downcase c) (upcase c))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4826 string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4827 ""))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4828
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4829
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4830 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4831 ;; -- TRAMP file names --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4832 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4833 ;; Conversion functions between external representation and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4834 ;; internal data structure. Convenience functions for internal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4835 ;; data structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4836
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4837 (defstruct tramp-file-name multi-method method user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4838
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4839 (defun tramp-tramp-file-p (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4840 "Return t iff NAME is a tramp file."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4841 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4842 (string-match tramp-file-name-regexp name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4843
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4844 ;; HHH: Changed. Used to assign the return value of (user-login-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4845 ;; to the `user' part of the structure if a user name was not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4846 ;; provided, now it assigns nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4847 (defun tramp-dissect-file-name (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4848 "Return an `tramp-file-name' structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4849 The structure consists of remote method, remote user, remote host and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4850 remote path name."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4851 (let (method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4852 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4853 (unless (string-match (nth 0 tramp-file-name-structure) name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4854 (error "Not a tramp file name: %s" name))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4855 (setq method (match-string (nth 1 tramp-file-name-structure) name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4856 (if (and method (member method tramp-multi-methods))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4857 ;; If it's a multi method, the file name structure contains
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4858 ;; arrays of method, user and host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4859 (tramp-dissect-multi-file-name name)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4860 ;; Normal method. First, find out default method.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4861 (let ((user (match-string (nth 2 tramp-file-name-structure) name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4862 (host (match-string (nth 3 tramp-file-name-structure) name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4863 (path (match-string (nth 4 tramp-file-name-structure) name)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4864 (when (not method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4865 (setq method (tramp-find-default-method user host)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4866 (make-tramp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4867 :multi-method nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4868 :method method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4869 :user (or user nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4870 :host host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4871 :path path))))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4872
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4873 (defun tramp-find-default-method (user host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4874 "Look up the right method to use in `tramp-default-method-alist'."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4875 (let ((choices tramp-default-method-alist)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4876 (method tramp-default-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4877 item)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4878 (while choices
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4879 (setq item (pop choices))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4880 (when (and (string-match (nth 0 item) host)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4881 (string-match (nth 1 item) (or user "")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4882 (setq method (nth 2 item))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4883 (setq choices nil)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4884 method))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4885
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4886 ;; HHH: Not Changed. Multi method. Will probably not handle the case where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4887 ;; a user name is not provided in the "file name" very well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4888 (defun tramp-dissect-multi-file-name (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4889 "Not implemented yet."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4890 (let ((regexp (nth 0 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4891 (method-index (nth 1 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4892 (hops-index (nth 2 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4893 (path-index (nth 3 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4894 (hop-regexp (nth 0 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4895 (hop-method-index (nth 1 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4896 (hop-user-index (nth 2 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4897 (hop-host-index (nth 3 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4898 method hops len hop-methods hop-users hop-hosts path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4899 (unless (string-match (format regexp hop-regexp) name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4900 (error "Not a multi tramp file name: %s" name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4901 (setq method (match-string method-index name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4902 (setq hops (match-string hops-index name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4903 (setq len (/ (length (match-data t)) 2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4904 (when (< path-index 0) (incf path-index len))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4905 (setq path (match-string path-index name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4906 (let ((index 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4907 (while (string-match hop-regexp hops index)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4908 (setq index (match-end 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4909 (setq hop-methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4910 (cons (match-string hop-method-index hops) hop-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4911 (setq hop-users
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4912 (cons (match-string hop-user-index hops) hop-users))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4913 (setq hop-hosts
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4914 (cons (match-string hop-host-index hops) hop-hosts))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4915 (make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4916 :multi-method method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4917 :method (apply 'vector (reverse hop-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4918 :user (apply 'vector (reverse hop-users))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4919 :host (apply 'vector (reverse hop-hosts))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4920 :path path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4921
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4922 (defun tramp-make-tramp-file-name (multi-method method user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4923 "Constructs a tramp file name from METHOD, USER, HOST and PATH."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4924 (unless tramp-make-tramp-file-format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4925 (error "`tramp-make-tramp-file-format' is nil"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4926 (if multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4927 (tramp-make-tramp-multi-file-name multi-method method user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4928 (if user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4929 (format-spec tramp-make-tramp-file-format
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4930 `((?m ,method) (?u ,user) (?h ,host) (?p ,path)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4931 (format-spec tramp-make-tramp-file-user-nil-format
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4932 `((?m ,method) (?h ,host) (?p ,path))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4933
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4934 ;; CCC: Henrik Holm: Not Changed. Multi Method. What should be done
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4935 ;; with this when USER is nil?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4936 (defun tramp-make-tramp-multi-file-name (multi-method method user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4937 "Constructs a tramp file name for a multi-hop method."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4938 (unless tramp-make-multi-tramp-file-format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4939 (error "`tramp-make-multi-tramp-file-format' is nil"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4940 (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4941 (hop-format (nth 1 tramp-make-multi-tramp-file-format))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4942 (path-format (nth 2 tramp-make-multi-tramp-file-format))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4943 (prefix (format-spec prefix-format `((?m ,multi-method))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4944 (hops "")
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4945 (path (format-spec path-format `((?p ,path))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4946 (i 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4947 (len (length method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4948 (while (< i len)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4949 (let ((m (aref method i)) (u (aref user i)) (h (aref host i)))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4950 (setq hops (concat hops (format-spec hop-format
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
4951 `((?m ,m) (?u ,u) (?h ,h)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4952 (incf i)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4953 (concat prefix hops path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4954
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4955 (defun tramp-make-rcp-program-file-name (user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4956 "Create a file name suitable to be passed to `rcp'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4957 (if user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4958 (format "%s@%s:%s" user host path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4959 (format "%s:%s" host path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4960
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4961 (defun tramp-make-ange-ftp-file-name (user host path)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4962 "Given user, host, and path, return an Ange-FTP filename."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4963 (if user
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4964 (format "/%s@%s:%s" user host path)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4965 (format "/%s:%s" host path)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4966
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4967 (defun tramp-method-out-of-band-p (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4968 "Return t if this is an out-of-band method, nil otherwise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4969 It is important to check for this condition, since it is not possible
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4970 to enter a password for the `tramp-rcp-program'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4971 (tramp-get-rcp-program multi-method method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4972
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4973 ;; Variables local to connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4974
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4975 (defun tramp-get-ls-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4976 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4977 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4978 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4979 tramp-ls-command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4980
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4981 (defun tramp-get-test-groks-nt (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4982 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4983 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4984 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4985 tramp-test-groks-nt))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4986
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4987 (defun tramp-get-file-exists-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4988 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4989 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4990 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4991 tramp-file-exists-command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4992
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4993 (defun tramp-get-remote-perl (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4994 (tramp-get-connection-property "perl" nil multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4995
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4996 (defun tramp-get-remote-ln (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4997 (tramp-get-connection-property "ln" nil multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4998
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4999 ;; Get a property of a TRAMP connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5000 (defun tramp-get-connection-property (property default multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5001 "Get the named property for the connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5002 If the value is not set for the connection, return `default'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5003 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5004 (with-current-buffer (tramp-get-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5005 (let (error)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5006 (condition-case nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5007 (symbol-value (intern (concat "tramp-connection-property-" property)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5008 (error default)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5009
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5010 ;; Set a property of a TRAMP connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5011 (defun tramp-set-connection-property (property value multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5012 "Set the named property of a TRAMP connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5013 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5014 (with-current-buffer (tramp-get-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5015 (set (make-local-variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5016 (intern (concat "tramp-connection-property-" property)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5017 value)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5018
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5019
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5020
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5021 (defun tramp-get-connection-function (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5022 (second (or (assoc 'tramp-connection-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5023 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5024 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5025 (error "Method `%s' didn't specify a connection function"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5026 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5027
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5028 (defun tramp-get-remote-sh (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5029 (second (or (assoc 'tramp-remote-sh
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5030 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5031 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5032 (error "Method `%s' didn't specify a remote shell"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5033 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5034
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5035 (defun tramp-get-rsh-program (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5036 (second (or (assoc 'tramp-rsh-program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5037 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5038 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5039 (error "Method `%s' didn't specify an rsh program"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5040 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5041
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5042 (defun tramp-get-rsh-args (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5043 (second (or (assoc 'tramp-rsh-args
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5044 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5045 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5046 (error "Method `%s' didn't specify rsh args"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5047 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5048
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5049 (defun tramp-get-rcp-program (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5050 (second (or (assoc 'tramp-rcp-program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5051 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5052 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5053 (error "Method `%s' didn't specify an rcp program"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5054 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5055
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5056 (defun tramp-get-rcp-args (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5057 (second (or (assoc 'tramp-rcp-args
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5058 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5059 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5060 (error "Method `%s' didn't specify rcp args"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5061 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5062
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5063 (defun tramp-get-rcp-keep-date-arg (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5064 (second (or (assoc 'tramp-rcp-keep-date-arg
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5065 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5066 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5067 (error "Method `%s' didn't specify `keep-date' arg for tramp"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5068 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5069
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5070 (defun tramp-get-su-program (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5071 (second (or (assoc 'tramp-su-program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5072 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5073 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5074 (error "Method `%s' didn't specify a su program"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5075 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5076
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5077 (defun tramp-get-su-args (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5078 (second (or (assoc 'tramp-su-args
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5079 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5080 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5081 (error "Method `%s' didn't specify su args"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5082 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5083
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5084 (defun tramp-get-encoding-command (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5085 (second (or (assoc 'tramp-encoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5086 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5087 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5088 (error "Method `%s' didn't specify an encoding command"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5089 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5090
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5091 (defun tramp-get-decoding-command (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5092 (second (or (assoc 'tramp-decoding-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5093 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5094 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5095 (error "Method `%s' didn't specify a decoding command"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5096 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5097
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5098 (defun tramp-get-encoding-function (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5099 (second (or (assoc 'tramp-encoding-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5100 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5101 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5102 (error "Method `%s' didn't specify an encoding function"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5103 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5104
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5105 (defun tramp-get-decoding-function (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5106 (second (or (assoc 'tramp-decoding-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5107 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5108 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5109 (error "Method `%s' didn't specify a decoding function"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5110 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5111
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5112 (defun tramp-get-telnet-program (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5113 (second (or (assoc 'tramp-telnet-program
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5114 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5115 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5116 (error "Method `%s' didn't specify a telnet program"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5117 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5118
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5119 (defun tramp-get-telnet-args (multi-method method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5120 (second (or (assoc 'tramp-telnet-args
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5121 (assoc (or multi-method method tramp-default-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5122 tramp-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5123 (error "Method `%s' didn't specify telnet args"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5124 (or multi-method method)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5125
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5126 ;; Auto saving to a special directory.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5127
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5128 (defun tramp-make-auto-save-file-name (fn)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5129 "Returns a file name in `tramp-auto-save-directory' for autosaving this file."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5130 (when tramp-auto-save-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5131 (unless (file-exists-p tramp-auto-save-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5132 (make-directory tramp-auto-save-directory t)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5133 ;; jka-compr doesn't like auto-saving, so by appending "~" to the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5134 ;; file name we make sure that jka-compr isn't used for the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5135 ;; auto-save file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5136 (let ((buffer-file-name (expand-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5137 (tramp-subst-strs-in-string '(("_" . "|")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5138 ("/" . "_a")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5139 (":" . "_b")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5140 ("|" . "__")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5141 ("[" . "_l")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5142 ("]" . "_r"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5143 fn)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5144 tramp-auto-save-directory)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5145 (make-auto-save-file-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5146
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5147 (defadvice make-auto-save-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5148 (around tramp-advice-make-auto-save-file-name () activate)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5149 "Invoke `tramp-make-auto-save-file-name' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5150 (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5151 tramp-auto-save-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5152 (setq ad-return-value
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5153 (tramp-make-auto-save-file-name (buffer-file-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5154 ad-do-it))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5155
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5156 (defun tramp-subst-strs-in-string (alist string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5157 "Replace all occurrences of the string FROM with TO in STRING.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5158 ALIST is of the form ((FROM . TO) ...)."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5159 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5160 (while alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5161 (let* ((pr (car alist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5162 (from (car pr))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5163 (to (cdr pr)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5164 (while (string-match (regexp-quote from) string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5165 (setq string (replace-match to t t string)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5166 (setq alist (cdr alist))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5167 string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5168
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5169 (defun tramp-insert-with-face (face string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5170 "Insert text with a specific face."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5171 (let ((start (point)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5172 (insert string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5173 (add-text-properties start (point) (list 'face face))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5174
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5175 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5176 ;; -- Compatibility functions section --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5177 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5178
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5179 (defun tramp-temporary-file-directory ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5180 "Return name of directory for temporary files (compat function).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5181 For Emacs, this is the variable `temporary-file-directory', for XEmacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5182 this is the function `temp-directory'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5183 (cond ((boundp 'temporary-file-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5184 (symbol-value 'temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5185 ((fboundp 'temp-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5186 (funcall (symbol-function 'temp-directory))) ;pacify byte-compiler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5187 ((let ((d (getenv "TEMP"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5188 (file-name-as-directory (getenv "TEMP")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5189 ((let ((d (getenv "TMP"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5190 (file-name-as-directory (getenv "TMP")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5191 ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5192 (file-name-as-directory (getenv "TMPDIR")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5193 ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5194 (t (message (concat "Neither `temporary-file-directory' nor "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5195 "`temp-directory' is defined -- using /tmp."))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5196 (file-name-as-directory "/tmp"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5197
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5198 (defun tramp-read-passwd (prompt)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5199 "Read a password from user (compat function).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5200 Invokes `read-passwd' if that is defined, else `ange-ftp-read-passwd'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5201 (apply
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5202 (if (fboundp 'read-passwd) #'read-passwd #'ange-ftp-read-passwd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5203 (list prompt)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5204
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5205 (defun tramp-time-diff (t1 t2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5206 "Return the difference between the two times, in seconds.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5207 T1 and T2 are time values (as returned by `current-time' for example).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5208
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5209 NOTE: This function will fail if the time difference is too large to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5210 fit in an integer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5211 ;; Pacify byte-compiler with `symbol-function'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5212 (cond ((fboundp 'subtract-time)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5213 (cadr (funcall (symbol-function 'subtract-time) t1 t2)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5214 ((fboundp 'itimer-time-difference)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5215 (floor (funcall
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5216 (symbol-function 'itimer-time-difference)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5217 (if (< (length t1) 3) (append t1 '(0)) t1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5218 (if (< (length t2) 3) (append t2 '(0)) t2))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5219 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5220 ;; snarfed from Emacs 21 time-date.el
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5221 (cadr (let ((borrow (< (cadr t1) (cadr t2))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5222 (list (- (car t1) (car t2) (if borrow 1 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5223 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5224
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5225 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5226 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5227 EOL-TYPE can be one of `dos', `unix', or `mac'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5228 (cond ((fboundp 'coding-system-change-eol-conversion)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5229 (apply #'coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5230 (list coding-system eol-type)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5231 ((fboundp 'subsidiary-coding-system)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5232 (apply
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5233 #'subsidiary-coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5234 (list coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5235 (cond ((eq eol-type 'dos) 'crlf)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5236 ((eq eol-type 'unix) 'lf)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5237 ((eq eol-type 'mac) 'cr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5238 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5239 (error "Unknown EOL-TYPE `%s', must be %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5240 eol-type
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5241 "`dos', `unix', or `mac'"))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5242 (t (error "Can't change EOL conversion -- is MULE missing?"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5243
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5244 (defun tramp-split-string (string pattern)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5245 "Like `split-string' but omit empty strings.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5246 In Emacs, (split-string \"/foo/bar\" \"/\") returns (\"foo\" \"bar\").
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5247 This is, the first, empty, element is omitted. In XEmacs, the first
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5248 element is not omitted.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5249
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5250 Note: this function has been written for `tramp-handle-file-truename'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5251 If you want to use it for something else, you'll have to check whether
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5252 it does the right thing."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5253 (delete "" (split-string string pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5254
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5255 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5256 ;; -- Kludges section --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5257 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5258
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5259 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5260 ;; does not deal well with newline characters. Newline is replaced by
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5261 ;; backslash newline. But if, say, the string `a backslash newline b'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5262 ;; is passed to a shell, the shell will expand this into "ab",
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5263 ;; completely omitting the newline. This is not what was intended.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5264 ;; It does not appear to be possible to make the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5265 ;; `shell-quote-argument' work with newlines without making it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5266 ;; dependent on the shell used. But within this package, we know that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5267 ;; we will always use a Bourne-like shell, so we use an approach which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5268 ;; groks newlines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5269 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5270 ;; The approach is simple: we call `shell-quote-argument', then
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5271 ;; massage the newline part of the result.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5272 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5273 ;; This function should produce a string which is grokked by a Unix
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5274 ;; shell, even if the Emacs is running on Windows. Since this is the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5275 ;; kludges section, we bind `system-type' in such a way that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5276 ;; `shell-quote-arguments' behaves as if on Unix.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5277 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5278 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5279 ;; function to work with Bourne-like shells.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5280 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5281 ;; CCC: This function should be rewritten so that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5282 ;; `shell-quote-argument' is not used. This way, we are safe from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5283 ;; changes in `shell-quote-argument'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5284 (defun tramp-shell-quote-argument (s)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5285 "Similar to `shell-quote-argument', but groks newlines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5286 Only works for Bourne-like shells."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5287 (let ((system-type 'not-windows))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5288 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5289 (let ((result (shell-quote-argument s))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5290 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5291 (when (and (>= (length result) 2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5292 (string= (substring result 0 2) "\\~"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5293 (setq result (substring result 1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5294 (while (string-match nl result)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5295 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5296 t t result)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5297 result))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5298
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5299 ;; ;; EFS hooks itself into the file name handling stuff in more places
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5300 ;; ;; than just `file-name-handler-alist'. The following tells EFS to stay
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5301 ;; ;; away from tramp.el paths.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5302 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5303 ;; ;; This is needed because EFS installs (efs-dired-before-readin) into
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5304 ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5305 ;; ;; connection to help it's dired process. Not that I have any real
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5306 ;; ;; idea *why* this is helpful to dired.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5307 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5308 ;; ;; Anyway, this advice fixes the problem (with a sledgehammer :)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5309 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5310 ;; ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5311 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5312 ;; ;; CCC: when the other defadvice calls have disappeared, make sure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5313 ;; ;; not to call defadvice unless it's necessary. How do we find out whether
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5314 ;; ;; it is necessary? (featurep 'efs) is surely the wrong way --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5315 ;; ;; EFS might nicht be loaded yet.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5316 ;; (defadvice efs-ftp-path (around dont-match-tramp-path activate protect)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5317 ;; "Cause efs-ftp-path to fail when the path is a TRAMP path."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5318 ;; (if (tramp-tramp-file-p (ad-get-arg 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5319 ;; nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5320 ;; ad-do-it))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5321
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5322 ;; We currently use "[" and "]" in the filename format. In Emacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5323 ;; 20.x, this means that Emacs wants to expand wildcards if
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5324 ;; `find-file-wildcards' is non-nil, and then barfs because no
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5325 ;; expansion could be found. We detect this situation and do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5326 ;; something really awful: we have `file-expand-wildcards' return the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5327 ;; original filename if it can't expand anything. Let's just hope
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5328 ;; that this doesn't break anything else.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5329 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5330 ;; Another problem is that the check is done by Emacs version, which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5331 ;; is really not what we want to do. Oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5332
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5333 ;;(when (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5334 ;; (= emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5335 ;; It seems that this advice is needed in Emacs 21, too.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5336 (defadvice file-expand-wildcards (around tramp-fix activate)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5337 (let ((name (ad-get-arg 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5338 (if (tramp-tramp-file-p name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5339 ;; If it's a Tramp file, dissect it and look if wildcards
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5340 ;; need to be expanded at all.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5341 (let ((v (tramp-dissect-file-name name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5342 (if (string-match "[[*?]" (tramp-file-name-path v))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5343 (let ((res ad-do-it))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5344 (setq ad-return-value (or res (list name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5345 (setq ad-return-value (list name))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5346 ;; If it is not a Tramp file, just run the original function.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5347 (let ((res ad-do-it))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5348 (setq ad-return-value (or res (list name)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5349 ;; )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5350
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5351 ;; Make the `reporter` functionality available for making bug reports about
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5352 ;; the package. A most useful piece of code.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5353
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5354 (unless (fboundp 'reporter-submit-bug-report)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5355 (autoload 'reporter-submit-bug-report "reporter"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5356
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5357 (defun tramp-bug ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5358 "Submit a bug report to the TRAMP developers."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5359 (interactive)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5360 (require 'reporter)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5361 (let ((reporter-prompt-for-summary-p t))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5362 (reporter-submit-bug-report
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5363 tramp-bug-report-address ; to-address
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5364 (format "tramp (%s)" tramp-version) ; package name and version
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5365 `(;; Current state
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5366 tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5367 tramp-test-groks-nt
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5368 tramp-file-exists-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5369 tramp-current-multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5370 tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5371 tramp-current-user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5372 tramp-current-host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5373
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5374 ;; System defaults
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5375 tramp-auto-save-directory ; vars to dump
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5376 tramp-default-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5377 tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5378 tramp-remote-path
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5379 tramp-login-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5380 tramp-password-prompt-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5381 tramp-wrong-passwd-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5382 tramp-temp-name-prefix
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5383 tramp-file-name-structure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5384 tramp-file-name-regexp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5385 tramp-multi-file-name-structure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5386 tramp-multi-file-name-hop-structure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5387 tramp-multi-methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5388 tramp-multi-connection-function-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5389 tramp-make-tramp-file-format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5390 tramp-end-of-output
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5391
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5392 ;; Non-tramp variables of interest
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5393 shell-prompt-pattern
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5394 backup-by-copying
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5395 backup-by-copying-when-linked
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5396 backup-by-copying-when-mismatch
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5397 ,(when (boundp 'backup-by-copying-when-privileged-mismatch)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5398 'backup-by-copying-when-privileged-mismatch)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5399 file-name-handler-alist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5400 nil ; pre-hook
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5401 nil ; post-hook
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5402 "\
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5403 Enter your bug report in this message, including as much detail as you
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5404 possibly can about the problem, what you did to cause it and what the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5405 local and remote machines are.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5406
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5407 If you can give a simple set of instructions to make this bug happen
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5408 reliably, please include those. Thank you for helping kill bugs in
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5409 TRAMP.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5410 --bug report follows this line--")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5411
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5412 (defalias 'tramp-submit-bug 'tramp-bug)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5413
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5414 (provide 'tramp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5415
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5416 ;; Make sure that we get integration with the VC package.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5417 ;; When it is loaded, we need to pull in the integration module.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5418 ;; This must come after (provide 'tramp) because tramp-vc.el
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5419 ;; requires tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5420 (eval-after-load "vc"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5421 '(require 'tramp-vc))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5422
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5423 ;;; TODO:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5424
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5425 ;; * Revise the comments near the beginning of the file.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5426 ;; * Cooperate with PCL-CVS. It uses start-process, which doesn't
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5427 ;; work for remote files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5428 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5429 ;; `shell-quote-argument'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5430 ;; * Completion gets confused when you leave out the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5431 ;; * Support `dired-compress-file' filename handler.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5432 ;; * In Emacs 21, `insert-directory' shows total number of bytes used
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5433 ;; by the files in that directory. Add this here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5434 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5435 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5436 ;; * When logging in, keep looking for questions according to an alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5437 ;; and then invoke the right function.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5438 ;; * Case-insensitive filename completion. (Norbert Goevert.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5439 ;; * Running CVS remotely doesn't appear to work right. It thinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5440 ;; files are locked by somebody else even if I'm the locking user.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5441 ;; Sometimes, one gets `No CVSROOT specified' errors from CVS.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5442 ;; (Skip Montanaro)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5443 ;; * Don't use globbing for directories with many files, as this is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5444 ;; likely to produce long command lines, and some shells choke on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5445 ;; long command lines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5446 ;; * Find out about the new auto-save mechanism in Emacs 21 and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5447 ;; do the right thing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5448 ;; * `vc-directory' does not work. It never displays any files, even
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5449 ;; if it does show files when run locally.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5450 ;; * Allow correction of passwords, if the remote end allows this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5451 ;; (Mark Hershberger)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5452 ;; * Make sure permissions of tmp file are good.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5453 ;; (Nelson Minar <nelson@media.mit.edu>)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5454 ;; * Grok passwd prompts with scp? (David Winter
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5455 ;; <winter@nevis1.nevis.columbia.edu>). Maybe just do `ssh -l user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5456 ;; host', then wait a while for the passwd or passphrase prompt. If
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5457 ;; there is one, remember the passwd/phrase.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5458 ;; * How to deal with MULE in `insert-file-contents' and `write-region'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5459 ;; * Do asynchronous `shell-command's.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5460 ;; * Grok `append' parameter for `write-region'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5461 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5462 ;; * abbreviate-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5463 ;; * grok ~ in tramp-remote-path (Henrik Holm <henrikh@tele.ntnu.no>)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5464 ;; * `C' in dired gives error `not tramp file name'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5465 ;; * Also allow to omit user names when doing multi-hop. Not sure yet
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5466 ;; what the user names should default to, though.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5467 ;; * better error checking. At least whenever we see something
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5468 ;; strange when doing zerop, we should kill the process and start
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5469 ;; again. (Greg Stark)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5470 ;; * Add caching for filename completion. (Greg Stark)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5471 ;; Of course, this has issues with usability (stale cache bites)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5472 ;; -- <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5473 ;; * Provide a local cache of old versions of remote files for the rsync
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5474 ;; transfer method to use. (Greg Stark)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5475 ;; * Remove unneeded parameters from methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5476 ;; * Invoke rsync once for copying a whole directory hierarchy.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5477 ;; (Francesco Potort́)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5478 ;; * Should we set PATH ourselves or should we rely on the remote end
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5479 ;; to do it?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5480 ;; * Do the autoconf thing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5481 ;; * Make it work for XEmacs 20, which is missing `with-timeout'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5482 ;; * Allow non-Unix remote systems. (More a long-term thing.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5483 ;; * Make it work for different encodings, and for different file name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5484 ;; encodings, too. (Daniel Pittman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5485 ;; * Change applicable functions to pass a struct tramp-file-name rather
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5486 ;; than the individual items MULTI-METHOD, METHOD, USER, HOST, PATH.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5487 ;; * Implement asynchronous shell commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5488 ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5489 ;; * Progress reports while copying files. (Michael Kifer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5490 ;; * `Smart' connection method that uses inline for small and out of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5491 ;; band for large files. (Michael Kifer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5492 ;; * Don't search for perl5 and perl. Instead, only search for perl and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5493 ;; then look if it's the right version (with `perl -v').
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5494 ;; * When editing a remote CVS controlled file as a different user, VC
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5495 ;; gets confused about the file locking status. Try to find out why
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5496 ;; the workaround doesn't work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5497 ;; * When user is running ssh-agent, it would be useful to add the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5498 ;; passwords typed by the user to that agent. This way, the next time
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5499 ;; round, the users don't have to type all this in again.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5500 ;; This would be especially useful for start-process, I think.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5501 ;; An easy way to implement start-process is to open a second shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5502 ;; connection which is inconvenient if the user has to reenter
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5503 ;; passwords.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5504 ;; * Change `copy-file' to grok the case where the filename handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5505 ;; for the source and the target file are different. Right now,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5506 ;; it looks at the source file and then calls that handler, if
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5507 ;; there is one. But since ange-ftp, for instance, does not know
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5508 ;; about Tramp, it does not do the right thing if the target file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5509 ;; name is a Tramp name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5510
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5511 ;; Functions for file-name-handler-alist:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5512 ;; diff-latest-backup-file -- in diff.el
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5513 ;; dired-compress-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5514 ;; dired-uncache -- this will be needed when we do insert-directory caching
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5515 ;; file-name-as-directory -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5516 ;; file-name-directory -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5517 ;; file-name-nondirectory -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5518 ;; file-name-sans-versions -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5519 ;; file-newer-than-file-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5520 ;; find-backup-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5521 ;; get-file-buffer -- use primitive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5522 ;; load
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5523 ;; unhandled-file-name-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5524 ;; vc-registered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5525
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5526 ;;; tramp.el ends here