emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/man/tramp.texi,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/man/tramp.texi,v
Date: Sun, 08 Jul 2007 18:05:04 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/07/08 18:05:03

Index: tramp.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/man/tramp.texi,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- tramp.texi  28 May 2007 10:32:53 -0000      1.53
+++ tramp.texi  8 Jul 2007 18:05:03 -0000       1.54
@@ -18,15 +18,27 @@
 @include trampver.texi
 
 @c Macros for formatting a filename.
address@hidden trampfn is for a full filename, trampfnmhp means method, host, 
localname
address@hidden trampfn is for a full filename, trampfnmhl means method, host, 
localname
 @c were given, and so on.
address@hidden trampfn(method, user, host, localname)
address@hidden@address@hidden@@@address@hidden@value{localname}
address@hidden trampfn {method, user, host, localname}
address@hidden@value{postfixhop}\user\@@address@hidden
address@hidden macro
+
address@hidden trampfnmhl {method, host, localname}
address@hidden@address@hidden
address@hidden macro
+
address@hidden trampfnuhl {user, host, localname}
address@hidden@@address@hidden
address@hidden macro
+
address@hidden trampfnhl {host, localname}
address@hidden@value{postfix}\localname\
 @end macro
 
 @copying
-Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-Free Software Foundation, Inc.
+Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+2007 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -157,6 +169,7 @@
 
 * Version Control::             The inner workings of remote version control.
 * Files directories and localnames::  How file names, directories and 
localnames are mangled and managed.
+* Traces and Profiles::         How to Customize Traces.
 * Issues::                      Debatable Issues and What Was Decided.
 
 * GNU Free Documentation License:: The license for this documentation.
@@ -178,11 +191,17 @@
 * Connection types::            Types of connections made to remote machines.
 * Inline methods::              Inline methods.
 * External transfer methods::   External transfer methods.
-* Multi-hop Methods::           Connecting to a remote host using multiple 
hops.
address@hidden emacsgw
+* Gateway methods::             Gateway methods.
address@hidden ifset
 * Default Method::              Selecting a default method.
+* Default User::                Selecting a default user.
+* Default Host::                Selecting a default host.
+* Multi-hops::                  Connecting to a remote host using multiple 
hops.
 * Customizing Methods::         Using Non-Standard Methods.
 * Customizing Completion::      Selecting config files for user/host name 
completion.
 * Password caching::            Reusing passwords for several connections.
+* Connection caching::          Reusing connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on 
the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Windows setup hints::         Issues with Cygwin ssh.
@@ -191,10 +210,9 @@
 Using @value{tramp}
 
 * Filename Syntax::             @value{tramp} filename conventions.
-* Multi-hop filename syntax::   Multi-hop filename conventions.
+* Alternative Syntax::          URL-like filename syntax.
 * Filename completion::         Filename completion.
-* Dired::                       Dired.
-* Compilation::                 Compile remote files.
+* Remote processes::            Integration with other @value{emacsname} 
packages (@sc{experimental}).
 
 The inner workings of remote version control
 
@@ -220,10 +238,10 @@
 @chapter An overview of @value{tramp}
 @cindex overview
 
-After the installation of @value{tramp} into your @value{emacsname},
-you will be able to access files on remote machines as though they
-were local.  Access to the remote file system for editing files,
-version control, and @code{dired} are transparently enabled.
+After the installation of @value{tramp} into your @value{emacsname}, you
+will be able to access files on remote machines as though they were
+local.  Access to the remote file system for editing files, version
+control, and @code{dired} are transparently enabled.
 
 Your access to the remote machine can be with the @command{rsh},
 @command{rlogin}, @command{telnet} programs or with any similar
@@ -429,6 +447,11 @@
 ] @strong{autoconf}
 @end example
 
+People who have no direct CVS access (maybe because sitting behind a
+blocking firewall), can try the
address@hidden://savannah.gnu.org/cvs-backup/tramp-sources.tar.gz, Nightly
+CVS Tree Tarball} instead of.
+
 
 @node History
 @chapter History of @value{tramp}
@@ -445,7 +468,19 @@
 
 The most recent addition of major features were the multi-hop methods
 added in April 2000 and the unification of @value{tramp} and Ange-FTP
-filenames in July 2002.
+filenames in July 2002.  In July 2004, multi-hop methods have been
+replaced by proxy hosts.  Running commands on remote hosts was
+introduced in December 2005.
address@hidden emacsgw
+Support of gateways exists since April 2007.
address@hidden ifset
+
+In December 2001, @value{tramp} has been added to the XEmacs package
+repository.  Being part of the GNU Emacs repository happened in June
+2002, the first release including @value{tramp} was GNU Emacs 22.1.
+
address@hidden is also a GNU/Linux Debian package since February 2001.
+
 
 @c Installation chapter is necessary only in case of standalone
 @c installation.  Text taken from trampinst.texi.
@@ -462,7 +497,7 @@
 installed.  It is initially configured to use the @command{scp}
 program to connect to the remote host.  So in the easiest case, you
 just type @kbd{C-x C-f} and then enter the filename
address@hidden@address@hidden@@@address@hidden@var{/path/to.file}}.
address@hidden@trampfnuhl{user, machine, /path/to.file}}.
 
 On some hosts, there are problems with opening a connection.  These are
 related to the behavior of the remote shell.  See @xref{Remote shell
@@ -482,14 +517,20 @@
 * Connection types::            Types of connections made to remote machines.
 * Inline methods::              Inline methods.
 * External transfer methods::   External transfer methods.
-* Multi-hop Methods::           Connecting to a remote host using multiple 
hops.
address@hidden emacsgw
+* Gateway methods::             Gateway methods.
address@hidden ifset
 * Default Method::              Selecting a default method.
                                   Here we also try to help those who
                                   don't have the foggiest which method
                                   is right for them.
+* Default User::                Selecting a default user.
+* Default Host::                Selecting a default host.
+* Multi-hops::                  Connecting to a remote host using multiple 
hops.
 * Customizing Methods::         Using Non-Standard Methods.
 * Customizing Completion::      Selecting config files for user/host name 
completion.
 * Password caching::            Reusing passwords for several connections.
+* Connection caching::          Reusing connection related information.
 * Remote Programs::             How @value{tramp} finds and uses programs on 
the remote machine.
 * Remote shell setup::          Remote shell setup hints.
 * Windows setup hints::         Issues with Cygwin ssh.
@@ -539,16 +580,10 @@
 
 External transfer methods should be configured such a way that they
 don't require a password (with @command{ssh-agent}, or such alike).
-If it isn't possible, you should consider @ref{Password caching},
-otherwise you will be prompted for a password every copy action.
-
address@hidden multi-hop methods
address@hidden methods, multi-hop
-A variant of the inline methods are the @dfn{multi-hop methods}.
-These methods allow you to connect a remote host using a number `hops',
-each of which connects to a different host.  This is useful if you are
-in a secured network where you need to go through a bastion host to
-connect to the outside world.
+Modern @command{scp} implementations offer options to reuse existing
address@hidden connections, see method @command{scpc}.  If it isn't
+possible, you should consider @ref{Password caching}, otherwise you
+will be prompted for a password every copy action.
 
 
 @node Inline methods
@@ -635,6 +670,8 @@
 
 This method does not connect to a remote host at all, rather it uses
 the @command{su} program to allow you to edit files as another user.
+With other words, a specified host name in the file name is silently
+ignored.
 
 
 @item @option{sudo}
@@ -682,7 +719,7 @@
 
 @item @option{krlogin}
 @cindex method krlogin
address@hidden km krlogin
address@hidden krlogin method
 @cindex Kerberos (with krlogin method)
 
 This method is also similar to @option{ssh}.  It only uses the
@@ -697,18 +734,43 @@
 implementation of SSH.  It uses @samp{plink -ssh} to log in to the
 remote host.
 
-Additionally, the method @option{plink1} is provided, which calls
address@hidden -1 -ssh} in order to use SSH protocol version 1
-explicitly.
+This supports the @samp{-P} kludge.
+
+Additionally, the methods @option{plink1} and @option{plink2} are
+provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in
+order to use SSH protocol version 1 or 2 explicitly.
 
 CCC: Do we have to connect to the remote host once from the command
 line to accept the SSH key?  Maybe this can be made automatic?
 
-CCC: Does @command{plink} support the @samp{-p} option?  @value{tramp} will
-support that, anyway.
+CCC: Say something about the first shell command failing.  This might
+be due to a wrong setting of @code{tramp-rsh-end-of-line}.
 
address@hidden table
 
address@hidden @option{plinkx}
address@hidden method plinkx
address@hidden plinkx method
+
+Another method using PuTTY on Windows.  Instead of host names, it
+expects PuTTY session names, calling @samp{plink -load @var{session}
+-t"}.  User names are relevant only in case the corresponding session
+hasn't defined a user name.  Different port numbers must be defined in
+the session.
+
+
address@hidden @option{fish}
address@hidden method fish
address@hidden fish method
+
+This is an experimental implementation of the fish protocol, known from
+the GNU Midnight Commander or the KDE Konqueror.  @value{tramp} expects
+the fish server implementation from the KDE kioslave.  That means, the
+file @file{~/.fishsrv.pl} is expected to reside on the remote host.
+
+The implementation lacks good performance.  The code is offered anyway,
+maybe somebody can improve the performance.
+
address@hidden table
 
 
 @node External transfer methods
@@ -725,21 +787,10 @@
 This saves the overhead of encoding and decoding that multiplexing the
 transfer through the one connection has with the inline methods.
 
-If you want to use an external transfer method you should be able to
-execute the transfer utility to copy files to and from the remote
-machine without any interaction.
-
address@hidden ssh-agent
-This means that you will need to use @command{ssh-agent} if you use the
address@hidden program for transfers, or maybe your version of
address@hidden accepts a password on the command address@hidden's
address@hidden allows you to specify the password on the command line.}
-If you use @command{rsync} via @command{ssh} then the same rule must
-apply to that connection.
-
-If you cannot get an external method to run without asking for a
-password you should consider @ref{Password caching}.
-
+Since external transfer methods need their own overhead opening a new
+channel, all files which are smaller than @var{tramp-copy-size-limit}
+are still transferred with the corresponding inline method.  It should
+provide a fair trade-off between both approaches.
 
 @table @asis
 @item @option{rcp}  ---  @command{rsh} and @command{rcp}
@@ -787,7 +838,24 @@
 All the @command{ssh} based methods support the kludgy @samp{-p}
 feature where you can specify a port number to connect to in the host
 name.  For example, the host name @file{host#42} tells @value{tramp} to
-specify @samp{-p 42} in the argument list for @command{ssh}.
+specify @samp{-p 42} in the argument list for @command{ssh}, and to
+specify @samp{-P 42} in the argument list for @command{scp}.
+
+
address@hidden @option{sftp}  ---  @command{ssh} and @command{sftp}
address@hidden method sftp
address@hidden sftp method
address@hidden sftp (with sftp method)
address@hidden ssh (with sftp method)
+
+That is mostly the same method as @option{scp}, but using
address@hidden as transfer command.  So the same remarks are valid.
+
+This command does not work like @value{ftppackagename}, where
address@hidden is called interactively, and all commands are send from
+within this session.  Instead of, @command{ssh} is used for login.
+
+This method supports the @samp{-p} hack.
 
 
 @item @option{rsync}  ---  @command{ssh} and @command{rsync}
@@ -866,7 +934,22 @@
 @command{pscp} for transferring the files.  These programs are part
 of PuTTY, an SSH implementation for Windows.
 
-CCC: Does @command{plink} support the @samp{-p} hack?
+This method supports the @samp{-P} hack.
+
+
address@hidden @option{psftp} --- @command{plink} and @command{psftp}
address@hidden method psftp
address@hidden psftp method
address@hidden psftp (with psftp method)
address@hidden plink (with psftp method)
address@hidden PuTTY (with psftp method)
+
+As you would expect, this method is similar to @option{sftp}, but it
+uses the @command{plink} command to connect to the remote host, and it
+uses @command{psftp} for transferring the files.  These programs are
+part of PuTTY, an SSH implementation for Windows.
+
+This method supports the @samp{-P} hack.
 
 
 @item @option{fcp} --- @command{fsh} and @command{fcp}
@@ -935,8 +1018,15 @@
 name, then a percent sign, then the domain name).  So, to connect to
 the machine @code{melancholia} as user @code{daniel} of the domain
 @code{BIZARRE}, and edit @file{.emacs} in the home directory (share
address@hidden) I would specify the filename
address@hidden@address@hidden@@address@hidden/daniel$$/.emacs}.
address@hidden) I would specify the filename @address@hidden,
+daniel%BIZARRE, melancholia, /daniel$$/.emacs}}.
+
+Depending on the Windows domain configuration, a Windows user might be
+considered as domain user per default.  In order to connect as local
+user, the WINS name of that machine must be given as domain name.
+Usually, it is the machine name in capital letters.  In the example
+above, the local user @code{daniel} would be specified as
address@hidden@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}.
 
 The domain name as well as the user name are optional.  If no user
 name is specified at all, the anonymous user (without password
@@ -953,97 +1043,56 @@
 
 @end table
 
address@hidden Multi-hop Methods
address@hidden Connecting to a remote host using multiple hops
address@hidden multi-hop methods
address@hidden methods, multi-hop
 
-Sometimes, the methods described before are not sufficient.  Sometimes,
-it is not possible to connect to a remote host using a simple command.
-For example, if you are in a secured network, you might have to log in
-to a `bastion host' first before you can connect to the outside world.
-Of course, the target host may also require a bastion host.  The format
-of multi-hop filenames is slightly different than the format of normal
address@hidden methods.
-
address@hidden method multi
address@hidden multi method
-A multi-hop file name specifies a method, a number of hops, and a
-localname (path name on the remote system).  The method name is always
address@hidden
-
-Each hop consists of a @dfn{hop method} specification, a user name and
-a host name.  The hop method can be an inline method only.  The
-following hop methods are (currently) available:
-
address@hidden @option
address@hidden telnet
address@hidden hop method telnet
address@hidden telnet hop method
-
-Uses the well-known @command{telnet} program to connect to the host.
-Whereas user name and host name are supplied in the file name, the
-user is queried for the password.
-
address@hidden rsh
address@hidden hop method rsh
address@hidden rsh hop method
-
-This uses @command{rsh} to connect to the host.  You do not need to
-enter a password unless @command{rsh} explicitly asks for it.
-
-The variant @option{remsh} uses the @command{remsh} command.  It
-should be applied on machines where @command{remsh} is used instead of
address@hidden
-
address@hidden ssh
address@hidden hop method ssh
address@hidden ssh hop method
-
-This uses @command{ssh} to connect to the host.  You might have to enter
-a password or a pass phrase.
-
address@hidden su
address@hidden hop method su
address@hidden su hop method
-
-This method does not actually contact a different host, but it allows
-you to become a different user on the host you're currently on.  This
-might be useful if you want to edit files as root, but the remote host
-does not allow remote root logins.  In this case you can use
address@hidden, @option{rsh} or @option{ssh} to connect to the
-remote host as a non-root user, then use an @option{su} hop to become
-root.  But @option{su} need not be the last hop in a sequence, you could
-also use it somewhere in the middle, if the need arises.
-
-Even though you @emph{must} specify both user and host with an
address@hidden hop, the host name is ignored and only the user name is
-used.
-
address@hidden sudo
address@hidden hop method sudo
address@hidden sudo hop method
address@hidden emacsgw
address@hidden Gateway methods
address@hidden Gateway methods
address@hidden methods, gateway
address@hidden gateway methods
+
+Gateway methods are not methods to access a remote host directly.
+These methods are intended to pass firewalls or proxy servers.
+Therefore, they can be used for proxy host declarations
+(@pxref{Multi-hops}) only.
+
+A gateway method must come always along with a method who supports
+port setting (referred to as @samp{-p} kludge).  This is because
address@hidden targets the accompanied method to
address@hidden, from where the firewall or proxy server
+is accessed to.
+
+Gateway methods support user name and password declarations.  These
+are used to authenticate towards the corresponding firewall or proxy
+server.  They can be passed only if your friendly administrator has
+granted your access.
+
address@hidden @asis
address@hidden @option{tunnel}
address@hidden method tunnel
address@hidden tunnel method
 
-This is similar to the @option{su} hop, except that it uses
address@hidden rather than @command{su} to become a different user.
+This method implements an HTTP tunnel via the @command{CONNECT}
+command (see RFC 2616, 2817).  Any HTTP 1.1 compliant (proxy) server
+shall support this command.
 
address@hidden table
+As authentication method, only @option{Basic Authentication} (see RFC
+2617) is implemented so far.  If no port number is given in the
+declaration, port @option{8080} is used for the proxy server.
 
-Some people might wish to use port forwarding with @command{ssh} or
-maybe they have to use a nonstandard port.  This can be accomplished
-by putting a stanza in @file{~/.ssh/config} for the account which
-specifies a different port number for a certain host name.  But it can
-also be accomplished within @value{tramp}, by adding a multi-hop method.
-For example:
 
address@hidden
-(add-to-list
- 'tramp-multi-connection-function-alist
- '("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n"))
address@hidden lisp
address@hidden @option{socks}
address@hidden method socks
address@hidden socks method
+
+The @command{socks} method provides access to SOCKSv5 servers (see
+RFC 1928).  @option{Username/Password Authentication} according to RFC
+1929 is supported.
+
+The default port number of the socks server is @option{1080}, if not
+specified otherwise.
 
-Now you can use an @option{sshf} hop which connects to port 4400 instead of
-the standard port.
address@hidden table
address@hidden ifset
 
 
 @node Default Method
@@ -1085,7 +1134,6 @@
 
 @xref{Inline methods}.
 @xref{External transfer methods}.
address@hidden Methods}.
 
 Another consideration with the selection of transfer methods is the
 environment you will use them in and, especially when used over the
@@ -1119,9 +1167,9 @@
 
 I guess that these days, most people can access a remote machine by
 using @command{ssh}.  So I suggest that you use the @option{ssh}
-method.  So, type @kbd{C-x C-f
address@hidden@value{postfixsinglehop}root@@address@hidden/etc/motd
address@hidden to edit the @file{/etc/motd} file on the other host.
+method.  So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost,
+/etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other
+host.
 
 If you can't use @option{ssh} to log in to the remote host, then
 select a method that uses a program that works.  For instance, Windows
@@ -1132,9 +1180,9 @@
 For the special case of editing files on the local host as another
 user, see the @option{su} or @option{sudo} methods.  They offer
 shortened syntax for the @samp{root} account, like
address@hidden@address@hidden@value{postfix}/etc/motd}.
address@hidden@trampfnmhl{su, , /etc/motd}}.
 
-People who edit large files may want to consider @option{scp} instead
+People who edit large files may want to consider @option{scpc} instead
 of @option{ssh}, or @option{pscp} instead of @option{plink}.  These
 out-of-band methods are faster than inline methods for large files.
 Note, however, that out-of-band methods suffer from some limitations.
@@ -1143,6 +1191,205 @@
 methods are fast enough.
 
 
address@hidden Default User
address@hidden Selecting a default user
address@hidden default user
+
+The user part of a @value{tramp} file name can be omitted.  Usually,
+it is replaced by the user name you are logged in.  Often, this is not
+what you want.  A typical use of @value{tramp} might be to edit some
+files with root permissions on the local host.  This case, you should
+set the variable @code{tramp-default-user} to reflect that choice.
+For example:
+
address@hidden
+(setq tramp-default-user "root")
address@hidden lisp
+
address@hidden is regarded as obsolete, and will be removed
+soon.
+
address@hidden tramp-default-user-alist
+You can also specify different users for certain method/host
+combinations, via the variable @code{tramp-default-user-alist}.  For
+example, if you always have to use the user @samp{john} in the domain
address@hidden, you can specify the following:
+
address@hidden
+(add-to-list 'tramp-default-user-alist
+             '("ssh" ".*\\.somewhere\\.else\\'" "john"))
address@hidden lisp
+
address@hidden
+See the documentation for the variable
address@hidden for more details.
+
+One trap to fall in must be known.  If @value{tramp} finds a default
+user, this user will be passed always to the connection command as
+parameter (for example @samp{ssh here.somewhere.else -l john}.  If you
+have specified another user for your command in its configuration
+files, @value{tramp} cannot know it, and the remote access will fail.
+If you have specified in the given example in @file{~/.ssh/config} the
+lines
+
address@hidden
+Host here.somewhere.else
+     User lily
address@hidden example
+
address@hidden
+than you must discard selecting a default user by @value{tramp}.  This
+will be done by setting it to @code{nil} (or @samp{lily}, likewise):
+
address@hidden
+(add-to-list 'tramp-default-user-alist
+             '("ssh" "\\`here\\.somewhere\\.else\\'" nil))
address@hidden lisp
+
+The last entry in @code{tramp-default-user-alist} could be your
+default user you'll apply predominantly.  You shall @emph{append} it
+to that list at the end:
+
address@hidden
+(add-to-list 'tramp-default-user-alist '(nil nil "jonas") t)
address@hidden lisp
+
+
address@hidden Default Host
address@hidden Selecting a default host
address@hidden default host
+
address@hidden tramp-default-host
+Finally, it is even possible to omit the host name part of a
address@hidden file name.  This case, the value of the variable
address@hidden is used.  Per default, it is initialized
+with the host name your local @value{emacsname} is running.
+
+If you, for example, use @value{tramp} mainly to contact the host
address@hidden as user @samp{john}, you can specify:
+
address@hidden
+(setq tramp-default-user "john"
+      tramp-default-host "target")
address@hidden lisp
+
+Then the simple file name @address@hidden,,}} will connect you
+to John's home directory on target.
address@hidden emacs
+Note, however, that the most simplification @address@hidden,,}}
+won't work, because @samp{/:} is the prefix for quoted file names.
address@hidden ifset
+
+
address@hidden Multi-hops
address@hidden Connecting to a remote host using multiple hops
address@hidden multi-hop
address@hidden proxy hosts
+
+Sometimes, the methods described before are not sufficient.  Sometimes,
+it is not possible to connect to a remote host using a simple command.
+For example, if you are in a secured network, you might have to log in
+to a `bastion host' first before you can connect to the outside world.
+Of course, the target host may also require a bastion host.
+
address@hidden tramp-default-proxies-alist
+In order to specify such multiple hops, it is possible to define a proxy
+host to pass through, via the variable
address@hidden  This variable keeps a list of
+triples (@var{host} @var{user} @var{proxy}).
+
+ The first matching item specifies the proxy host to be passed for a
+file name located on a remote target matching @var{user}@@@var{host}.
address@hidden and @var{user} are regular expressions or @code{nil}, which
+is interpreted as a regular expression which always matches.
+
address@hidden must be a Tramp filename which localname part is ignored.
+Method and user name on @var{proxy} are optional, which is interpreted
+with the default values.
address@hidden emacsgw
+The method must be an inline or gateway method (@pxref{Inline
+methods}, @pxref{Gateway methods}).
address@hidden ifset
address@hidden emacsgw
+The method must be an inline method (@pxref{Inline methods}).
address@hidden ifclear
+If @var{proxy} is @code{nil}, no additional hop is required reaching
address@hidden@@@var{host}.
+
+If you, for example, must pass the host @samp{bastion.your.domain} as
+user @samp{bird} for any remote host which is not located in your local
+domain, you can set
+
address@hidden
+(add-to-list 'tramp-default-proxies-alist
+             '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}"))
+(add-to-list 'tramp-default-proxies-alist
+             '("\\.your\\.domain\\'" nil nil))
address@hidden lisp
+
+Please note the order of the code.  @code{add-to-list} adds elements at the
+beginning of a list.  Therefore, most relevant rules must be added last.
+
+Proxy hosts can be cascaded.  If there is another host called
address@hidden, which is the only one in your local domain who
+is allowed connecting @samp{bastion.your.domain}, you can add another
+rule:
+
address@hidden
+(add-to-list 'tramp-default-proxies-alist
+             '("\\`bastion\\.your\\.domain\\'"
+               "\\`bird\\'"
+               "@trampfnmhl{ssh, jump.your.domain,}"))
address@hidden lisp
+
address@hidden can contain the patterns @code{%h} or @code{%u}.  These
+patterns are replaced by the strings matching @var{host} or
address@hidden, respectively.
+
+If you, for example, wants to work as @samp{root} on hosts in the
+domain @samp{your.domain}, but login as @samp{root} is disabled for
+non-local access, you might add the following rule:
+
address@hidden
+(add-to-list 'tramp-default-proxies-alist
+             '("\\.your\\.domain\\'" "\\`root\\'" "@trampfnmhl{ssh, %h,}"))
address@hidden lisp
+
+Opening @address@hidden, randomhost.your.domain,}} would
+connect first @samp{randomhost.your.domain} via @code{ssh} under your
+account name, and perform @code{sudo -u root} on that host afterwards.
+It is important to know that the given method is applied on the host
+which has been reached so far.  @code{sudo -u root}, applied on your
+local host, wouldn't be useful here.
+
+This is the recommended configuration to work as @samp{root} on remote
+Ubuntu hosts.
+
address@hidden emacsgw
+Finally, @code{tramp-default-proxies-alist} can be used to pass
+firewalls or proxy servers.  Imagine your local network has a host
address@hidden which is used on port 3128 as HTTP proxy to
+the outer world.  Your friendly administrator has granted you access
+under your user name to @samp{host.other.domain} on that proxy
address@hidden tunnels are intended for secure SSL/TLS
+communication.  Therefore, many proxy server restrict the tunnels to
+related target ports.  You might need to run your ssh server on your
+target host @samp{host.other.domain} on such a port, like 443 (https).
+See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall}
+for discussion of ethical issues.}  You would need to add the
+following rule:
+
address@hidden
+(add-to-list 'tramp-default-proxies-alist
+             '("\\`host\\.other\\.domain\\'" nil
+               "@trampfnmhl{tunnel, proxy.your.domain#3128,}"))
address@hidden lisp
+
+Gateway methods can be declared as first hop only in a multiple hop
+chain.
address@hidden ifset
+
+
 @node Customizing Methods
 @section Using Non-Standard Methods
 @cindex customizing methods
@@ -1263,8 +1510,8 @@
 the following conventions:
 
 @defun my-tramp-parse file
address@hidden must be either a file name on your host, or @code{nil}. The
-function must return a list of (@var{user} @var{host}), which are
address@hidden must be either a file name on your host, or @code{nil}.
+The function must return a list of (@var{user} @var{host}), which are
 taken as candidates for user and host name completion.
 
 Example:
@@ -1309,16 +1556,44 @@
 @code{password-cache} (setting it to @code{nil}).
 
 Implementation Note: password caching is based on the package
-password.el in No Gnus.  For the time being, it is activated only when
-this package is seen in the @code{load-path} while loading @value{tramp}.
address@hidden in No Gnus.  For the time being, it is activated
+only when this package is seen in the @code{load-path} while loading
address@hidden
 @ifset installchapter
-If you don't use No Gnus, you can take password.el from the @value{tramp}
address@hidden directory, see @ref{Installation parameters}.
+If you don't use No Gnus, you can take @file{password.el} from the
address@hidden @file{contrib} directory, see @ref{Installation
+parameters}.
 @end ifset
 It will be activated mandatory once No Gnus has found its way into
 @value{emacsname}.
 
 
address@hidden Connection caching
address@hidden Reusing connection related information.
address@hidden caching
+
address@hidden tramp-persistency-file-name
+In order to reduce initial connection time, @value{tramp} stores
+connection related information persistently.  The variable
address@hidden keeps the file name where these
+information are written.  Its default value is
address@hidden emacs
address@hidden/.emacs.d/tramp}.
address@hidden ifset
address@hidden xemacs
address@hidden/.xemacs/tramp}.
address@hidden ifset
+It is recommended to choose a local file name.
+
address@hidden reads this file during startup, and writes it when
+exiting @value{emacsname}.  You can simply remove this file if
address@hidden shall be urged to recompute these information next
address@hidden startup time.
+
+Using such persistent information can be disabled by setting
address@hidden to @code{nil}.
+
+
 @node Remote Programs
 @section How @value{tramp} finds and uses programs on the remote machine.
 
@@ -1337,11 +1612,18 @@
 
 @vindex tramp-remote-path
 When @value{tramp} connects to the remote machine, it searches for the
-programs that it can use. The variable @var{tramp-remote-path} controls
-the directories searched on the remote machine.
+programs that it can use.  The variable @code{tramp-remote-path}
+controls the directories searched on the remote machine.
 
 By default, this is set to a reasonable set of defaults for most
-machines. It is possible, however, that your local (or remote ;) system
+machines.  The symbol @code{tramp-default-remote-path} is a place
+holder, it is replaced by the list of directories received via the
+command @command{getconf PATH} on your remote machine.  For example,
+on GNU Debian this is @file{/bin:/usr/bin}, whereas on Solaris this is
address@hidden/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}.  It is
+recommended to apply this symbol on top of @code{tramp-remote-path}.
+
+It is possible, however, that your local (or remote ;) system
 administrator has put the tools you want in some obscure local
 directory.
 
@@ -1433,20 +1715,37 @@
 
 Some people invoke the @command{tset} program from their shell startup
 scripts which asks the user about the terminal type of the shell.
-Maybe some shells ask other questions when they are started.  @value{tramp}
-does not know how to answer these questions.  There are two approaches
-for dealing with this problem.  One approach is to take care that the
-shell does not ask any questions when invoked from @value{tramp}.  You can
-do this by checking the @code{TERM} environment variable, it will be
-set to @code{dumb} when connecting.
+Maybe some shells ask other questions when they are started.
address@hidden does not know how to answer these questions.  There are
+two approaches for dealing with this problem.  One approach is to take
+care that the shell does not ask any questions when invoked from
address@hidden  You can do this by checking the @code{TERM}
+environment variable, it will be set to @code{dumb} when connecting.
 
 @vindex tramp-terminal-type
 The variable @code{tramp-terminal-type} can be used to change this value
 to @code{dumb}.
 
address@hidden tramp-actions-before-shell
 The other approach is to teach @value{tramp} about these questions.  See
-the variables @code{tramp-actions-before-shell} and
address@hidden (for multi-hop connections).
+the variable @code{tramp-actions-before-shell}.  Example:
+
address@hidden
+(defconst my-tramp-prompt-regexp
+  (concat (regexp-opt '("Enter the birth date of your mother:") t)
+          "\\s-*")
+  "Regular expression matching my login prompt question.")
+
+(defun my-tramp-action (proc vec)
+  "Enter \"19000101\" in order to give a correct answer."
+  (save-window-excursion
+    (with-current-buffer (tramp-get-connection-buffer vec)
+      (tramp-message vec 6 "\n%s" (buffer-string))
+      (tramp-send-string vec "19000101"))))
+
+(add-to-list 'tramp-actions-before-shell
+             '(my-tramp-prompt-regexp my-tramp-action))
address@hidden lisp
 
 
 @item Environment variables named like users in @file{.profile}
@@ -1484,10 +1783,10 @@
 
 What can you do about this?
 
-Well, one possibility is to make sure that everything in @file{~/.shrc}
-and @file{~/.profile} on all remote hosts is Bourne-compatible.  In the
-above example, instead of @command{export FOO=bar}, you might use
address@hidden; export FOO} instead.
+Well, one possibility is to make sure that everything in
address@hidden/.shrc} and @file{~/.profile} on all remote hosts is
+Bourne-compatible.  In the above example, instead of @command{export
+FOO=bar}, you might use @command{FOO=bar; export FOO} instead.
 
 The other possibility is to put your non-Bourne shell setup into some
 other files.  For example, bash reads the file @file{~/.bash_profile}
@@ -1528,13 +1827,13 @@
 @ifset xemacs
 @code{bkup-backup-directory-info}.
 @end ifset
-In connection with @value{tramp}, this can have unexpected side effects.
-Suppose that you specify that all backups should go to the directory
address@hidden/.emacs.d/backups/}, and then you edit the file
address@hidden@address@hidden@@address@hidden/etc/secretfile}.
-The effect is that the backup file will be owned by you and not by
-root, thus possibly enabling others to see it even if they were not
-intended to see it.
+In connection with @value{tramp}, this can have unexpected side
+effects.  Suppose that you specify that all backups should go to the
+directory @file{~/.emacs.d/backups/}, and then you edit the file
address@hidden@trampfn{su, root, localhost, /etc/secretfile}}.  The effect is
+that the backup file will be owned by you and not by root, thus
+possibly enabling others to see it even if they were not intended to
+see it.
 
 When
 @ifset emacs
@@ -1608,14 +1907,15 @@
 @end ifset
 
 @noindent
-The backup file name of
address@hidden@address@hidden@@address@hidden/etc/secretfile}
-would be
+The backup file name of @address@hidden, root, localhost,
+/etc/secretfile}} would be
 @ifset emacs
address@hidden@address@hidden@@address@hidden/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}
address@hidden@trampfn{su, root, localhost,
+~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
 @end ifset
 @ifset xemacs
address@hidden@address@hidden@@address@hidden/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}
address@hidden@trampfn{su, root, localhost,
+~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
 @end ifset
 
 The same problem can happen with auto-saving files.
@@ -1669,8 +1969,8 @@
 If you wish to use the @option{scpx} connection method, then you might
 have the problem that @value{emacsname} calls @command{scp} with a
 Windows filename such as @code{c:/foo}.  The Cygwin version of
address@hidden does not know about Windows filenames and interprets this
-as a remote filename on the host @code{c}.
address@hidden does not know about Windows filenames and interprets
+this as a remote filename on the host @code{c}.
 
 One possible workaround is to write a wrapper script for @option{scp}
 which converts the Windows filename to a Cygwinized filename.
@@ -1696,9 +1996,9 @@
 @chapter Using @value{tramp}
 @cindex using @value{tramp}
 
-Once you have installed @value{tramp} it will operate fairly transparently. You
-will be able to access files on any remote machine that you can log in
-to as though they were local.
+Once you have installed @value{tramp} it will operate fairly
+transparently.  You will be able to access files on any remote machine
+that you can log in to as though they were local.
 
 Files are specified to @value{tramp} using a formalized syntax specifying the
 details of the system to connect to.  This is similar to the syntax used
@@ -1717,10 +2017,9 @@
 
 @menu
 * Filename Syntax::             @value{tramp} filename conventions.
-* Multi-hop filename syntax::   Multi-hop filename conventions.
+* Alternative Syntax::          URL-like filename syntax.
 * Filename completion::         Filename completion.
-* Dired::                       Dired.
-* Compilation::                 Compile remote files.
+* Remote processes::            Integration with other @value{emacsname} 
packages (@sc{experimental}).
 @end menu
 
 
@@ -1729,34 +2028,33 @@
 @cindex filename syntax
 @cindex filename examples
 
-To access the file @var{localname} on the remote machine @var{machine} you
-would specify the filename
address@hidden@address@hidden@address@hidden
-This will connect to @var{machine} and transfer the file using the
-default method.  @xref{Default Method}.
+To access the file @var{localname} on the remote machine @var{machine}
+you would specify the filename @address@hidden@var{machine},
address@hidden  This will connect to @var{machine} and transfer
+the file using the default method.  @xref{Default Method}.
 
 Some examples of @value{tramp} filenames are shown below.
 
 @table @file
address@hidden @address@hidden
address@hidden @trampfnhl{melancholia, .emacs}
 Edit the file @file{.emacs} in your home directory on the machine
 @code{melancholia}.
 
address@hidden @address@hidden
address@hidden @trampfnhl{melancholia.danann.net, .emacs}
 This edits the same file, using the fully qualified domain name of
 the machine.
 
address@hidden @address@hidden/.emacs
address@hidden @trampfnhl{melancholia, ~/.emacs}
 This also edits the same file --- the @file{~} is expanded to your
 home directory on the remote machine, just like it is locally.
 
address@hidden @address@hidden/.emacs
address@hidden @trampfnhl{melancholia, ~daniel/.emacs}
 This edits the file @file{.emacs} in the home directory of the user
 @code{daniel} on the machine @code{melancholia}. The @file{~<user>}
 construct is expanded to the home directory of that user on the remote
 machine.
 
address@hidden @address@hidden/etc/squid.conf
address@hidden @trampfnhl{melancholia, /etc/squid.conf}
 This edits the file @file{/etc/squid.conf} on the machine
 @code{melancholia}.
 
@@ -1768,84 +2066,69 @@
 part of the filename.
 
 To log in to the remote machine as a specific user, you use the syntax
address@hidden@address@hidden@@@address@hidden/@var{path/to.file}}.
address@hidden@address@hidden, @var{machine}, @var{path/to.file}}}.
 That means that connecting to @code{melancholia} as @code{daniel} and
 editing @file{.emacs} in your home directory you would specify
address@hidden@value{prefix}daniel@@address@hidden
address@hidden@trampfnuhl{daniel, melancholia, .emacs}}.
 
 It is also possible to specify other file transfer methods
 (@pxref{Default Method}) as part of the filename.
 @ifset emacs
 This is done by putting the method before the user and host name, as
-in
address@hidden@address@hidden@value{postfixsinglehop}}
-(Note the trailing colon).
+in @address@hidden@address@hidden (Note the
+trailing colon).
 @end ifset
 @ifset xemacs
-This is done by replacing the initial
address@hidden@value{prefix}} with
address@hidden@value{prefix}<method>@value{postfixsinglehop}}.
-(Note the trailing slash!).
+This is done by replacing the initial @address@hidden with
address@hidden@value{prefix}<method>@value{postfixhop}}.  (Note the trailing
+slash!).
 @end ifset
 The user, machine and file specification remain the same.
 
 So, to connect to the machine @code{melancholia} as @code{daniel},
-using the @option{ssh} method to transfer files, and edit @file{.emacs}
-in my home directory I would specify the filename
address@hidden@address@hidden@@address@hidden
+using the @option{ssh} method to transfer files, and edit
address@hidden in my home directory I would specify the filename
address@hidden@trampfn{ssh, daniel, melancholia, .emacs}}.
+
+
address@hidden Alternative Syntax
address@hidden URL-like filename syntax
address@hidden filename syntax
address@hidden filename examples
 
+Additionally to the syntax described in the previous chapter, it is
+possible to use a URL-like syntax for @value{tramp}.  This can be
+switched on by customizing the variable @code{tramp-syntax}.  Please
+note that this feature is experimental for the time being.
 
address@hidden Multi-hop filename syntax
address@hidden Multi-hop filename conventions
address@hidden filename syntax for multi-hop files
address@hidden multi-hop filename syntax
-
-The syntax of multi-hop file names is necessarily slightly different
-than the syntax of other @value{tramp} file names.  Here's an example
-multi-hop file name:
+The variable @code{tramp-syntax} must be set before requiring @value{tramp}:
 
address@hidden
address@hidden@address@hidden@@address@hidden@value{postfixmultihop}kai@@address@hidden/path/to.file
address@hidden example
address@hidden
+(setq tramp-syntax 'url)
+(require 'tramp)
address@hidden lisp
+
+Then, a @value{tramp} filename would look like this:
address@hidden/@var{method}://@var{user}@@@var{machine}:@var{port}/@var{path/to.file}}.
address@hidden/@var{method}://} is mandatory, all other parts are optional.
address@hidden:@var{port}} is useful for methods only who support this.
+
+The last example from the previous section would look like this:
address@hidden/ssh://daniel@@melancholia/.emacs}.
+
+For the time being, @code{tramp-syntax} can have the following values:
 
-This is quite a mouthful.  So let's go through it step by step.  The
-file name consists of three parts.
address@hidden @w{}
 @ifset emacs
-The parts are separated by colons
address@hidden @code{ftp} -- That is the default syntax
address@hidden @code{url} -- URL-like syntax
 @end ifset
 @ifset xemacs
-The parts are separated by slashes and square brackets.
address@hidden @code{sep} -- That is the default syntax
address@hidden @code{url} -- URL-like syntax
address@hidden @code{ftp} -- EFS-like syntax
 @end ifset
-The first part is @address@hidden, the method
-specification.  The second part is
address@hidden@value{postfixmultihop}out@@address@hidden@value{postfixmultihop}kai@@real.host}
-and specifies the hops.  The final part is @file{/path/to.file} and
-specifies the file name on the remote host.
-
-The first part and the final part should be clear.  See @ref{Multi-hop
-Methods}, for a list of alternatives for the method specification.
-
-The second part can be subdivided again into components, so-called
-hops.  In the above file name, there are two hops,
address@hidden@value{postfixmultihop}out@@gate} and
address@hidden@value{postfixmultihop}kai@@real.host}.
-
-Each hop can @emph{again} be subdivided into (three) components, the
address@hidden method}, the @dfn{user name} and the @dfn{host name}.  The
-meaning of the second and third component should be clear, and the hop
-method says what program to use to perform that hop.
-
-The first hop, @address@hidden@@gate},
-says to use @command{rsh} to log in as user @code{out} to the host
address@hidden  Starting at that host, the second hop,
address@hidden@value{postfixmultihop}kai@@real.host}, says to
-use @command{telnet} to log in as user @code{kai} to host
address@hidden
-
address@hidden Methods}, for a list of possible hop method values.
-The variable @code{tramp-multi-connection-function-alist} contains the
-list of possible hop methods and information on how to execute them,
-should you want to add your own.
address@hidden itemize
 
 
 @node Filename completion
@@ -1853,10 +2136,20 @@
 @cindex filename completion
 
 Filename completion works with @value{tramp} for completion of method
-names, of user names and of machine names (except multi-hop methods)
-as well as for completion of file names on remote machines.
+names, of user names and of machine names as well as for completion of
+file names on remote machines.
 @ifset emacs
-In order to enable this, Partial Completion mode must be set on.
+In order to enable this, Partial Completion mode must be set
address@hidden you don't use Partial Completion mode, but want to
+keep full completion, load @value{tramp} like this in your
address@hidden:
+
address@hidden
+;; Preserve Tramp's completion features.
+(let ((partial-completion-mode t))
+  (require 'tramp))
address@hidden lisp
+}.
 @ifinfo
 @xref{Completion Options, , , @value{emacsdir}}.
 @end ifinfo
@@ -1867,85 +2160,153 @@
 
 @example
 @ifset emacs
address@hidden@value{postfixsinglehop}                             tmp/
address@hidden@value{postfix}
address@hidden@value{postfixhop}                                   tmp/
address@hidden@value{postfix}
 @end ifset
 @ifset xemacs
address@hidden@value{postfixsinglehop}                             
@address@hidden
address@hidden@value{postfixhop}                                   
@address@hidden
 @end ifset
 @end example
 
address@hidden@address@hidden
address@hidden@address@hidden
 is a possible completion for the respective method,
 @ifset emacs
 @samp{tmp/} stands for the directory @file{/tmp} on your local
 machine,
 @end ifset
-and @address@hidden@value{postfix}}
+and @address@hidden@value{postfix}}
 might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
 file (given you're using default method @option{ssh}).
 
 If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to
address@hidden@address@hidden
address@hidden@address@hidden
 Next @address@hidden brings you all machine names @value{tramp} detects in
 your @file{/etc/hosts} file, let's say
 
 @example
address@hidden@address@hidden              @address@hidden@value{postfix}
address@hidden@address@hidden              @address@hidden@value{postfix}
address@hidden@address@hidden
address@hidden,127.0.0.1,}                 @trampfnmhl{telnet,192.168.0.1,}
address@hidden,localhost,}                 
@trampfnmhl{telnet,melancholia.danann.net,}
address@hidden,melancholia,}
 @end example
 
 Now you can choose the desired machine, and you can continue to
 complete file names on that machine.
 
-As filename completion needs to fetch the listing of files from the
-remote machine, this feature is sometimes fairly slow.  As @value{tramp}
-does not yet cache the results of directory listing, there is no gain
-in performance the second time you complete filenames.
-
 If the configuration files (@pxref{Customizing Completion}), which
 @value{tramp} uses for analysis of completion, offer user names, those user
 names will be taken into account as well.
 
+Remote machines, which have been visited in the past and kept
+persistently (@pxref{Connection caching}), will be offered too.
 
address@hidden Dired
address@hidden Dired
address@hidden dired
+Once the remote machine identification is completed, it comes to
+filename completion on the remote host.  This works pretty much like
+for files on the local host, with the exception that minibuffer
+killing via a double-slash works only on the filename part, except
+that filename part starts with @file{//}.
address@hidden
address@hidden File, , , @value{emacsdir}}.
address@hidden ifinfo
 
address@hidden works transparently with dired, enabling you to use this powerful
-file management tool to manage files on any machine you have access to
-over the Internet.
address@hidden emacs
+As example, @address@hidden,melancholia,/usr/local/bin//etc}
address@hidden would result in
address@hidden@trampfnmhl{telnet,melancholia,/etc}}, whereas
address@hidden@trampfnmhl{telnet,melancholia,//etc} @key{TAB}} reduces the
+minibuffer contents to @file{/etc}.  A triple-slash stands for the
+default behaviour,
+i.e. @address@hidden,melancholia,/usr/local/bin///etc}
address@hidden expands directly to @file{/etc}.
address@hidden ifset
 
-If you need to browse a directory tree, Dired is a better choice, at
-present, than filename completion.  Dired has its own cache mechanism
-and will only fetch the directory listing once.
address@hidden xemacs
+As example, @address@hidden,melancholia,/usr/local/bin//}}
+would result in @address@hidden,melancholia,/}}, whereas
address@hidden@trampfnmhl{telnet,melancholia,//}} expands the minibuffer
+contents to @file{/}.
address@hidden ifset
 
 
address@hidden Compilation
address@hidden Compile remote files
address@hidden Remote processes
address@hidden Integration with other @value{emacsname} packages 
(@sc{experimental}).
 @cindex compile
 @cindex recompile
address@hidden gud
address@hidden gdb
address@hidden perldb
+
address@hidden has an @sc{experimental} implementation for running
+processes on a remote host.  This allows to exploit @value{emacsname}
+packages without modification for remote file names.  It does not work
+for the @option{ftp} and @option{smb} methods.
+
+Remote processes are started when a corresponding command is executed
+from a buffer belonging to a remote file or directory.  Up to now, the
+packages @file{compile.el} (commands like @code{compile} and
address@hidden) and @file{gud.el} (@code{gdb} or @code{perldb}) have been
+integrated.  Integration of further packages is planned, any help for
+this is welcome!
+
+When your program is not found in the default search path
address@hidden sets on the remote machine, you should either use an
+absolute path, or extend @code{tramp-remote-path} (see @ref{Remote
+Programs}):
 
address@hidden provides commands for compilation of files on remote
-machines.  In order to get them loaded, you need to require
address@hidden:
address@hidden
+(add-to-list 'tramp-remote-path "~/bin")
+(add-to-list 'tramp-remote-path "/appli/pub/bin")
address@hidden lisp
+
+The environment for your program can be adapted by customizing
address@hidden  This variable is a list of
+strings.  It is structured like @code{process-environment}.  Each
+element is a string of the form ENVVARNAME=VALUE.  An entry
+ENVVARNAME= disables the corresponding environment variable, which
+might have been set in your init file like @file{~/.profile}.
+
address@hidden
+Adding an entry can be performed via @code{add-to-list}:
 
 @lisp
-(require 'tramp-util)
+(add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java")
 @end lisp
 
-Afterwards, you can use the commands @code{tramp-compile} and
address@hidden instead of @code{compile} and @code{recompile},
-respectively; @inforef{Compilation, ,@value{emacsdir}}.  This does not
-work for the @option{ftp} and @option{smb} methods.
+Changing or removing an existing entry is not encouraged.  The default
+values are chosen for proper @value{tramp} work.  Nevertheless, if for
+example a paranoid system administrator disallows changing the
address@hidden environment variable, you can customize
address@hidden, or you can apply the
+following code in your @file{.emacs}:
+
address@hidden
+(let ((process-environment tramp-remote-process-environment))
+  (setenv "HISTORY" nil)
+  (setq tramp-remote-process-environment process-environment))
address@hidden lisp
 
-The corresponding key bindings and menu entries calling these commands
-are redefined automatically for buffers associated with remote files.
+If you use other @value{emacsname} packages which do not run
+out-of-the-box on a remote host, please let us know.  We will try to
+integrate them as well.  @xref{Bug Reports}.
 
-After finishing the compilation, you can use the usual commands like
address@hidden, @code{next-error} and @code{first-error} for
-navigation in the @file{*Compilation*} buffer.
+
address@hidden Running eshell on a remote host
address@hidden eshell
+
address@hidden is integrated into @file{eshell.el}.  That is, you can
+open an interactive shell on your remote host, and run commands there.
+After you have started @code{eshell}, you could perform commands like
+this:
+
address@hidden
address@hidden $} cd @trampfnmhl{sudo, , /etc}
address@hidden@trampfn{sudo, root, host, /etc} $} hostname
+host
address@hidden@trampfn{sudo, root, host, /etc} $} id
+uid=0(root) gid=0(root) groups=0(root)
address@hidden@trampfn{sudo, root, host, /etc} $} find-file shadow
+#<buffer shadow>
address@hidden@trampfn{sudo, root, host, /etc} $}
address@hidden example
 
 
 @node Bug Reports
@@ -1971,9 +2332,9 @@
 @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/,
 the @value{tramp} Mail Subscription Page}.
 
-To report a bug in @value{tramp}, you should execute @kbd{M-x tramp-bug}. This
-will automatically generate a buffer with the details of your system and
address@hidden version.
+To report a bug in @value{tramp}, you should execute @kbd{M-x
+tramp-bug}.  This will automatically generate a buffer with the details
+of your system and @value{tramp} version.
 
 When submitting a bug report, please try to describe in excruciating
 detail the steps required to reproduce the problem, the setup of the
@@ -1982,8 +2343,20 @@
 Asked Questions}.
 
 If you can identify a minimal test case that reproduces the problem,
-include that with your bug report. This will make it much easier for the
-development team to analyze and correct the problem.
+include that with your bug report.  This will make it much easier for
+the development team to analyze and correct the problem.
+
+Before reporting the bug, you should set the verbosity level to 6
+(@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and
+repeat the bug.  Then, include the contents of the @file{*tramp/foo*}
+and @file{*debug tramp/foo*} buffers in your bug report.  A verbosity
+level greater than 6 will produce a very huge debug buffer, which is
+mostly not necessary for the analysis.
+
+Please be aware that, with a verbosity level of 6 or greater, the
+contents of files and directories will be included in the debug
+buffer.  Passwords you've typed will never be included there.
+
 
 @node Frequently Asked Questions
 @chapter Frequently Asked Questions
@@ -2009,10 +2382,9 @@
 @item
 Which systems does it work on?
 
-The package has been used successfully on GNU Emacs 20, GNU Emacs 21
-and GNU Emacs 22, as well as XEmacs 21.  XEmacs 20 is more
-problematic, see the notes in @file{tramp.el}.  I don't think anybody
-has really tried it on GNU Emacs 19.
+The package has been used successfully on GNU Emacs 21, GNU Emacs 22
+and XEmacs 21 (starting with 21.4).  Gateway methods are supported for
+GNU Emacs 22 only.
 
 The package was intended to work on Unix, and it really expects a
 Unix-like system on the remote end (except the @option{smb} method),
@@ -2030,6 +2402,34 @@
 @uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html}
 @end ignore
 
address@hidden
+How could I speed up @value{tramp}?
+
+In the backstage, @value{tramp} needs a lot of operations on the
+remote host.  The time for transferring data from and to the remote
+host as well as the time needed to perform the operations there count.
+In order to speed up @value{tramp}, one could either try to avoid some
+of the operations, or one could try to improve their performance.
+
+Use an external transfer method, like @option{scpc}.
+
+Use caching.  This is already enabled by default.  Information about
+the remote host as well as the remote files are cached for reuse.  Th
+information about remote hosts is kept in the file specified in
address@hidden  Keep this file.
+
+Disable version control.  If you access remote files which are not
+under version control, a lot of check operations can be avoided by
+disabling VC.  This can be achieved by
+
address@hidden
+(setq vc-handled-backends nil)
address@hidden lisp
+
+Disable excessive traces.  The default trace level of @value{tramp},
+defined in the variable @code{tramp-verbose}, is 3.  You should
+increase this level only temporarily, hunting bugs.
+
 
 @item
 @value{tramp} does not connect to the remote host
@@ -2048,6 +2448,17 @@
 should be avoided on the remote side.  @xref{Remote shell setup}. for
 setting the regular expression detecting the prompt.
 
+You can check your settings after an unsuccessful connection by
+switching to the @value{tramp} connection buffer @file{*tramp/foo*},
+setting the cursor at the top of the buffer, and applying the expression
+
address@hidden
address@hidden: (re-search-forward (concat tramp-shell-prompt-pattern "$"))}
address@hidden example
+
+If it fails, or the cursor is not moved at the end of the buffer, your
+prompt is not recognised correctly.
+
 A special problem is the zsh, which uses left-hand side and right-hand
 side prompts in parallel.  Therefore, it is necessary to disable the
 zsh line editor on the remote host.  You shall add to @file{~/.zshrc}
@@ -2057,15 +2468,34 @@
 [ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
 @end example
 
+
 @item
 @value{tramp} doesn't transfer strings with more than 500 characters
 correctly
 
 On some few systems, the implementation of @code{process-send-string}
-seems to be broken for longer strings.  This case, you should
-customize the variable @code{tramp-chunksize} to 500.  For a
-description how to determine whether this is necessary see the
-documentation of @code{tramp-chunksize}.
+seems to be broken for longer strings.  It is reported for HP-UX,
+FreeBSD and Tru64 Unix, for example.  This case, you should customize
+the variable @code{tramp-chunksize} to 500.  For a description how to
+determine whether this is necessary see the documentation of
address@hidden
+
+Additionally, it will be useful to set @code{file-precious-flag} to
address@hidden for @value{tramp} files.  Then the file contents will be
+written into a temporary file first, which is checked for correct
+checksum.
address@hidden
address@hidden Buffers, , , elisp}
address@hidden ifinfo
+
address@hidden
+(add-hook
+ 'find-file-hooks
+ '(lambda ()
+    (when (file-remote-p default-directory)
+      (set (make-local-variable 'file-precious-flag) t))))
address@hidden lisp
+
 @end itemize
 
 
@@ -2117,11 +2547,13 @@
  " make tramp beep after writing a file."
  (interactive)
  (beep))
+
 (defadvice tramp-handle-do-copy-or-rename-file
   (after tramp-copy-beep-advice activate)
  " make tramp beep after copying a file."
  (interactive)
  (beep))
+
 (defadvice tramp-handle-insert-file-contents
   (after tramp-copy-beep-advice activate)
  " make tramp beep after copying a file."
@@ -2130,6 +2562,60 @@
 @end lisp
 
 
address@hidden emacs
address@hidden
+I'ld like to see a host indication in the mode line when I'm remote
+
+The following code has been tested with @value{emacsname} 22.  You
+should put it into your @file{~/.emacs}:
+
address@hidden
+(defconst my-mode-line-buffer-identification
+  (list
+   '(:eval
+     (let ((host-name
+           (if (file-remote-p default-directory)
+               (tramp-file-name-host
+                (tramp-dissect-file-name default-directory))
+             (system-name))))
+       (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
+          (substring host-name 0 (match-beginning 1))
+        host-name)))
+   ": %12b"))
+
+(setq-default
+ mode-line-buffer-identification
+ my-mode-line-buffer-identification)
+
+(add-hook
+ 'dired-mode-hook
+ '(lambda ()
+    (setq
+     mode-line-buffer-identification
+     my-mode-line-buffer-identification)))
address@hidden lisp
address@hidden ifset
+
+
address@hidden emacs
address@hidden
+My remote host does not understand default directory listing options
+
address@hidden computes the @command{dired} options depending on
+the local host you are working.  If your @command{ls} command on the
+remote host does not understand those options, you can change them
+like this:
+
address@hidden
+(add-hook
+ 'dired-before-readin-hook
+ '(lambda ()
+    (when (file-remote-p default-directory)
+      (setq dired-actual-switches "-al"))))
address@hidden lisp
address@hidden ifset
+
+
 @item
 There's this @file{~/.sh_history} file on the remote host which keeps
 growing and growing.  What's that?
@@ -2152,6 +2638,218 @@
 @end example
 
 
address@hidden There are longish file names to type.  How to shorten this?
+
+Let's say you need regularly access to @address@hidden, news,
+news.my.domain, /opt/news/etc}}, which is boring to type again and
+again.  The following approaches can be mixed:
+
address@hidden
+
address@hidden Use default values for method and user name:
+
+You can define default methods and user names for hosts,
+(@pxref{Default Method}, @pxref{Default User}):
+
address@hidden
+(setq tramp-default-method "ssh"
+      tramp-default-user "news")
address@hidden lisp
+
+The file name left to type would be
address@hidden C-f @trampfnhl{news.my.domain, /opt/news/etc}}.
+
+Note, that there are some useful settings already.  Accessing your
+local host as @samp{root} user, is possible just by @kbd{C-x C-f
address@hidden,,}}.
+
address@hidden Use configuration possibilities of your method:
+
+Several connection methods (i.e. the programs used) offer powerful
+configuration possibilities (@pxref{Customizing Completion}).  In the
+given case, this could be @file{~/.ssh/config}:
+
address@hidden
+Host xy
+     HostName news.my.domain
+     User news
address@hidden example
+
+The file name left to type would be @kbd{C-x C-f @trampfnmhl{ssh, xy,
+/opt/news/etc}}.  Depending on files in your directories, it is even
+possible to complete the hostname with @kbd{C-x C-f
address@hidden@value{postfixhop}x @key{TAB}}.
+
address@hidden Use environment variables:
+
+File names typed in the minibuffer can be expanded by environment
+variables.  You can set them outside @value{emacsname}, or even with
+Lisp:
+
address@hidden
+(setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")
address@hidden lisp
+
+Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you
+are.  The disadvantage is, that you cannot edit the file name, because
+environment variables are not expanded during editing in the
+minibuffer.
+
address@hidden Define own keys:
+
+You can define your own key sequences in @value{emacsname}, which can
+be used instead of @kbd{C-x C-f}:
+
address@hidden
+(global-set-key
+ [(control x) (control y)]
+ (lambda ()
+   (interactive)
+   (find-file
+    (read-file-name
+     "Find Tramp file: "
+     "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))))
address@hidden lisp
+
+Simply typing @kbd{C-x C-y} would initialize the minibuffer for
+editing with your beloved file name.
+
+See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the
+Emacs Wiki} for a more comprehensive example.
+
address@hidden Define own abbreviation (1):
+
+It is possible to define an own abbreviation list for expanding file
+names:
+
address@hidden
+(add-to-list
+ 'directory-abbrev-alist
+ '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
address@hidden lisp
+
+This shortens the file openening command to @kbd{C-x C-f /xy
address@hidden  The disadvantage is, again, that you cannot edit the file
+name, because the expansion happens after entering the file name only.
+
address@hidden Define own abbreviation (2):
+
+The @code{abbrev-mode} gives more flexibility for editing the
+minibuffer:
+
address@hidden
+(define-abbrev-table 'my-tramp-abbrev-table
+  '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))
+
+(add-hook
+ 'minibuffer-setup-hook
+ '(lambda ()
+    (abbrev-mode 1)
+    (setq local-abbrev-table my-tramp-abbrev-table)))
+
+(defadvice minibuffer-complete
+  (before my-minibuffer-complete activate)
+  (expand-abbrev))
+
+;; If you use partial-completion-mode
+(defadvice PC-do-completion
+  (before my-PC-do-completion activate)
+  (expand-abbrev))
address@hidden lisp
+
+After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is
+expanded, and you can continue editing.
+
address@hidden Use bookmarks:
+
+Bookmarks can be used to visit Tramp files or directories.
address@hidden
address@hidden, , , @value{emacsdir}}
address@hidden ifinfo
+
+When you have opened @address@hidden, news, news.my.domain,
+/opt/news/etc/}}, you should save the bookmark via
address@hidden emacs
address@hidden@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
address@hidden ifset
+
+Later on, you can always navigate to that bookmark via
address@hidden emacs
address@hidden@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
address@hidden ifset
+
address@hidden Use recent files:
+
address@hidden emacs
address@hidden
address@hidden ifset
address@hidden xemacs
address@hidden
address@hidden ifset
+remembers visited places.
address@hidden
address@hidden emacs
address@hidden Conveniences, , , @value{emacsdir}}
address@hidden ifset
address@hidden xemacs
address@hidden, , , edit-utils}
address@hidden ifset
address@hidden ifinfo
+
+You could keep remote file names in the recent list without checking
+their readability through a remote access:
+
address@hidden
address@hidden emacs
+(require 'recentf)
+(add-to-list 'recentf-keep 'file-remote-p)
+(recentf-mode 1)
address@hidden ifset
address@hidden xemacs
+(recent-files-initialize)
+(add-hook
+ 'find-file-hooks
+ (lambda ()
+   (when (file-remote-p (buffer-file-name))
+     (recent-files-make-permanent)))
+ 'append)
address@hidden ifset
address@hidden lisp
+
+The list of files opened recently is reachable via
address@hidden emacs
address@hidden@key{menu-bar} @key{file} @key{Open Recent}}.
address@hidden ifset
address@hidden xemacs
address@hidden@key{menu-bar} @key{Recent Files}}.
address@hidden ifset
+
address@hidden emacs
address@hidden Use filecache:
+
address@hidden remembers visited places.  Add the directory into
+the cache:
+
address@hidden
+(eval-after-load "filecache"
+  '(file-cache-add-directory
+    "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
address@hidden lisp
+
+Whenever you want to load a file, you can enter @kbd{C-x C-f
address@hidden in the minibuffer.  The completion is done for the given
+directory.
address@hidden ifset
+
address@hidden enumerate
+
+
 @item
 How can I disable @value{tramp}?
 
@@ -2185,7 +2883,7 @@
 
 The actual version control binaries must be installed on the remote
 machine, accessible in the directories specified in
address@hidden
address@hidden
 
 This transparent integration with the version control systems is one of
 the most valuable features provided by @value{tramp}, but it is far from 
perfect.
@@ -2266,7 +2964,7 @@
 @node Remote File Ownership
 @subsection How VC determines who owns a workfile
 
address@hidden provides the @code{user-full-name} function to
address@hidden provides the @code{user-login-name} function to
 return the login name of the current user as well as mapping from
 arbitrary user id values back to login names. The VC code uses this
 functionality to map from the uid of the owner of a workfile to the
@@ -2346,6 +3044,77 @@
 effect while preserving the @value{tramp} file name information.
 
 
address@hidden Traces and Profiles
address@hidden How to Customize Traces
+
+All @value{tramp} messages are raised with a verbosity level.  The
+verbosity level can be any number between 0 and 10.  Only messages with
+a verbosity level less than or equal to @code{tramp-verbose} are
+displayed.
+
+The verbosity levels are
+
+          @w{ 0}  silent (no @value{tramp} messages at all)
address@hidden@indent @w{ 1}  errors
address@hidden@indent @w{ 2}  warnings
address@hidden@indent @w{ 3}  connection to remote hosts (default verbosity)
address@hidden@indent @w{ 4}  activities
address@hidden@indent @w{ 5}  internal
address@hidden@indent @w{ 6}  sent and received strings
address@hidden@indent @w{ 7}  file caching
address@hidden@indent @w{ 8}  connection properties
address@hidden@indent @w{10}  traces (huge)
+
+When @code{tramp-verbose} is greater than or equal to 4, the messages
+are also written into a @value{tramp} debug buffer.  This debug buffer
+is useful for analysing problems; sending a @value{tramp} bug report
+should be done with @code{tramp-verbose} set to a verbosity level of at
+least 6 (@pxref{Bug Reports}).
+
+The debug buffer is in
address@hidden
address@hidden Mode, , , @value{emacsdir}}.
address@hidden ifinfo
address@hidden
+Outline Mode.
address@hidden ifnotinfo
+That means, you can change the level of messages to be viewed.  If you
+want, for example, see only messages up to verbosity level 5, you must
+enter @kbd{C-u 6 C-c C-q}.
address@hidden
+Other keys for navigating are described in
address@hidden Visibility, , , @value{emacsdir}}.
address@hidden ifinfo
+
address@hidden errors are handled internally in order to raise the
+verbosity level 1 messages.  When you want to get a Lisp backtrace in
+case of an error, you need to set both
+
address@hidden
+(setq debug-on-error t
+      debug-on-signal t)
address@hidden lisp
+
+Sometimes, it might be even necessary to step through @value{tramp}
+function call traces.  Such traces are enabled by the following code:
+
address@hidden
+(require 'tramp)
+(require 'trace)
+(mapcar 'trace-function-background
+        (mapcar 'intern
+                (all-completions "tramp-" obarray 'functionp)))
+(untrace-function 'tramp-read-passwd)
+(untrace-function 'tramp-gw-basic-authentication)
address@hidden lisp
+
+The function call traces are inserted in the buffer
address@hidden  @code{tramp-read-passwd} and
address@hidden shall be disabled when the
+function call traces are added to @value{tramp}, because both
+functions return password strings, which should not be distributed.
+
+
 @node Issues
 @chapter Debatable Issues and What Was Decided
 
@@ -2368,14 +3137,6 @@
 But I have decided that this is too fragile to reliably work, so on some
 systems you'll have to do without the uuencode methods.
 
address@hidden @value{tramp} does not work on XEmacs 20.
-
-This is because it requires the macro @code{with-timeout} which does not
-appear to exist in XEmacs 20.  I'm somewhat reluctant to add an
-emulation macro to @value{tramp}, but if somebody who uses XEmacs 20 steps
-forward and wishes to implement and test it, please contact me or the
-mailing list.
-
 @item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs.
 
 The GNU Emacs maintainers wish to use a unified filename syntax for
@@ -2402,10 +3163,10 @@
 disabled.  This can be achieved by setting file permissions @code{000}
 to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}.
 
-In case of unified filenames, all @value{emacsname} download sites
-are added to @code{tramp-default-method-alist} with default method
address@hidden @xref{Default Method}.  These settings shouldn't be touched
-for proper working of the @value{emacsname} package system.
+In case of unified filenames, all @value{emacsname} download sites are
+added to @code{tramp-default-method-alist} with default method
address@hidden @xref{Default Method}.  These settings shouldn't be
+touched for proper working of the @value{emacsname} package system.
 
 The syntax for unified filenames is described in the @value{tramp} manual
 for @value{emacsothername}.
@@ -2430,7 +3191,6 @@
 @c   shells.
 @c * Explain how tramp.el works in principle: open a shell on a remote
 @c   host and then send commands to it.
address@hidden * Mention that bookmarks are a cool feature to go along with 
Tramp.
 @c * Make terminology "inline" vs "out-of-band" consistent.
 @c   It seems that "external" is also used instead of "out-of-band".
 




reply via email to

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