aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2007-07-08 18:05:03 +0000
committerMichael Albinus2007-07-08 18:05:03 +0000
commit8238a14007439c941174badeb59e4a5fc1b1e5df (patch)
tree4349220b0c713fc49f6d4ddcc5dbca78fa0dc440
parent00d6fd04d83f59b13c77aa999384367cde81b413 (diff)
downloademacs-8238a14007439c941174badeb59e4a5fc1b1e5df.tar.gz
emacs-8238a14007439c941174badeb59e4a5fc1b1e5df.zip
* tramp.texi:
* trampver.texi: Migrate to Tramp 2.1.
-rw-r--r--man/ChangeLog5
-rw-r--r--man/tramp.texi1460
-rw-r--r--man/trampver.texi27
3 files changed, 1127 insertions, 365 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index ad2d3b889f2..e185cd51f7b 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,8 @@
12007-07-08 Michael Albinus <michael.albinus@gmx.de>
2
3 * tramp.texi:
4 * trampver.texi: Migrate to Tramp 2.1.
5
12007-07-02 Carsten Dominik <dominik@science.uva.nl> 62007-07-02 Carsten Dominik <dominik@science.uva.nl>
2 7
3 * org.texi (Properties): New chapter. 8 * org.texi (Properties): New chapter.
diff --git a/man/tramp.texi b/man/tramp.texi
index 67b0647787c..fbcce166636 100644
--- a/man/tramp.texi
+++ b/man/tramp.texi
@@ -18,15 +18,27 @@
18@include trampver.texi 18@include trampver.texi
19 19
20@c Macros for formatting a filename. 20@c Macros for formatting a filename.
21@c trampfn is for a full filename, trampfnmhp means method, host, localname 21@c trampfn is for a full filename, trampfnmhl means method, host, localname
22@c were given, and so on. 22@c were given, and so on.
23@macro trampfn(method, user, host, localname) 23@macro trampfn {method, user, host, localname}
24@value{prefix}@value{method}@value{user}@@@value{host}@value{postfix}@value{localname} 24@value{prefix}\method\@value{postfixhop}\user\@@\host\@value{postfix}\localname\
25@end macro
26
27@macro trampfnmhl {method, host, localname}
28@value{prefix}\method\@value{postfixhop}\host\@value{postfix}\localname\
29@end macro
30
31@macro trampfnuhl {user, host, localname}
32@value{prefix}\user\@@\host\@value{postfix}\localname\
33@end macro
34
35@macro trampfnhl {host, localname}
36@value{prefix}\host\@value{postfix}\localname\
25@end macro 37@end macro
26 38
27@copying 39@copying
28Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 40Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
29Free Software Foundation, Inc. 412007 Free Software Foundation, Inc.
30 42
31@quotation 43@quotation
32Permission is granted to copy, distribute and/or modify this document 44Permission is granted to copy, distribute and/or modify this document
@@ -157,6 +169,7 @@ For the developer:
157 169
158* Version Control:: The inner workings of remote version control. 170* Version Control:: The inner workings of remote version control.
159* Files directories and localnames:: How file names, directories and localnames are mangled and managed. 171* Files directories and localnames:: How file names, directories and localnames are mangled and managed.
172* Traces and Profiles:: How to Customize Traces.
160* Issues:: Debatable Issues and What Was Decided. 173* Issues:: Debatable Issues and What Was Decided.
161 174
162* GNU Free Documentation License:: The license for this documentation. 175* GNU Free Documentation License:: The license for this documentation.
@@ -178,11 +191,17 @@ Configuring @value{tramp} for use
178* Connection types:: Types of connections made to remote machines. 191* Connection types:: Types of connections made to remote machines.
179* Inline methods:: Inline methods. 192* Inline methods:: Inline methods.
180* External transfer methods:: External transfer methods. 193* External transfer methods:: External transfer methods.
181* Multi-hop Methods:: Connecting to a remote host using multiple hops. 194@ifset emacsgw
195* Gateway methods:: Gateway methods.
196@end ifset
182* Default Method:: Selecting a default method. 197* Default Method:: Selecting a default method.
198* Default User:: Selecting a default user.
199* Default Host:: Selecting a default host.
200* Multi-hops:: Connecting to a remote host using multiple hops.
183* Customizing Methods:: Using Non-Standard Methods. 201* Customizing Methods:: Using Non-Standard Methods.
184* Customizing Completion:: Selecting config files for user/host name completion. 202* Customizing Completion:: Selecting config files for user/host name completion.
185* Password caching:: Reusing passwords for several connections. 203* Password caching:: Reusing passwords for several connections.
204* Connection caching:: Reusing connection related information.
186* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. 205* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
187* Remote shell setup:: Remote shell setup hints. 206* Remote shell setup:: Remote shell setup hints.
188* Windows setup hints:: Issues with Cygwin ssh. 207* Windows setup hints:: Issues with Cygwin ssh.
@@ -191,10 +210,9 @@ Configuring @value{tramp} for use
191Using @value{tramp} 210Using @value{tramp}
192 211
193* Filename Syntax:: @value{tramp} filename conventions. 212* Filename Syntax:: @value{tramp} filename conventions.
194* Multi-hop filename syntax:: Multi-hop filename conventions. 213* Alternative Syntax:: URL-like filename syntax.
195* Filename completion:: Filename completion. 214* Filename completion:: Filename completion.
196* Dired:: Dired. 215* Remote processes:: Integration with other @value{emacsname} packages (@sc{experimental}).
197* Compilation:: Compile remote files.
198 216
199The inner workings of remote version control 217The inner workings of remote version control
200 218
@@ -220,10 +238,10 @@ How file names, directories and localnames are mangled and managed
220@chapter An overview of @value{tramp} 238@chapter An overview of @value{tramp}
221@cindex overview 239@cindex overview
222 240
223After the installation of @value{tramp} into your @value{emacsname}, 241After the installation of @value{tramp} into your @value{emacsname}, you
224you will be able to access files on remote machines as though they 242will be able to access files on remote machines as though they were
225were local. Access to the remote file system for editing files, 243local. Access to the remote file system for editing files, version
226version control, and @code{dired} are transparently enabled. 244control, and @code{dired} are transparently enabled.
227 245
228Your access to the remote machine can be with the @command{rsh}, 246Your access to the remote machine can be with the @command{rsh},
229@command{rlogin}, @command{telnet} programs or with any similar 247@command{rlogin}, @command{telnet} programs or with any similar
@@ -380,7 +398,7 @@ behind the scenes when you open a file with @value{tramp}.
380 398
381@value{tramp} is freely available on the Internet and the latest 399@value{tramp} is freely available on the Internet and the latest
382release may be downloaded from 400release may be downloaded from
383@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full 401@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full
384documentation and code for @value{tramp}, suitable for installation. 402documentation and code for @value{tramp}, suitable for installation.
385But GNU Emacs (22 or later) includes @value{tramp} already, and there 403But GNU Emacs (22 or later) includes @value{tramp} already, and there
386is a @value{tramp} package for XEmacs, as well. So maybe it is easier 404is a @value{tramp} package for XEmacs, as well. So maybe it is easier
@@ -389,7 +407,7 @@ on@dots{...}
389 407
390For the especially brave, @value{tramp} is available from CVS. The CVS 408For the especially brave, @value{tramp} is available from CVS. The CVS
391version is the latest version of the code and may contain incomplete 409version is the latest version of the code and may contain incomplete
392features or new issues. Use these versions at your own risk. 410features or new issues. Use these versions at your own risk.
393 411
394Instructions for obtaining the latest development version of @value{tramp} 412Instructions for obtaining the latest development version of @value{tramp}
395from CVS can be found by going to the Savannah project page at the 413from CVS can be found by going to the Savannah project page at the
@@ -410,7 +428,7 @@ Or follow the example session below:
410 428
411@noindent 429@noindent
412You should now have a directory @file{~/@value{emacsdir}/tramp} 430You should now have a directory @file{~/@value{emacsdir}/tramp}
413containing the latest version of @value{tramp}. You can fetch the latest 431containing the latest version of @value{tramp}. You can fetch the latest
414updates from the repository by issuing the command: 432updates from the repository by issuing the command:
415 433
416@example 434@example
@@ -429,6 +447,11 @@ script:
429] @strong{autoconf} 447] @strong{autoconf}
430@end example 448@end example
431 449
450People who have no direct CVS access (maybe because sitting behind a
451blocking firewall), can try the
452@uref{http://savannah.gnu.org/cvs-backup/tramp-sources.tar.gz, Nightly
453CVS Tree Tarball} instead of.
454
432 455
433@node History 456@node History
434@chapter History of @value{tramp} 457@chapter History of @value{tramp}
@@ -445,7 +468,19 @@ file contents were added. Support for VC was added.
445 468
446The most recent addition of major features were the multi-hop methods 469The most recent addition of major features were the multi-hop methods
447added in April 2000 and the unification of @value{tramp} and Ange-FTP 470added in April 2000 and the unification of @value{tramp} and Ange-FTP
448filenames in July 2002. 471filenames in July 2002. In July 2004, multi-hop methods have been
472replaced by proxy hosts. Running commands on remote hosts was
473introduced in December 2005.
474@ifset emacsgw
475Support of gateways exists since April 2007.
476@end ifset
477
478In December 2001, @value{tramp} has been added to the XEmacs package
479repository. Being part of the GNU Emacs repository happened in June
4802002, the first release including @value{tramp} was GNU Emacs 22.1.
481
482@value{tramp} is also a GNU/Linux Debian package since February 2001.
483
449 484
450@c Installation chapter is necessary only in case of standalone 485@c Installation chapter is necessary only in case of standalone
451@c installation. Text taken from trampinst.texi. 486@c installation. Text taken from trampinst.texi.
@@ -462,7 +497,7 @@ filenames in July 2002.
462installed. It is initially configured to use the @command{scp} 497installed. It is initially configured to use the @command{scp}
463program to connect to the remote host. So in the easiest case, you 498program to connect to the remote host. So in the easiest case, you
464just type @kbd{C-x C-f} and then enter the filename 499just type @kbd{C-x C-f} and then enter the filename
465@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}. 500@file{@trampfnuhl{user, machine, /path/to.file}}.
466 501
467On some hosts, there are problems with opening a connection. These are 502On some hosts, there are problems with opening a connection. These are
468related to the behavior of the remote shell. See @xref{Remote shell 503related to the behavior of the remote shell. See @xref{Remote shell
@@ -482,14 +517,20 @@ Method}.
482* Connection types:: Types of connections made to remote machines. 517* Connection types:: Types of connections made to remote machines.
483* Inline methods:: Inline methods. 518* Inline methods:: Inline methods.
484* External transfer methods:: External transfer methods. 519* External transfer methods:: External transfer methods.
485* Multi-hop Methods:: Connecting to a remote host using multiple hops. 520@ifset emacsgw
521* Gateway methods:: Gateway methods.
522@end ifset
486* Default Method:: Selecting a default method. 523* Default Method:: Selecting a default method.
487 Here we also try to help those who 524 Here we also try to help those who
488 don't have the foggiest which method 525 don't have the foggiest which method
489 is right for them. 526 is right for them.
527* Default User:: Selecting a default user.
528* Default Host:: Selecting a default host.
529* Multi-hops:: Connecting to a remote host using multiple hops.
490* Customizing Methods:: Using Non-Standard Methods. 530* Customizing Methods:: Using Non-Standard Methods.
491* Customizing Completion:: Selecting config files for user/host name completion. 531* Customizing Completion:: Selecting config files for user/host name completion.
492* Password caching:: Reusing passwords for several connections. 532* Password caching:: Reusing passwords for several connections.
533* Connection caching:: Reusing connection related information.
493* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. 534* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine.
494* Remote shell setup:: Remote shell setup hints. 535* Remote shell setup:: Remote shell setup hints.
495* Windows setup hints:: Issues with Cygwin ssh. 536* Windows setup hints:: Issues with Cygwin ssh.
@@ -508,7 +549,7 @@ remote shell access program such as @command{rsh}, @command{ssh} or
508 549
509This connection is used to perform many of the operations that @value{tramp} 550This connection is used to perform many of the operations that @value{tramp}
510requires to make the remote file system transparently accessible from 551requires to make the remote file system transparently accessible from
511the local machine. It is only when visiting files that the methods 552the local machine. It is only when visiting files that the methods
512differ. 553differ.
513 554
514@cindex inline methods 555@cindex inline methods
@@ -519,7 +560,7 @@ differ.
519@cindex methods, external transfer 560@cindex methods, external transfer
520@cindex methods, out-of-band 561@cindex methods, out-of-band
521Loading or saving a remote file requires that the content of the file 562Loading or saving a remote file requires that the content of the file
522be transfered between the two machines. The content of the file can be 563be transfered between the two machines. The content of the file can be
523transfered over the same connection used to log in to the remote 564transfered over the same connection used to log in to the remote
524machine or the file can be transfered through another connection using 565machine or the file can be transfered through another connection using
525a remote copy program such as @command{rcp}, @command{scp} or 566a remote copy program such as @command{rcp}, @command{scp} or
@@ -539,16 +580,10 @@ startup may drown out the improvement in file transfer times.
539 580
540External transfer methods should be configured such a way that they 581External transfer methods should be configured such a way that they
541don't require a password (with @command{ssh-agent}, or such alike). 582don't require a password (with @command{ssh-agent}, or such alike).
542If it isn't possible, you should consider @ref{Password caching}, 583Modern @command{scp} implementations offer options to reuse existing
543otherwise you will be prompted for a password every copy action. 584@command{ssh} connections, see method @command{scpc}. If it isn't
544 585possible, you should consider @ref{Password caching}, otherwise you
545@cindex multi-hop methods 586will be prompted for a password every copy action.
546@cindex methods, multi-hop
547A variant of the inline methods are the @dfn{multi-hop methods}.
548These methods allow you to connect a remote host using a number `hops',
549each of which connects to a different host. This is useful if you are
550in a secured network where you need to go through a bastion host to
551connect to the outside world.
552 587
553 588
554@node Inline methods 589@node Inline methods
@@ -635,6 +670,8 @@ as the @option{rsh} method.
635 670
636This method does not connect to a remote host at all, rather it uses 671This method does not connect to a remote host at all, rather it uses
637the @command{su} program to allow you to edit files as another user. 672the @command{su} program to allow you to edit files as another user.
673With other words, a specified host name in the file name is silently
674ignored.
638 675
639 676
640@item @option{sudo} 677@item @option{sudo}
@@ -682,7 +719,7 @@ This supports the @samp{-p} kludge.
682 719
683@item @option{krlogin} 720@item @option{krlogin}
684@cindex method krlogin 721@cindex method krlogin
685@cindex km krlogin 722@cindex krlogin method
686@cindex Kerberos (with krlogin method) 723@cindex Kerberos (with krlogin method)
687 724
688This method is also similar to @option{ssh}. It only uses the 725This method is also similar to @option{ssh}. It only uses the
@@ -697,18 +734,43 @@ This method is mostly interesting for Windows users using the PuTTY
697implementation of SSH. It uses @samp{plink -ssh} to log in to the 734implementation of SSH. It uses @samp{plink -ssh} to log in to the
698remote host. 735remote host.
699 736
700Additionally, the method @option{plink1} is provided, which calls 737This supports the @samp{-P} kludge.
701@samp{plink -1 -ssh} in order to use SSH protocol version 1 738
702explicitly. 739Additionally, the methods @option{plink1} and @option{plink2} are
740provided, which call @samp{plink -1 -ssh} or @samp{plink -2 -ssh} in
741order to use SSH protocol version 1 or 2 explicitly.
703 742
704CCC: Do we have to connect to the remote host once from the command 743CCC: Do we have to connect to the remote host once from the command
705line to accept the SSH key? Maybe this can be made automatic? 744line to accept the SSH key? Maybe this can be made automatic?
706 745
707CCC: Does @command{plink} support the @samp{-p} option? @value{tramp} will 746CCC: Say something about the first shell command failing. This might
708support that, anyway. 747be due to a wrong setting of @code{tramp-rsh-end-of-line}.
709 748
710@end table
711 749
750@item @option{plinkx}
751@cindex method plinkx
752@cindex plinkx method
753
754Another method using PuTTY on Windows. Instead of host names, it
755expects PuTTY session names, calling @samp{plink -load @var{session}
756-t"}. User names are relevant only in case the corresponding session
757hasn't defined a user name. Different port numbers must be defined in
758the session.
759
760
761@item @option{fish}
762@cindex method fish
763@cindex fish method
764
765This is an experimental implementation of the fish protocol, known from
766the GNU Midnight Commander or the KDE Konqueror. @value{tramp} expects
767the fish server implementation from the KDE kioslave. That means, the
768file @file{~/.fishsrv.pl} is expected to reside on the remote host.
769
770The implementation lacks good performance. The code is offered anyway,
771maybe somebody can improve the performance.
772
773@end table
712 774
713 775
714@node External transfer methods 776@node External transfer methods
@@ -725,21 +787,10 @@ transfers to an external transfer utility.
725This saves the overhead of encoding and decoding that multiplexing the 787This saves the overhead of encoding and decoding that multiplexing the
726transfer through the one connection has with the inline methods. 788transfer through the one connection has with the inline methods.
727 789
728If you want to use an external transfer method you should be able to 790Since external transfer methods need their own overhead opening a new
729execute the transfer utility to copy files to and from the remote 791channel, all files which are smaller than @var{tramp-copy-size-limit}
730machine without any interaction. 792are still transferred with the corresponding inline method. It should
731 793provide a fair trade-off between both approaches.
732@cindex ssh-agent
733This means that you will need to use @command{ssh-agent} if you use the
734@command{scp} program for transfers, or maybe your version of
735@command{scp} accepts a password on the command line.@footnote{PuTTY's
736@command{pscp} allows you to specify the password on the command line.}
737If you use @command{rsync} via @command{ssh} then the same rule must
738apply to that connection.
739
740If you cannot get an external method to run without asking for a
741password you should consider @ref{Password caching}.
742
743 794
744@table @asis 795@table @asis
745@item @option{rcp} --- @command{rsh} and @command{rcp} 796@item @option{rcp} --- @command{rsh} and @command{rcp}
@@ -767,7 +818,7 @@ Using @command{ssh} to connect to the remote host and @command{scp} to
767transfer files between the machines is the best method for securely 818transfer files between the machines is the best method for securely
768connecting to a remote machine and accessing files. 819connecting to a remote machine and accessing files.
769 820
770The performance of this option is also quite good. It may be slower than 821The performance of this option is also quite good. It may be slower than
771the inline methods when you often open and close small files however. 822the inline methods when you often open and close small files however.
772The cost of the cryptographic handshake at the start of an @command{scp} 823The cost of the cryptographic handshake at the start of an @command{scp}
773session can begin to absorb the advantage that the lack of encoding and 824session can begin to absorb the advantage that the lack of encoding and
@@ -787,7 +838,24 @@ know what these are, you do not need these options.
787All the @command{ssh} based methods support the kludgy @samp{-p} 838All the @command{ssh} based methods support the kludgy @samp{-p}
788feature where you can specify a port number to connect to in the host 839feature where you can specify a port number to connect to in the host
789name. For example, the host name @file{host#42} tells @value{tramp} to 840name. For example, the host name @file{host#42} tells @value{tramp} to
790specify @samp{-p 42} in the argument list for @command{ssh}. 841specify @samp{-p 42} in the argument list for @command{ssh}, and to
842specify @samp{-P 42} in the argument list for @command{scp}.
843
844
845@item @option{sftp} --- @command{ssh} and @command{sftp}
846@cindex method sftp
847@cindex sftp method
848@cindex sftp (with sftp method)
849@cindex ssh (with sftp method)
850
851That is mostly the same method as @option{scp}, but using
852@command{sftp} as transfer command. So the same remarks are valid.
853
854This command does not work like @value{ftppackagename}, where
855@command{ftp} is called interactively, and all commands are send from
856within this session. Instead of, @command{ssh} is used for login.
857
858This method supports the @samp{-p} hack.
791 859
792 860
793@item @option{rsync} --- @command{ssh} and @command{rsync} 861@item @option{rsync} --- @command{ssh} and @command{rsync}
@@ -805,7 +873,7 @@ transferring files that exist on both hosts, this advantage is lost if
805the file exists only on one side of the connection. 873the file exists only on one side of the connection.
806 874
807The @command{rsync} based method may be considerably faster than the 875The @command{rsync} based method may be considerably faster than the
808@command{rcp} based methods when writing to the remote system. Reading 876@command{rcp} based methods when writing to the remote system. Reading
809files to the local machine is no faster than with a direct copy. 877files to the local machine is no faster than with a direct copy.
810 878
811This method supports the @samp{-p} hack. 879This method supports the @samp{-p} hack.
@@ -866,7 +934,22 @@ This method is similar to @option{scp}, but it uses the
866@command{pscp} for transferring the files. These programs are part 934@command{pscp} for transferring the files. These programs are part
867of PuTTY, an SSH implementation for Windows. 935of PuTTY, an SSH implementation for Windows.
868 936
869CCC: Does @command{plink} support the @samp{-p} hack? 937This method supports the @samp{-P} hack.
938
939
940@item @option{psftp} --- @command{plink} and @command{psftp}
941@cindex method psftp
942@cindex psftp method
943@cindex psftp (with psftp method)
944@cindex plink (with psftp method)
945@cindex PuTTY (with psftp method)
946
947As you would expect, this method is similar to @option{sftp}, but it
948uses the @command{plink} command to connect to the remote host, and it
949uses @command{psftp} for transferring the files. These programs are
950part of PuTTY, an SSH implementation for Windows.
951
952This method supports the @samp{-P} hack.
870 953
871 954
872@item @option{fcp} --- @command{fsh} and @command{fcp} 955@item @option{fcp} --- @command{fsh} and @command{fcp}
@@ -901,7 +984,7 @@ anyway.
901@cindex method ftp 984@cindex method ftp
902@cindex ftp method 985@cindex ftp method
903 986
904This is not a native @value{tramp} method. Instead of, it forwards all 987This is not a native @value{tramp} method. Instead of, it forwards all
905requests to @value{ftppackagename}. 988requests to @value{ftppackagename}.
906@ifset xemacs 989@ifset xemacs
907This works only for unified filenames, see @ref{Issues}. 990This works only for unified filenames, see @ref{Issues}.
@@ -935,8 +1018,15 @@ specify a user name which looks like @code{user%domain} (the real user
935name, then a percent sign, then the domain name). So, to connect to 1018name, then a percent sign, then the domain name). So, to connect to
936the machine @code{melancholia} as user @code{daniel} of the domain 1019the machine @code{melancholia} as user @code{daniel} of the domain
937@code{BIZARRE}, and edit @file{.emacs} in the home directory (share 1020@code{BIZARRE}, and edit @file{.emacs} in the home directory (share
938@code{daniel$}) I would specify the filename 1021@code{daniel$}) I would specify the filename @file{@trampfn{smb,
939@file{@value{prefix}smb@value{postfixsinglehop}daniel%BIZARRE@@melancholia@value{postfix}/daniel$$/.emacs}. 1022daniel%BIZARRE, melancholia, /daniel$$/.emacs}}.
1023
1024Depending on the Windows domain configuration, a Windows user might be
1025considered as domain user per default. In order to connect as local
1026user, the WINS name of that machine must be given as domain name.
1027Usually, it is the machine name in capital letters. In the example
1028above, the local user @code{daniel} would be specified as
1029@file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}.
940 1030
941The domain name as well as the user name are optional. If no user 1031The domain name as well as the user name are optional. If no user
942name is specified at all, the anonymous user (without password 1032name is specified at all, the anonymous user (without password
@@ -953,97 +1043,56 @@ name.
953 1043
954@end table 1044@end table
955 1045
956@node Multi-hop Methods
957@section Connecting to a remote host using multiple hops
958@cindex multi-hop methods
959@cindex methods, multi-hop
960 1046
961Sometimes, the methods described before are not sufficient. Sometimes, 1047@ifset emacsgw
962it is not possible to connect to a remote host using a simple command. 1048@node Gateway methods
963For example, if you are in a secured network, you might have to log in 1049@section Gateway methods
964to a `bastion host' first before you can connect to the outside world. 1050@cindex methods, gateway
965Of course, the target host may also require a bastion host. The format 1051@cindex gateway methods
966of multi-hop filenames is slightly different than the format of normal
967@value{tramp} methods.
968
969@cindex method multi
970@cindex multi method
971A multi-hop file name specifies a method, a number of hops, and a
972localname (path name on the remote system). The method name is always
973@option{multi}.
974
975Each hop consists of a @dfn{hop method} specification, a user name and
976a host name. The hop method can be an inline method only. The
977following hop methods are (currently) available:
978
979@table @option
980@item telnet
981@cindex hop method telnet
982@cindex telnet hop method
983
984Uses the well-known @command{telnet} program to connect to the host.
985Whereas user name and host name are supplied in the file name, the
986user is queried for the password.
987
988@item rsh
989@cindex hop method rsh
990@cindex rsh hop method
991
992This uses @command{rsh} to connect to the host. You do not need to
993enter a password unless @command{rsh} explicitly asks for it.
994
995The variant @option{remsh} uses the @command{remsh} command. It
996should be applied on machines where @command{remsh} is used instead of
997@command{rsh}.
998
999@item ssh
1000@cindex hop method ssh
1001@cindex ssh hop method
1002
1003This uses @command{ssh} to connect to the host. You might have to enter
1004a password or a pass phrase.
1005
1006@item su
1007@cindex hop method su
1008@cindex su hop method
1009
1010This method does not actually contact a different host, but it allows
1011you to become a different user on the host you're currently on. This
1012might be useful if you want to edit files as root, but the remote host
1013does not allow remote root logins. In this case you can use
1014@option{telnet}, @option{rsh} or @option{ssh} to connect to the
1015remote host as a non-root user, then use an @option{su} hop to become
1016root. But @option{su} need not be the last hop in a sequence, you could
1017also use it somewhere in the middle, if the need arises.
1018
1019Even though you @emph{must} specify both user and host with an
1020@option{su} hop, the host name is ignored and only the user name is
1021used.
1022
1023@item sudo
1024@cindex hop method sudo
1025@cindex sudo hop method
1026
1027This is similar to the @option{su} hop, except that it uses
1028@command{sudo} rather than @command{su} to become a different user.
1029 1052
1030@end table 1053Gateway methods are not methods to access a remote host directly.
1054These methods are intended to pass firewalls or proxy servers.
1055Therefore, they can be used for proxy host declarations
1056(@pxref{Multi-hops}) only.
1031 1057
1032Some people might wish to use port forwarding with @command{ssh} or 1058A gateway method must come always along with a method who supports
1033maybe they have to use a nonstandard port. This can be accomplished 1059port setting (referred to as @samp{-p} kludge). This is because
1034by putting a stanza in @file{~/.ssh/config} for the account which 1060@value{tramp} targets the accompanied method to
1035specifies a different port number for a certain host name. But it can 1061@file{localhost#random_port}, from where the firewall or proxy server
1036also be accomplished within @value{tramp}, by adding a multi-hop method. 1062is accessed to.
1037For example:
1038 1063
1039@lisp 1064Gateway methods support user name and password declarations. These
1040(add-to-list 1065are used to authenticate towards the corresponding firewall or proxy
1041 'tramp-multi-connection-function-alist 1066server. They can be passed only if your friendly administrator has
1042 '("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n")) 1067granted your access.
1043@end lisp 1068
1069@table @asis
1070@item @option{tunnel}
1071@cindex method tunnel
1072@cindex tunnel method
1073
1074This method implements an HTTP tunnel via the @command{CONNECT}
1075command (see RFC 2616, 2817). Any HTTP 1.1 compliant (proxy) server
1076shall support this command.
1077
1078As authentication method, only @option{Basic Authentication} (see RFC
10792617) is implemented so far. If no port number is given in the
1080declaration, port @option{8080} is used for the proxy server.
1081
1082
1083@item @option{socks}
1084@cindex method socks
1085@cindex socks method
1044 1086
1045Now you can use an @option{sshf} hop which connects to port 4400 instead of 1087The @command{socks} method provides access to SOCKSv5 servers (see
1046the standard port. 1088RFC 1928). @option{Username/Password Authentication} according to RFC
10891929 is supported.
1090
1091The default port number of the socks server is @option{1080}, if not
1092specified otherwise.
1093
1094@end table
1095@end ifset
1047 1096
1048 1097
1049@node Default Method 1098@node Default Method
@@ -1085,7 +1134,6 @@ methods, giving better performance.
1085 1134
1086@xref{Inline methods}. 1135@xref{Inline methods}.
1087@xref{External transfer methods}. 1136@xref{External transfer methods}.
1088@xref{Multi-hop Methods}.
1089 1137
1090Another consideration with the selection of transfer methods is the 1138Another consideration with the selection of transfer methods is the
1091environment you will use them in and, especially when used over the 1139environment you will use them in and, especially when used over the
@@ -1098,7 +1146,7 @@ read from other machines.
1098 1146
1099If you need to connect to remote systems that are accessible from the 1147If you need to connect to remote systems that are accessible from the
1100Internet, you should give serious thought to using @option{ssh} based 1148Internet, you should give serious thought to using @option{ssh} based
1101methods to connect. These provide a much higher level of security, 1149methods to connect. These provide a much higher level of security,
1102making it a non-trivial exercise for someone to obtain your password 1150making it a non-trivial exercise for someone to obtain your password
1103or read the content of the files you are editing. 1151or read the content of the files you are editing.
1104 1152
@@ -1119,9 +1167,9 @@ to edit mostly small files.
1119 1167
1120I guess that these days, most people can access a remote machine by 1168I guess that these days, most people can access a remote machine by
1121using @command{ssh}. So I suggest that you use the @option{ssh} 1169using @command{ssh}. So I suggest that you use the @option{ssh}
1122method. So, type @kbd{C-x C-f 1170method. So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost,
1123@value{prefix}ssh@value{postfixsinglehop}root@@otherhost@value{postfix}/etc/motd 1171/etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other
1124@key{RET}} to edit the @file{/etc/motd} file on the other host. 1172host.
1125 1173
1126If you can't use @option{ssh} to log in to the remote host, then 1174If you can't use @option{ssh} to log in to the remote host, then
1127select a method that uses a program that works. For instance, Windows 1175select a method that uses a program that works. For instance, Windows
@@ -1132,9 +1180,9 @@ implementation of @command{ssh}. Or you use Kerberos and thus like
1132For the special case of editing files on the local host as another 1180For the special case of editing files on the local host as another
1133user, see the @option{su} or @option{sudo} methods. They offer 1181user, see the @option{su} or @option{sudo} methods. They offer
1134shortened syntax for the @samp{root} account, like 1182shortened syntax for the @samp{root} account, like
1135@file{@value{prefix}su@value{postfixsinglehop}@value{postfix}/etc/motd}. 1183@file{@trampfnmhl{su, , /etc/motd}}.
1136 1184
1137People who edit large files may want to consider @option{scp} instead 1185People who edit large files may want to consider @option{scpc} instead
1138of @option{ssh}, or @option{pscp} instead of @option{plink}. These 1186of @option{ssh}, or @option{pscp} instead of @option{plink}. These
1139out-of-band methods are faster than inline methods for large files. 1187out-of-band methods are faster than inline methods for large files.
1140Note, however, that out-of-band methods suffer from some limitations. 1188Note, however, that out-of-band methods suffer from some limitations.
@@ -1143,6 +1191,205 @@ from using an out-of-band method! Maybe even for large files, inline
1143methods are fast enough. 1191methods are fast enough.
1144 1192
1145 1193
1194@node Default User
1195@section Selecting a default user
1196@cindex default user
1197
1198The user part of a @value{tramp} file name can be omitted. Usually,
1199it is replaced by the user name you are logged in. Often, this is not
1200what you want. A typical use of @value{tramp} might be to edit some
1201files with root permissions on the local host. This case, you should
1202set the variable @code{tramp-default-user} to reflect that choice.
1203For example:
1204
1205@lisp
1206(setq tramp-default-user "root")
1207@end lisp
1208
1209@code{tramp-default-user} is regarded as obsolete, and will be removed
1210soon.
1211
1212@vindex tramp-default-user-alist
1213You can also specify different users for certain method/host
1214combinations, via the variable @code{tramp-default-user-alist}. For
1215example, if you always have to use the user @samp{john} in the domain
1216@samp{somewhere.else}, you can specify the following:
1217
1218@lisp
1219(add-to-list 'tramp-default-user-alist
1220 '("ssh" ".*\\.somewhere\\.else\\'" "john"))
1221@end lisp
1222
1223@noindent
1224See the documentation for the variable
1225@code{tramp-default-user-alist} for more details.
1226
1227One trap to fall in must be known. If @value{tramp} finds a default
1228user, this user will be passed always to the connection command as
1229parameter (for example @samp{ssh here.somewhere.else -l john}. If you
1230have specified another user for your command in its configuration
1231files, @value{tramp} cannot know it, and the remote access will fail.
1232If you have specified in the given example in @file{~/.ssh/config} the
1233lines
1234
1235@example
1236Host here.somewhere.else
1237 User lily
1238@end example
1239
1240@noindent
1241than you must discard selecting a default user by @value{tramp}. This
1242will be done by setting it to @code{nil} (or @samp{lily}, likewise):
1243
1244@lisp
1245(add-to-list 'tramp-default-user-alist
1246 '("ssh" "\\`here\\.somewhere\\.else\\'" nil))
1247@end lisp
1248
1249The last entry in @code{tramp-default-user-alist} could be your
1250default user you'll apply predominantly. You shall @emph{append} it
1251to that list at the end:
1252
1253@lisp
1254(add-to-list 'tramp-default-user-alist '(nil nil "jonas") t)
1255@end lisp
1256
1257
1258@node Default Host
1259@section Selecting a default host
1260@cindex default host
1261
1262@vindex tramp-default-host
1263Finally, it is even possible to omit the host name part of a
1264@value{tramp} file name. This case, the value of the variable
1265@code{tramp-default-host} is used. Per default, it is initialized
1266with the host name your local @value{emacsname} is running.
1267
1268If you, for example, use @value{tramp} mainly to contact the host
1269@samp{target} as user @samp{john}, you can specify:
1270
1271@lisp
1272(setq tramp-default-user "john"
1273 tramp-default-host "target")
1274@end lisp
1275
1276Then the simple file name @samp{@trampfnmhl{ssh,,}} will connect you
1277to John's home directory on target.
1278@ifset emacs
1279Note, however, that the most simplification @samp{@trampfnmhl{,,}}
1280won't work, because @samp{/:} is the prefix for quoted file names.
1281@end ifset
1282
1283
1284@node Multi-hops
1285@section Connecting to a remote host using multiple hops
1286@cindex multi-hop
1287@cindex proxy hosts
1288
1289Sometimes, the methods described before are not sufficient. Sometimes,
1290it is not possible to connect to a remote host using a simple command.
1291For example, if you are in a secured network, you might have to log in
1292to a `bastion host' first before you can connect to the outside world.
1293Of course, the target host may also require a bastion host.
1294
1295@vindex tramp-default-proxies-alist
1296In order to specify such multiple hops, it is possible to define a proxy
1297host to pass through, via the variable
1298@code{tramp-default-proxies-alist}. This variable keeps a list of
1299triples (@var{host} @var{user} @var{proxy}).
1300
1301 The first matching item specifies the proxy host to be passed for a
1302file name located on a remote target matching @var{user}@@@var{host}.
1303@var{host} and @var{user} are regular expressions or @code{nil}, which
1304is interpreted as a regular expression which always matches.
1305
1306@var{proxy} must be a Tramp filename which localname part is ignored.
1307Method and user name on @var{proxy} are optional, which is interpreted
1308with the default values.
1309@ifset emacsgw
1310The method must be an inline or gateway method (@pxref{Inline
1311methods}, @pxref{Gateway methods}).
1312@end ifset
1313@ifclear emacsgw
1314The method must be an inline method (@pxref{Inline methods}).
1315@end ifclear
1316If @var{proxy} is @code{nil}, no additional hop is required reaching
1317@var{user}@@@var{host}.
1318
1319If you, for example, must pass the host @samp{bastion.your.domain} as
1320user @samp{bird} for any remote host which is not located in your local
1321domain, you can set
1322
1323@lisp
1324(add-to-list 'tramp-default-proxies-alist
1325 '("\\." nil "@trampfn{ssh, bird, bastion.your.domain,}"))
1326(add-to-list 'tramp-default-proxies-alist
1327 '("\\.your\\.domain\\'" nil nil))
1328@end lisp
1329
1330Please note the order of the code. @code{add-to-list} adds elements at the
1331beginning of a list. Therefore, most relevant rules must be added last.
1332
1333Proxy hosts can be cascaded. If there is another host called
1334@samp{jump.your.domain}, which is the only one in your local domain who
1335is allowed connecting @samp{bastion.your.domain}, you can add another
1336rule:
1337
1338@lisp
1339(add-to-list 'tramp-default-proxies-alist
1340 '("\\`bastion\\.your\\.domain\\'"
1341 "\\`bird\\'"
1342 "@trampfnmhl{ssh, jump.your.domain,}"))
1343@end lisp
1344
1345@var{proxy} can contain the patterns @code{%h} or @code{%u}. These
1346patterns are replaced by the strings matching @var{host} or
1347@var{user}, respectively.
1348
1349If you, for example, wants to work as @samp{root} on hosts in the
1350domain @samp{your.domain}, but login as @samp{root} is disabled for
1351non-local access, you might add the following rule:
1352
1353@lisp
1354(add-to-list 'tramp-default-proxies-alist
1355 '("\\.your\\.domain\\'" "\\`root\\'" "@trampfnmhl{ssh, %h,}"))
1356@end lisp
1357
1358Opening @file{@trampfnmhl{sudo, randomhost.your.domain,}} would
1359connect first @samp{randomhost.your.domain} via @code{ssh} under your
1360account name, and perform @code{sudo -u root} on that host afterwards.
1361It is important to know that the given method is applied on the host
1362which has been reached so far. @code{sudo -u root}, applied on your
1363local host, wouldn't be useful here.
1364
1365This is the recommended configuration to work as @samp{root} on remote
1366Ubuntu hosts.
1367
1368@ifset emacsgw
1369Finally, @code{tramp-default-proxies-alist} can be used to pass
1370firewalls or proxy servers. Imagine your local network has a host
1371@samp{proxy.your.domain} which is used on port 3128 as HTTP proxy to
1372the outer world. Your friendly administrator has granted you access
1373under your user name to @samp{host.other.domain} on that proxy
1374server.@footnote{HTTP tunnels are intended for secure SSL/TLS
1375communication. Therefore, many proxy server restrict the tunnels to
1376related target ports. You might need to run your ssh server on your
1377target host @samp{host.other.domain} on such a port, like 443 (https).
1378See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall}
1379for discussion of ethical issues.} You would need to add the
1380following rule:
1381
1382@lisp
1383(add-to-list 'tramp-default-proxies-alist
1384 '("\\`host\\.other\\.domain\\'" nil
1385 "@trampfnmhl{tunnel, proxy.your.domain#3128,}"))
1386@end lisp
1387
1388Gateway methods can be declared as first hop only in a multiple hop
1389chain.
1390@end ifset
1391
1392
1146@node Customizing Methods 1393@node Customizing Methods
1147@section Using Non-Standard Methods 1394@section Using Non-Standard Methods
1148@cindex customizing methods 1395@cindex customizing methods
@@ -1263,8 +1510,8 @@ you might provide such a function as well. This function must meet
1263the following conventions: 1510the following conventions:
1264 1511
1265@defun my-tramp-parse file 1512@defun my-tramp-parse file
1266@var{file} must be either a file name on your host, or @code{nil}. The 1513@var{file} must be either a file name on your host, or @code{nil}.
1267function must return a list of (@var{user} @var{host}), which are 1514The function must return a list of (@var{user} @var{host}), which are
1268taken as candidates for user and host name completion. 1515taken as candidates for user and host name completion.
1269 1516
1270Example: 1517Example:
@@ -1309,16 +1556,44 @@ can be disabled totally by customizing the variable
1309@code{password-cache} (setting it to @code{nil}). 1556@code{password-cache} (setting it to @code{nil}).
1310 1557
1311Implementation Note: password caching is based on the package 1558Implementation Note: password caching is based on the package
1312password.el in No Gnus. For the time being, it is activated only when 1559@file{password.el} in No Gnus. For the time being, it is activated
1313this package is seen in the @code{load-path} while loading @value{tramp}. 1560only when this package is seen in the @code{load-path} while loading
1561@value{tramp}.
1314@ifset installchapter 1562@ifset installchapter
1315If you don't use No Gnus, you can take password.el from the @value{tramp} 1563If you don't use No Gnus, you can take @file{password.el} from the
1316@file{contrib} directory, see @ref{Installation parameters}. 1564@value{tramp} @file{contrib} directory, see @ref{Installation
1565parameters}.
1317@end ifset 1566@end ifset
1318It will be activated mandatory once No Gnus has found its way into 1567It will be activated mandatory once No Gnus has found its way into
1319@value{emacsname}. 1568@value{emacsname}.
1320 1569
1321 1570
1571@node Connection caching
1572@section Reusing connection related information.
1573@cindex caching
1574
1575@vindex tramp-persistency-file-name
1576In order to reduce initial connection time, @value{tramp} stores
1577connection related information persistently. The variable
1578@code{tramp-persistency-file-name} keeps the file name where these
1579information are written. Its default value is
1580@ifset emacs
1581@file{~/.emacs.d/tramp}.
1582@end ifset
1583@ifset xemacs
1584@file{~/.xemacs/tramp}.
1585@end ifset
1586It is recommended to choose a local file name.
1587
1588@value{tramp} reads this file during startup, and writes it when
1589exiting @value{emacsname}. You can simply remove this file if
1590@value{tramp} shall be urged to recompute these information next
1591@value{emacsname} startup time.
1592
1593Using such persistent information can be disabled by setting
1594@code{tramp-persistency-file-name} to @code{nil}.
1595
1596
1322@node Remote Programs 1597@node Remote Programs
1323@section How @value{tramp} finds and uses programs on the remote machine. 1598@section How @value{tramp} finds and uses programs on the remote machine.
1324 1599
@@ -1327,25 +1602,32 @@ function, including @command{ls}, @command{test}, @command{find} and
1327@command{cat}. 1602@command{cat}.
1328 1603
1329In addition to these required tools, there are various tools that may be 1604In addition to these required tools, there are various tools that may be
1330required based on the connection method. See @ref{Inline methods} and 1605required based on the connection method. See @ref{Inline methods} and
1331@ref{External transfer methods} for details on these. 1606@ref{External transfer methods} for details on these.
1332 1607
1333Certain other tools, such as @command{perl} (or @command{perl5}) and 1608Certain other tools, such as @command{perl} (or @command{perl5}) and
1334@command{grep} will be used if they can be found. When they are 1609@command{grep} will be used if they can be found. When they are
1335available, they are used to improve the performance and accuracy of 1610available, they are used to improve the performance and accuracy of
1336remote file access. 1611remote file access.
1337 1612
1338@vindex tramp-remote-path 1613@vindex tramp-remote-path
1339When @value{tramp} connects to the remote machine, it searches for the 1614When @value{tramp} connects to the remote machine, it searches for the
1340programs that it can use. The variable @var{tramp-remote-path} controls 1615programs that it can use. The variable @code{tramp-remote-path}
1341the directories searched on the remote machine. 1616controls the directories searched on the remote machine.
1342 1617
1343By default, this is set to a reasonable set of defaults for most 1618By default, this is set to a reasonable set of defaults for most
1344machines. It is possible, however, that your local (or remote ;) system 1619machines. The symbol @code{tramp-default-remote-path} is a place
1620holder, it is replaced by the list of directories received via the
1621command @command{getconf PATH} on your remote machine. For example,
1622on GNU Debian this is @file{/bin:/usr/bin}, whereas on Solaris this is
1623@file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}. It is
1624recommended to apply this symbol on top of @code{tramp-remote-path}.
1625
1626It is possible, however, that your local (or remote ;) system
1345administrator has put the tools you want in some obscure local 1627administrator has put the tools you want in some obscure local
1346directory. 1628directory.
1347 1629
1348In this case, you can still use them with @value{tramp}. You simply need to 1630In this case, you can still use them with @value{tramp}. You simply need to
1349add code to your @file{.emacs} to add the directory to the remote path. 1631add code to your @file{.emacs} to add the directory to the remote path.
1350This will then be searched by @value{tramp} when you connect and the software 1632This will then be searched by @value{tramp} when you connect and the software
1351found. 1633found.
@@ -1433,20 +1715,37 @@ circumstances.
1433 1715
1434Some people invoke the @command{tset} program from their shell startup 1716Some people invoke the @command{tset} program from their shell startup
1435scripts which asks the user about the terminal type of the shell. 1717scripts which asks the user about the terminal type of the shell.
1436Maybe some shells ask other questions when they are started. @value{tramp} 1718Maybe some shells ask other questions when they are started.
1437does not know how to answer these questions. There are two approaches 1719@value{tramp} does not know how to answer these questions. There are
1438for dealing with this problem. One approach is to take care that the 1720two approaches for dealing with this problem. One approach is to take
1439shell does not ask any questions when invoked from @value{tramp}. You can 1721care that the shell does not ask any questions when invoked from
1440do this by checking the @code{TERM} environment variable, it will be 1722@value{tramp}. You can do this by checking the @code{TERM}
1441set to @code{dumb} when connecting. 1723environment variable, it will be set to @code{dumb} when connecting.
1442 1724
1443@vindex tramp-terminal-type 1725@vindex tramp-terminal-type
1444The variable @code{tramp-terminal-type} can be used to change this value 1726The variable @code{tramp-terminal-type} can be used to change this value
1445to @code{dumb}. 1727to @code{dumb}.
1446 1728
1729@vindex tramp-actions-before-shell
1447The other approach is to teach @value{tramp} about these questions. See 1730The other approach is to teach @value{tramp} about these questions. See
1448the variables @code{tramp-actions-before-shell} and 1731the variable @code{tramp-actions-before-shell}. Example:
1449@code{tramp-multi-actions} (for multi-hop connections). 1732
1733@lisp
1734(defconst my-tramp-prompt-regexp
1735 (concat (regexp-opt '("Enter the birth date of your mother:") t)
1736 "\\s-*")
1737 "Regular expression matching my login prompt question.")
1738
1739(defun my-tramp-action (proc vec)
1740 "Enter \"19000101\" in order to give a correct answer."
1741 (save-window-excursion
1742 (with-current-buffer (tramp-get-connection-buffer vec)
1743 (tramp-message vec 6 "\n%s" (buffer-string))
1744 (tramp-send-string vec "19000101"))))
1745
1746(add-to-list 'tramp-actions-before-shell
1747 '(my-tramp-prompt-regexp my-tramp-action))
1748@end lisp
1450 1749
1451 1750
1452@item Environment variables named like users in @file{.profile} 1751@item Environment variables named like users in @file{.profile}
@@ -1484,10 +1783,10 @@ of the single character tilde, strange things will happen.
1484 1783
1485What can you do about this? 1784What can you do about this?
1486 1785
1487Well, one possibility is to make sure that everything in @file{~/.shrc} 1786Well, one possibility is to make sure that everything in
1488and @file{~/.profile} on all remote hosts is Bourne-compatible. In the 1787@file{~/.shrc} and @file{~/.profile} on all remote hosts is
1489above example, instead of @command{export FOO=bar}, you might use 1788Bourne-compatible. In the above example, instead of @command{export
1490@command{FOO=bar; export FOO} instead. 1789FOO=bar}, you might use @command{FOO=bar; export FOO} instead.
1491 1790
1492The other possibility is to put your non-Bourne shell setup into some 1791The other possibility is to put your non-Bourne shell setup into some
1493other files. For example, bash reads the file @file{~/.bash_profile} 1792other files. For example, bash reads the file @file{~/.bash_profile}
@@ -1528,13 +1827,13 @@ variable
1528@ifset xemacs 1827@ifset xemacs
1529@code{bkup-backup-directory-info}. 1828@code{bkup-backup-directory-info}.
1530@end ifset 1829@end ifset
1531In connection with @value{tramp}, this can have unexpected side effects. 1830In connection with @value{tramp}, this can have unexpected side
1532Suppose that you specify that all backups should go to the directory 1831effects. Suppose that you specify that all backups should go to the
1533@file{~/.emacs.d/backups/}, and then you edit the file 1832directory @file{~/.emacs.d/backups/}, and then you edit the file
1534@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile}. 1833@file{@trampfn{su, root, localhost, /etc/secretfile}}. The effect is
1535The effect is that the backup file will be owned by you and not by 1834that the backup file will be owned by you and not by root, thus
1536root, thus possibly enabling others to see it even if they were not 1835possibly enabling others to see it even if they were not intended to
1537intended to see it. 1836see it.
1538 1837
1539When 1838When
1540@ifset emacs 1839@ifset emacs
@@ -1608,14 +1907,15 @@ Example:
1608@end ifset 1907@end ifset
1609 1908
1610@noindent 1909@noindent
1611The backup file name of 1910The backup file name of @file{@trampfn{su, root, localhost,
1612@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile} 1911/etc/secretfile}} would be
1613would be
1614@ifset emacs 1912@ifset emacs
1615@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~} 1913@file{@trampfn{su, root, localhost,
1914~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
1616@end ifset 1915@end ifset
1617@ifset xemacs 1916@ifset xemacs
1618@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~} 1917@file{@trampfn{su, root, localhost,
1918~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
1619@end ifset 1919@end ifset
1620 1920
1621The same problem can happen with auto-saving files. 1921The same problem can happen with auto-saving files.
@@ -1669,8 +1969,8 @@ can find information about setting up Cygwin in their FAQ at
1669If you wish to use the @option{scpx} connection method, then you might 1969If you wish to use the @option{scpx} connection method, then you might
1670have the problem that @value{emacsname} calls @command{scp} with a 1970have the problem that @value{emacsname} calls @command{scp} with a
1671Windows filename such as @code{c:/foo}. The Cygwin version of 1971Windows filename such as @code{c:/foo}. The Cygwin version of
1672@command{scp} does not know about Windows filenames and interprets this 1972@command{scp} does not know about Windows filenames and interprets
1673as a remote filename on the host @code{c}. 1973this as a remote filename on the host @code{c}.
1674 1974
1675One possible workaround is to write a wrapper script for @option{scp} 1975One possible workaround is to write a wrapper script for @option{scp}
1676which converts the Windows filename to a Cygwinized filename. 1976which converts the Windows filename to a Cygwinized filename.
@@ -1696,9 +1996,9 @@ know anything at all about Windows@dots{}
1696@chapter Using @value{tramp} 1996@chapter Using @value{tramp}
1697@cindex using @value{tramp} 1997@cindex using @value{tramp}
1698 1998
1699Once you have installed @value{tramp} it will operate fairly transparently. You 1999Once you have installed @value{tramp} it will operate fairly
1700will be able to access files on any remote machine that you can log in 2000transparently. You will be able to access files on any remote machine
1701to as though they were local. 2001that you can log in to as though they were local.
1702 2002
1703Files are specified to @value{tramp} using a formalized syntax specifying the 2003Files are specified to @value{tramp} using a formalized syntax specifying the
1704details of the system to connect to. This is similar to the syntax used 2004details of the system to connect to. This is similar to the syntax used
@@ -1717,10 +2017,9 @@ minute you have already forgotten that you hit that key!
1717 2017
1718@menu 2018@menu
1719* Filename Syntax:: @value{tramp} filename conventions. 2019* Filename Syntax:: @value{tramp} filename conventions.
1720* Multi-hop filename syntax:: Multi-hop filename conventions. 2020* Alternative Syntax:: URL-like filename syntax.
1721* Filename completion:: Filename completion. 2021* Filename completion:: Filename completion.
1722* Dired:: Dired. 2022* Remote processes:: Integration with other @value{emacsname} packages (@sc{experimental}).
1723* Compilation:: Compile remote files.
1724@end menu 2023@end menu
1725 2024
1726 2025
@@ -1729,123 +2028,107 @@ minute you have already forgotten that you hit that key!
1729@cindex filename syntax 2028@cindex filename syntax
1730@cindex filename examples 2029@cindex filename examples
1731 2030
1732To access the file @var{localname} on the remote machine @var{machine} you 2031To access the file @var{localname} on the remote machine @var{machine}
1733would specify the filename 2032you would specify the filename @file{@trampfnhl{@var{machine},
1734@file{@value{prefix}@var{machine}@value{postfix}@var{localname}}. 2033@var{localname}}}. This will connect to @var{machine} and transfer
1735This will connect to @var{machine} and transfer the file using the 2034the file using the default method. @xref{Default Method}.
1736default method. @xref{Default Method}.
1737 2035
1738Some examples of @value{tramp} filenames are shown below. 2036Some examples of @value{tramp} filenames are shown below.
1739 2037
1740@table @file 2038@table @file
1741@item @value{prefix}melancholia@value{postfix}.emacs 2039@item @trampfnhl{melancholia, .emacs}
1742Edit the file @file{.emacs} in your home directory on the machine 2040Edit the file @file{.emacs} in your home directory on the machine
1743@code{melancholia}. 2041@code{melancholia}.
1744 2042
1745@item @value{prefix}melancholia.danann.net@value{postfix}.emacs 2043@item @trampfnhl{melancholia.danann.net, .emacs}
1746This edits the same file, using the fully qualified domain name of 2044This edits the same file, using the fully qualified domain name of
1747the machine. 2045the machine.
1748 2046
1749@item @value{prefix}melancholia@value{postfix}~/.emacs 2047@item @trampfnhl{melancholia, ~/.emacs}
1750This also edits the same file --- the @file{~} is expanded to your 2048This also edits the same file --- the @file{~} is expanded to your
1751home directory on the remote machine, just like it is locally. 2049home directory on the remote machine, just like it is locally.
1752 2050
1753@item @value{prefix}melancholia@value{postfix}~daniel/.emacs 2051@item @trampfnhl{melancholia, ~daniel/.emacs}
1754This edits the file @file{.emacs} in the home directory of the user 2052This edits the file @file{.emacs} in the home directory of the user
1755@code{daniel} on the machine @code{melancholia}. The @file{~<user>} 2053@code{daniel} on the machine @code{melancholia}. The @file{~<user>}
1756construct is expanded to the home directory of that user on the remote 2054construct is expanded to the home directory of that user on the remote
1757machine. 2055machine.
1758 2056
1759@item @value{prefix}melancholia@value{postfix}/etc/squid.conf 2057@item @trampfnhl{melancholia, /etc/squid.conf}
1760This edits the file @file{/etc/squid.conf} on the machine 2058This edits the file @file{/etc/squid.conf} on the machine
1761@code{melancholia}. 2059@code{melancholia}.
1762 2060
1763@end table 2061@end table
1764 2062
1765Unless you specify a different name to use, @value{tramp} will use the 2063Unless you specify a different name to use, @value{tramp} will use the
1766current local user name as the remote user name to log in with. If you 2064current local user name as the remote user name to log in with. If you
1767need to log in as a different user, you can specify the user name as 2065need to log in as a different user, you can specify the user name as
1768part of the filename. 2066part of the filename.
1769 2067
1770To log in to the remote machine as a specific user, you use the syntax 2068To log in to the remote machine as a specific user, you use the syntax
1771@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}/@var{path/to.file}}. 2069@file{@trampfnuhl{@var{user}, @var{machine}, @var{path/to.file}}}.
1772That means that connecting to @code{melancholia} as @code{daniel} and 2070That means that connecting to @code{melancholia} as @code{daniel} and
1773editing @file{.emacs} in your home directory you would specify 2071editing @file{.emacs} in your home directory you would specify
1774@file{@value{prefix}daniel@@melancholia@value{postfix}.emacs}. 2072@file{@trampfnuhl{daniel, melancholia, .emacs}}.
1775 2073
1776It is also possible to specify other file transfer methods 2074It is also possible to specify other file transfer methods
1777(@pxref{Default Method}) as part of the filename. 2075(@pxref{Default Method}) as part of the filename.
1778@ifset emacs 2076@ifset emacs
1779This is done by putting the method before the user and host name, as 2077This is done by putting the method before the user and host name, as
1780in 2078in @file{@value{prefix}@var{method}@value{postfixhop}} (Note the
1781@file{@value{prefix}@var{method}@value{postfixsinglehop}} 2079trailing colon).
1782(Note the trailing colon).
1783@end ifset 2080@end ifset
1784@ifset xemacs 2081@ifset xemacs
1785This is done by replacing the initial 2082This is done by replacing the initial @file{@value{prefix}} with
1786@file{@value{prefix}} with 2083@file{@value{prefix}<method>@value{postfixhop}}. (Note the trailing
1787@file{@value{prefix}<method>@value{postfixsinglehop}}. 2084slash!).
1788(Note the trailing slash!).
1789@end ifset 2085@end ifset
1790The user, machine and file specification remain the same. 2086The user, machine and file specification remain the same.
1791 2087
1792So, to connect to the machine @code{melancholia} as @code{daniel}, 2088So, to connect to the machine @code{melancholia} as @code{daniel},
1793using the @option{ssh} method to transfer files, and edit @file{.emacs} 2089using the @option{ssh} method to transfer files, and edit
1794in my home directory I would specify the filename 2090@file{.emacs} in my home directory I would specify the filename
1795@file{@value{prefix}ssh@value{postfixsinglehop}daniel@@melancholia@value{postfix}.emacs}. 2091@file{@trampfn{ssh, daniel, melancholia, .emacs}}.
1796
1797 2092
1798@node Multi-hop filename syntax
1799@section Multi-hop filename conventions
1800@cindex filename syntax for multi-hop files
1801@cindex multi-hop filename syntax
1802 2093
1803The syntax of multi-hop file names is necessarily slightly different 2094@node Alternative Syntax
1804than the syntax of other @value{tramp} file names. Here's an example 2095@section URL-like filename syntax
1805multi-hop file name: 2096@cindex filename syntax
2097@cindex filename examples
1806 2098
1807@example 2099Additionally to the syntax described in the previous chapter, it is
1808@value{prefix}multi@value{postfixsinglehop}rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host@value{postfix}/path/to.file 2100possible to use a URL-like syntax for @value{tramp}. This can be
1809@end example 2101switched on by customizing the variable @code{tramp-syntax}. Please
2102note that this feature is experimental for the time being.
1810 2103
1811This is quite a mouthful. So let's go through it step by step. The 2104The variable @code{tramp-syntax} must be set before requiring @value{tramp}:
1812file name consists of three parts.
1813@ifset emacs
1814The parts are separated by colons
1815@end ifset
1816@ifset xemacs
1817The parts are separated by slashes and square brackets.
1818@end ifset
1819The first part is @file{@value{prefix}multi}, the method
1820specification. The second part is
1821@file{rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host}
1822and specifies the hops. The final part is @file{/path/to.file} and
1823specifies the file name on the remote host.
1824 2105
1825The first part and the final part should be clear. See @ref{Multi-hop 2106@lisp
1826Methods}, for a list of alternatives for the method specification. 2107(setq tramp-syntax 'url)
2108(require 'tramp)
2109@end lisp
1827 2110
1828The second part can be subdivided again into components, so-called 2111Then, a @value{tramp} filename would look like this:
1829hops. In the above file name, there are two hops, 2112@file{/@var{method}://@var{user}@@@var{machine}:@var{port}/@var{path/to.file}}.
1830@file{rsh@value{postfixmultihop}out@@gate} and 2113@file{/@var{method}://} is mandatory, all other parts are optional.
1831@file{telnet@value{postfixmultihop}kai@@real.host}. 2114@file{:@var{port}} is useful for methods only who support this.
1832 2115
1833Each hop can @emph{again} be subdivided into (three) components, the 2116The last example from the previous section would look like this:
1834@dfn{hop method}, the @dfn{user name} and the @dfn{host name}. The 2117@file{/ssh://daniel@@melancholia/.emacs}.
1835meaning of the second and third component should be clear, and the hop
1836method says what program to use to perform that hop.
1837 2118
1838The first hop, @file{rsh@value{postfixmultihop}out@@gate}, 2119For the time being, @code{tramp-syntax} can have the following values:
1839says to use @command{rsh} to log in as user @code{out} to the host
1840@code{gate}. Starting at that host, the second hop,
1841@file{telnet@value{postfixmultihop}kai@@real.host}, says to
1842use @command{telnet} to log in as user @code{kai} to host
1843@code{real.host}.
1844 2120
1845@xref{Multi-hop Methods}, for a list of possible hop method values. 2121@itemize @w{}
1846The variable @code{tramp-multi-connection-function-alist} contains the 2122@ifset emacs
1847list of possible hop methods and information on how to execute them, 2123@item @code{ftp} -- That is the default syntax
1848should you want to add your own. 2124@item @code{url} -- URL-like syntax
2125@end ifset
2126@ifset xemacs
2127@item @code{sep} -- That is the default syntax
2128@item @code{url} -- URL-like syntax
2129@item @code{ftp} -- EFS-like syntax
2130@end ifset
2131@end itemize
1849 2132
1850 2133
1851@node Filename completion 2134@node Filename completion
@@ -1853,10 +2136,20 @@ should you want to add your own.
1853@cindex filename completion 2136@cindex filename completion
1854 2137
1855Filename completion works with @value{tramp} for completion of method 2138Filename completion works with @value{tramp} for completion of method
1856names, of user names and of machine names (except multi-hop methods) 2139names, of user names and of machine names as well as for completion of
1857as well as for completion of file names on remote machines. 2140file names on remote machines.
1858@ifset emacs 2141@ifset emacs
1859In order to enable this, Partial Completion mode must be set on. 2142In order to enable this, Partial Completion mode must be set
2143on@footnote{If you don't use Partial Completion mode, but want to
2144keep full completion, load @value{tramp} like this in your
2145@file{.emacs}:
2146
2147@lisp
2148;; Preserve Tramp's completion features.
2149(let ((partial-completion-mode t))
2150 (require 'tramp))
2151@end lisp
2152}.
1860@ifinfo 2153@ifinfo
1861@xref{Completion Options, , , @value{emacsdir}}. 2154@xref{Completion Options, , , @value{emacsdir}}.
1862@end ifinfo 2155@end ifinfo
@@ -1867,85 +2160,153 @@ If you, for example, type @kbd{C-x C-f @value{prefix}t
1867 2160
1868@example 2161@example
1869@ifset emacs 2162@ifset emacs
1870@value{prefixsinglehop}telnet@value{postfixsinglehop} tmp/ 2163@value{prefixhop}telnet@value{postfixhop} tmp/
1871@value{prefixsinglehop}toto@value{postfix} 2164@value{prefixhop}toto@value{postfix}
1872@end ifset 2165@end ifset
1873@ifset xemacs 2166@ifset xemacs
1874@value{prefixsinglehop}telnet@value{postfixsinglehop} @value{prefixsinglehop}toto@value{postfix} 2167@value{prefixhop}telnet@value{postfixhop} @value{prefixhop}toto@value{postfix}
1875@end ifset 2168@end ifset
1876@end example 2169@end example
1877 2170
1878@samp{@value{prefixsinglehop}telnet@value{postfixsinglehop}} 2171@samp{@value{prefixhop}telnet@value{postfixhop}}
1879is a possible completion for the respective method, 2172is a possible completion for the respective method,
1880@ifset emacs 2173@ifset emacs
1881@samp{tmp/} stands for the directory @file{/tmp} on your local 2174@samp{tmp/} stands for the directory @file{/tmp} on your local
1882machine, 2175machine,
1883@end ifset 2176@end ifset
1884and @samp{@value{prefixsinglehop}toto@value{postfix}} 2177and @samp{@value{prefixhop}toto@value{postfix}}
1885might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} 2178might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
1886file (given you're using default method @option{ssh}). 2179file (given you're using default method @option{ssh}).
1887 2180
1888If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to 2181If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to
1889@samp{@value{prefix}telnet@value{postfixsinglehop}}. 2182@samp{@value{prefix}telnet@value{postfixhop}}.
1890Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in 2183Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in
1891your @file{/etc/hosts} file, let's say 2184your @file{/etc/hosts} file, let's say
1892 2185
1893@example 2186@example
1894@value{prefixsinglehop}telnet@value{postfixsinglehop}127.0.0.1@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}192.168.0.1@value{postfix} 2187@trampfnmhl{telnet,127.0.0.1,} @trampfnmhl{telnet,192.168.0.1,}
1895@value{prefixsinglehop}telnet@value{postfixsinglehop}localhost@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia.danann.net@value{postfix} 2188@trampfnmhl{telnet,localhost,} @trampfnmhl{telnet,melancholia.danann.net,}
1896@value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia@value{postfix} 2189@trampfnmhl{telnet,melancholia,}
1897@end example 2190@end example
1898 2191
1899Now you can choose the desired machine, and you can continue to 2192Now you can choose the desired machine, and you can continue to
1900complete file names on that machine. 2193complete file names on that machine.
1901 2194
1902As filename completion needs to fetch the listing of files from the
1903remote machine, this feature is sometimes fairly slow. As @value{tramp}
1904does not yet cache the results of directory listing, there is no gain
1905in performance the second time you complete filenames.
1906
1907If the configuration files (@pxref{Customizing Completion}), which 2195If the configuration files (@pxref{Customizing Completion}), which
1908@value{tramp} uses for analysis of completion, offer user names, those user 2196@value{tramp} uses for analysis of completion, offer user names, those user
1909names will be taken into account as well. 2197names will be taken into account as well.
1910 2198
2199Remote machines, which have been visited in the past and kept
2200persistently (@pxref{Connection caching}), will be offered too.
1911 2201
1912@node Dired 2202Once the remote machine identification is completed, it comes to
1913@section Dired 2203filename completion on the remote host. This works pretty much like
1914@cindex dired 2204for files on the local host, with the exception that minibuffer
2205killing via a double-slash works only on the filename part, except
2206that filename part starts with @file{//}.
2207@ifinfo
2208@xref{Minibuffer File, , , @value{emacsdir}}.
2209@end ifinfo
1915 2210
1916@value{tramp} works transparently with dired, enabling you to use this powerful 2211@ifset emacs
1917file management tool to manage files on any machine you have access to 2212As example, @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin//etc}
1918over the Internet. 2213@key{TAB}} would result in
2214@file{@trampfnmhl{telnet,melancholia,/etc}}, whereas
2215@kbd{@trampfnmhl{telnet,melancholia,//etc} @key{TAB}} reduces the
2216minibuffer contents to @file{/etc}. A triple-slash stands for the
2217default behaviour,
2218i.e. @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin///etc}
2219@key{TAB}} expands directly to @file{/etc}.
2220@end ifset
1919 2221
1920If you need to browse a directory tree, Dired is a better choice, at 2222@ifset xemacs
1921present, than filename completion. Dired has its own cache mechanism 2223As example, @kbd{@trampfnmhl{telnet,melancholia,/usr/local/bin//}}
1922and will only fetch the directory listing once. 2224would result in @file{@trampfnmhl{telnet,melancholia,/}}, whereas
2225@kbd{@trampfnmhl{telnet,melancholia,//}} expands the minibuffer
2226contents to @file{/}.
2227@end ifset
1923 2228
1924 2229
1925@node Compilation 2230@node Remote processes
1926@section Compile remote files 2231@section Integration with other @value{emacsname} packages (@sc{experimental}).
1927@cindex compile 2232@cindex compile
1928@cindex recompile 2233@cindex recompile
2234@cindex gud
2235@cindex gdb
2236@cindex perldb
2237
2238@value{tramp} has an @sc{experimental} implementation for running
2239processes on a remote host. This allows to exploit @value{emacsname}
2240packages without modification for remote file names. It does not work
2241for the @option{ftp} and @option{smb} methods.
2242
2243Remote processes are started when a corresponding command is executed
2244from a buffer belonging to a remote file or directory. Up to now, the
2245packages @file{compile.el} (commands like @code{compile} and
2246@code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}) have been
2247integrated. Integration of further packages is planned, any help for
2248this is welcome!
2249
2250When your program is not found in the default search path
2251@value{tramp} sets on the remote machine, you should either use an
2252absolute path, or extend @code{tramp-remote-path} (see @ref{Remote
2253Programs}):
2254
2255@lisp
2256(add-to-list 'tramp-remote-path "~/bin")
2257(add-to-list 'tramp-remote-path "/appli/pub/bin")
2258@end lisp
2259
2260The environment for your program can be adapted by customizing
2261@code{tramp-remote-process-environment}. This variable is a list of
2262strings. It is structured like @code{process-environment}. Each
2263element is a string of the form ENVVARNAME=VALUE. An entry
2264ENVVARNAME= disables the corresponding environment variable, which
2265might have been set in your init file like @file{~/.profile}.
2266
2267@noindent
2268Adding an entry can be performed via @code{add-to-list}:
2269
2270@lisp
2271(add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java")
2272@end lisp
1929 2273
1930@value{tramp} provides commands for compilation of files on remote 2274Changing or removing an existing entry is not encouraged. The default
1931machines. In order to get them loaded, you need to require 2275values are chosen for proper @value{tramp} work. Nevertheless, if for
1932@file{tramp-util.el}: 2276example a paranoid system administrator disallows changing the
2277@var{$HISTORY} environment variable, you can customize
2278@code{tramp-remote-process-environment}, or you can apply the
2279following code in your @file{.emacs}:
1933 2280
1934@lisp 2281@lisp
1935(require 'tramp-util) 2282(let ((process-environment tramp-remote-process-environment))
2283 (setenv "HISTORY" nil)
2284 (setq tramp-remote-process-environment process-environment))
1936@end lisp 2285@end lisp
1937 2286
1938Afterwards, you can use the commands @code{tramp-compile} and 2287If you use other @value{emacsname} packages which do not run
1939@code{tramp-recompile} instead of @code{compile} and @code{recompile}, 2288out-of-the-box on a remote host, please let us know. We will try to
1940respectively; @inforef{Compilation, ,@value{emacsdir}}. This does not 2289integrate them as well. @xref{Bug Reports}.
1941work for the @option{ftp} and @option{smb} methods.
1942 2290
1943The corresponding key bindings and menu entries calling these commands
1944are redefined automatically for buffers associated with remote files.
1945 2291
1946After finishing the compilation, you can use the usual commands like 2292@subsection Running eshell on a remote host
1947@code{previous-error}, @code{next-error} and @code{first-error} for 2293@cindex eshell
1948navigation in the @file{*Compilation*} buffer. 2294
2295@value{tramp} is integrated into @file{eshell.el}. That is, you can
2296open an interactive shell on your remote host, and run commands there.
2297After you have started @code{eshell}, you could perform commands like
2298this:
2299
2300@example
2301@b{~ $} cd @trampfnmhl{sudo, , /etc}
2302@b{@trampfn{sudo, root, host, /etc} $} hostname
2303host
2304@b{@trampfn{sudo, root, host, /etc} $} id
2305uid=0(root) gid=0(root) groups=0(root)
2306@b{@trampfn{sudo, root, host, /etc} $} find-file shadow
2307#<buffer shadow>
2308@b{@trampfn{sudo, root, host, /etc} $}
2309@end example
1949 2310
1950 2311
1951@node Bug Reports 2312@node Bug Reports
@@ -1953,7 +2314,7 @@ navigation in the @file{*Compilation*} buffer.
1953@cindex bug reports 2314@cindex bug reports
1954 2315
1955Bugs and problems with @value{tramp} are actively worked on by the 2316Bugs and problems with @value{tramp} are actively worked on by the
1956development team. Feature requests and suggestions are also more than 2317development team. Feature requests and suggestions are also more than
1957welcome. 2318welcome.
1958 2319
1959The @value{tramp} mailing list is a great place to get information on 2320The @value{tramp} mailing list is a great place to get information on
@@ -1964,16 +2325,16 @@ non-subscribers can post but messages will be delayed, possibly up to
1964your message. 2325your message.
1965 2326
1966The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to 2327The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to
1967this address go to all the subscribers. This is @emph{not} the address 2328this address go to all the subscribers. This is @emph{not} the address
1968to send subscription requests to. 2329to send subscription requests to.
1969 2330
1970Subscribing to the list is performed via 2331Subscribing to the list is performed via
1971@uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, 2332@uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/,
1972the @value{tramp} Mail Subscription Page}. 2333the @value{tramp} Mail Subscription Page}.
1973 2334
1974To report a bug in @value{tramp}, you should execute @kbd{M-x tramp-bug}. This 2335To report a bug in @value{tramp}, you should execute @kbd{M-x
1975will automatically generate a buffer with the details of your system and 2336tramp-bug}. This will automatically generate a buffer with the details
1976@value{tramp} version. 2337of your system and @value{tramp} version.
1977 2338
1978When submitting a bug report, please try to describe in excruciating 2339When submitting a bug report, please try to describe in excruciating
1979detail the steps required to reproduce the problem, the setup of the 2340detail the steps required to reproduce the problem, the setup of the
@@ -1982,8 +2343,20 @@ check that your problem is not described already in @xref{Frequently
1982Asked Questions}. 2343Asked Questions}.
1983 2344
1984If you can identify a minimal test case that reproduces the problem, 2345If you can identify a minimal test case that reproduces the problem,
1985include that with your bug report. This will make it much easier for the 2346include that with your bug report. This will make it much easier for
1986development team to analyze and correct the problem. 2347the development team to analyze and correct the problem.
2348
2349Before reporting the bug, you should set the verbosity level to 6
2350(@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and
2351repeat the bug. Then, include the contents of the @file{*tramp/foo*}
2352and @file{*debug tramp/foo*} buffers in your bug report. A verbosity
2353level greater than 6 will produce a very huge debug buffer, which is
2354mostly not necessary for the analysis.
2355
2356Please be aware that, with a verbosity level of 6 or greater, the
2357contents of files and directories will be included in the debug
2358buffer. Passwords you've typed will never be included there.
2359
1987 2360
1988@node Frequently Asked Questions 2361@node Frequently Asked Questions
1989@chapter Frequently Asked Questions 2362@chapter Frequently Asked Questions
@@ -2009,10 +2382,9 @@ There is also a Savannah project page.
2009@item 2382@item
2010Which systems does it work on? 2383Which systems does it work on?
2011 2384
2012The package has been used successfully on GNU Emacs 20, GNU Emacs 21 2385The package has been used successfully on GNU Emacs 21, GNU Emacs 22
2013and GNU Emacs 22, as well as XEmacs 21. XEmacs 20 is more 2386and XEmacs 21 (starting with 21.4). Gateway methods are supported for
2014problematic, see the notes in @file{tramp.el}. I don't think anybody 2387GNU Emacs 22 only.
2015has really tried it on GNU Emacs 19.
2016 2388
2017The package was intended to work on Unix, and it really expects a 2389The package was intended to work on Unix, and it really expects a
2018Unix-like system on the remote end (except the @option{smb} method), 2390Unix-like system on the remote end (except the @option{smb} method),
@@ -2023,13 +2395,41 @@ There is some informations on @value{tramp} on NT at the following URL;
2023many thanks to Joe Stoy for providing the information: 2395many thanks to Joe Stoy for providing the information:
2024@uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/} 2396@uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/}
2025 2397
2026@c The link is broken. I've contacted Tom for clarification. Michael. 2398@c The link is broken. I've contacted Tom for clarification. Michael.
2027@ignore 2399@ignore
2028The above mostly contains patches to old ssh versions; Tom Roche has a 2400The above mostly contains patches to old ssh versions; Tom Roche has a
2029Web page with instructions: 2401Web page with instructions:
2030@uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html} 2402@uref{http://www4.ncsu.edu/~tlroche/plinkTramp.html}
2031@end ignore 2403@end ignore
2032 2404
2405@item
2406How could I speed up @value{tramp}?
2407
2408In the backstage, @value{tramp} needs a lot of operations on the
2409remote host. The time for transferring data from and to the remote
2410host as well as the time needed to perform the operations there count.
2411In order to speed up @value{tramp}, one could either try to avoid some
2412of the operations, or one could try to improve their performance.
2413
2414Use an external transfer method, like @option{scpc}.
2415
2416Use caching. This is already enabled by default. Information about
2417the remote host as well as the remote files are cached for reuse. Th
2418information about remote hosts is kept in the file specified in
2419@code{tramp-persistency-file-name}. Keep this file.
2420
2421Disable version control. If you access remote files which are not
2422under version control, a lot of check operations can be avoided by
2423disabling VC. This can be achieved by
2424
2425@lisp
2426(setq vc-handled-backends nil)
2427@end lisp
2428
2429Disable excessive traces. The default trace level of @value{tramp},
2430defined in the variable @code{tramp-verbose}, is 3. You should
2431increase this level only temporarily, hunting bugs.
2432
2033 2433
2034@item 2434@item
2035@value{tramp} does not connect to the remote host 2435@value{tramp} does not connect to the remote host
@@ -2048,6 +2448,17 @@ contains unknown characters like escape sequences for coloring. This
2048should be avoided on the remote side. @xref{Remote shell setup}. for 2448should be avoided on the remote side. @xref{Remote shell setup}. for
2049setting the regular expression detecting the prompt. 2449setting the regular expression detecting the prompt.
2050 2450
2451You can check your settings after an unsuccessful connection by
2452switching to the @value{tramp} connection buffer @file{*tramp/foo*},
2453setting the cursor at the top of the buffer, and applying the expression
2454
2455@example
2456@kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))}
2457@end example
2458
2459If it fails, or the cursor is not moved at the end of the buffer, your
2460prompt is not recognised correctly.
2461
2051A special problem is the zsh, which uses left-hand side and right-hand 2462A special problem is the zsh, which uses left-hand side and right-hand
2052side prompts in parallel. Therefore, it is necessary to disable the 2463side prompts in parallel. Therefore, it is necessary to disable the
2053zsh line editor on the remote host. You shall add to @file{~/.zshrc} 2464zsh line editor on the remote host. You shall add to @file{~/.zshrc}
@@ -2057,15 +2468,34 @@ the following command:
2057[ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' 2468[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '
2058@end example 2469@end example
2059 2470
2471
2060@item 2472@item
2061@value{tramp} doesn't transfer strings with more than 500 characters 2473@value{tramp} doesn't transfer strings with more than 500 characters
2062correctly 2474correctly
2063 2475
2064On some few systems, the implementation of @code{process-send-string} 2476On some few systems, the implementation of @code{process-send-string}
2065seems to be broken for longer strings. This case, you should 2477seems to be broken for longer strings. It is reported for HP-UX,
2066customize the variable @code{tramp-chunksize} to 500. For a 2478FreeBSD and Tru64 Unix, for example. This case, you should customize
2067description how to determine whether this is necessary see the 2479the variable @code{tramp-chunksize} to 500. For a description how to
2068documentation of @code{tramp-chunksize}. 2480determine whether this is necessary see the documentation of
2481@code{tramp-chunksize}.
2482
2483Additionally, it will be useful to set @code{file-precious-flag} to
2484@code{t} for @value{tramp} files. Then the file contents will be
2485written into a temporary file first, which is checked for correct
2486checksum.
2487@ifinfo
2488@pxref{Saving Buffers, , , elisp}
2489@end ifinfo
2490
2491@lisp
2492(add-hook
2493 'find-file-hooks
2494 '(lambda ()
2495 (when (file-remote-p default-directory)
2496 (set (make-local-variable 'file-precious-flag) t))))
2497@end lisp
2498
2069@end itemize 2499@end itemize
2070 2500
2071 2501
@@ -2117,11 +2547,13 @@ remote host.
2117 " make tramp beep after writing a file." 2547 " make tramp beep after writing a file."
2118 (interactive) 2548 (interactive)
2119 (beep)) 2549 (beep))
2550
2120(defadvice tramp-handle-do-copy-or-rename-file 2551(defadvice tramp-handle-do-copy-or-rename-file
2121 (after tramp-copy-beep-advice activate) 2552 (after tramp-copy-beep-advice activate)
2122 " make tramp beep after copying a file." 2553 " make tramp beep after copying a file."
2123 (interactive) 2554 (interactive)
2124 (beep)) 2555 (beep))
2556
2125(defadvice tramp-handle-insert-file-contents 2557(defadvice tramp-handle-insert-file-contents
2126 (after tramp-copy-beep-advice activate) 2558 (after tramp-copy-beep-advice activate)
2127 " make tramp beep after copying a file." 2559 " make tramp beep after copying a file."
@@ -2130,6 +2562,60 @@ remote host.
2130@end lisp 2562@end lisp
2131 2563
2132 2564
2565@ifset emacs
2566@item
2567I'ld like to see a host indication in the mode line when I'm remote
2568
2569The following code has been tested with @value{emacsname} 22. You
2570should put it into your @file{~/.emacs}:
2571
2572@lisp
2573(defconst my-mode-line-buffer-identification
2574 (list
2575 '(:eval
2576 (let ((host-name
2577 (if (file-remote-p default-directory)
2578 (tramp-file-name-host
2579 (tramp-dissect-file-name default-directory))
2580 (system-name))))
2581 (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
2582 (substring host-name 0 (match-beginning 1))
2583 host-name)))
2584 ": %12b"))
2585
2586(setq-default
2587 mode-line-buffer-identification
2588 my-mode-line-buffer-identification)
2589
2590(add-hook
2591 'dired-mode-hook
2592 '(lambda ()
2593 (setq
2594 mode-line-buffer-identification
2595 my-mode-line-buffer-identification)))
2596@end lisp
2597@end ifset
2598
2599
2600@ifset emacs
2601@item
2602My remote host does not understand default directory listing options
2603
2604@value{emacsname} computes the @command{dired} options depending on
2605the local host you are working. If your @command{ls} command on the
2606remote host does not understand those options, you can change them
2607like this:
2608
2609@lisp
2610(add-hook
2611 'dired-before-readin-hook
2612 '(lambda ()
2613 (when (file-remote-p default-directory)
2614 (setq dired-actual-switches "-al"))))
2615@end lisp
2616@end ifset
2617
2618
2133@item 2619@item
2134There's this @file{~/.sh_history} file on the remote host which keeps 2620There's this @file{~/.sh_history} file on the remote host which keeps
2135growing and growing. What's that? 2621growing and growing. What's that?
@@ -2152,6 +2638,218 @@ fi
2152@end example 2638@end example
2153 2639
2154 2640
2641@item There are longish file names to type. How to shorten this?
2642
2643Let's say you need regularly access to @file{@trampfn{ssh, news,
2644news.my.domain, /opt/news/etc}}, which is boring to type again and
2645again. The following approaches can be mixed:
2646
2647@enumerate
2648
2649@item Use default values for method and user name:
2650
2651You can define default methods and user names for hosts,
2652(@pxref{Default Method}, @pxref{Default User}):
2653
2654@lisp
2655(setq tramp-default-method "ssh"
2656 tramp-default-user "news")
2657@end lisp
2658
2659The file name left to type would be
2660@kbd{C-x C-f @trampfnhl{news.my.domain, /opt/news/etc}}.
2661
2662Note, that there are some useful settings already. Accessing your
2663local host as @samp{root} user, is possible just by @kbd{C-x C-f
2664@trampfnmhl{su,,}}.
2665
2666@item Use configuration possibilities of your method:
2667
2668Several connection methods (i.e. the programs used) offer powerful
2669configuration possibilities (@pxref{Customizing Completion}). In the
2670given case, this could be @file{~/.ssh/config}:
2671
2672@example
2673Host xy
2674 HostName news.my.domain
2675 User news
2676@end example
2677
2678The file name left to type would be @kbd{C-x C-f @trampfnmhl{ssh, xy,
2679/opt/news/etc}}. Depending on files in your directories, it is even
2680possible to complete the hostname with @kbd{C-x C-f
2681@value{prefix}ssh@value{postfixhop}x @key{TAB}}.
2682
2683@item Use environment variables:
2684
2685File names typed in the minibuffer can be expanded by environment
2686variables. You can set them outside @value{emacsname}, or even with
2687Lisp:
2688
2689@lisp
2690(setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")
2691@end lisp
2692
2693Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you
2694are. The disadvantage is, that you cannot edit the file name, because
2695environment variables are not expanded during editing in the
2696minibuffer.
2697
2698@item Define own keys:
2699
2700You can define your own key sequences in @value{emacsname}, which can
2701be used instead of @kbd{C-x C-f}:
2702
2703@lisp
2704(global-set-key
2705 [(control x) (control y)]
2706 (lambda ()
2707 (interactive)
2708 (find-file
2709 (read-file-name
2710 "Find Tramp file: "
2711 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))))
2712@end lisp
2713
2714Simply typing @kbd{C-x C-y} would initialize the minibuffer for
2715editing with your beloved file name.
2716
2717See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the
2718Emacs Wiki} for a more comprehensive example.
2719
2720@item Define own abbreviation (1):
2721
2722It is possible to define an own abbreviation list for expanding file
2723names:
2724
2725@lisp
2726(add-to-list
2727 'directory-abbrev-alist
2728 '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
2729@end lisp
2730
2731This shortens the file openening command to @kbd{C-x C-f /xy
2732@key{RET}}. The disadvantage is, again, that you cannot edit the file
2733name, because the expansion happens after entering the file name only.
2734
2735@item Define own abbreviation (2):
2736
2737The @code{abbrev-mode} gives more flexibility for editing the
2738minibuffer:
2739
2740@lisp
2741(define-abbrev-table 'my-tramp-abbrev-table
2742 '(("xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))
2743
2744(add-hook
2745 'minibuffer-setup-hook
2746 '(lambda ()
2747 (abbrev-mode 1)
2748 (setq local-abbrev-table my-tramp-abbrev-table)))
2749
2750(defadvice minibuffer-complete
2751 (before my-minibuffer-complete activate)
2752 (expand-abbrev))
2753
2754;; If you use partial-completion-mode
2755(defadvice PC-do-completion
2756 (before my-PC-do-completion activate)
2757 (expand-abbrev))
2758@end lisp
2759
2760After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is
2761expanded, and you can continue editing.
2762
2763@item Use bookmarks:
2764
2765Bookmarks can be used to visit Tramp files or directories.
2766@ifinfo
2767@pxref{Bookmarks, , , @value{emacsdir}}
2768@end ifinfo
2769
2770When you have opened @file{@trampfn{ssh, news, news.my.domain,
2771/opt/news/etc/}}, you should save the bookmark via
2772@ifset emacs
2773@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}.
2774@end ifset
2775@ifset xemacs
2776@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
2777@end ifset
2778
2779Later on, you can always navigate to that bookmark via
2780@ifset emacs
2781@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}.
2782@end ifset
2783@ifset xemacs
2784@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
2785@end ifset
2786
2787@item Use recent files:
2788
2789@ifset emacs
2790@file{recentf}
2791@end ifset
2792@ifset xemacs
2793@file{recent-files}
2794@end ifset
2795remembers visited places.
2796@ifinfo
2797@ifset emacs
2798@pxref{File Conveniences, , , @value{emacsdir}}
2799@end ifset
2800@ifset xemacs
2801@pxref{recent-files, , , edit-utils}
2802@end ifset
2803@end ifinfo
2804
2805You could keep remote file names in the recent list without checking
2806their readability through a remote access:
2807
2808@lisp
2809@ifset emacs
2810(require 'recentf)
2811(add-to-list 'recentf-keep 'file-remote-p)
2812(recentf-mode 1)
2813@end ifset
2814@ifset xemacs
2815(recent-files-initialize)
2816(add-hook
2817 'find-file-hooks
2818 (lambda ()
2819 (when (file-remote-p (buffer-file-name))
2820 (recent-files-make-permanent)))
2821 'append)
2822@end ifset
2823@end lisp
2824
2825The list of files opened recently is reachable via
2826@ifset emacs
2827@kbd{@key{menu-bar} @key{file} @key{Open Recent}}.
2828@end ifset
2829@ifset xemacs
2830@kbd{@key{menu-bar} @key{Recent Files}}.
2831@end ifset
2832
2833@ifset emacs
2834@item Use filecache:
2835
2836@file{filecache} remembers visited places. Add the directory into
2837the cache:
2838
2839@lisp
2840(eval-after-load "filecache"
2841 '(file-cache-add-directory
2842 "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}"))
2843@end lisp
2844
2845Whenever you want to load a file, you can enter @kbd{C-x C-f
2846C-@key{TAB}} in the minibuffer. The completion is done for the given
2847directory.
2848@end ifset
2849
2850@end enumerate
2851
2852
2155@item 2853@item
2156How can I disable @value{tramp}? 2854How can I disable @value{tramp}?
2157 2855
@@ -2180,12 +2878,12 @@ This resets also the @value{ftppackagename} plugins.
2180@cindex Version Control 2878@cindex Version Control
2181 2879
2182Unlike @value{ftppackagename}, @value{tramp} has full shell access to the 2880Unlike @value{ftppackagename}, @value{tramp} has full shell access to the
2183remote machine. This makes it possible to provide version control for 2881remote machine. This makes it possible to provide version control for
2184files accessed under @value{tramp}. 2882files accessed under @value{tramp}.
2185 2883
2186The actual version control binaries must be installed on the remote 2884The actual version control binaries must be installed on the remote
2187machine, accessible in the directories specified in 2885machine, accessible in the directories specified in
2188@var{tramp-remote-path}. 2886@code{tramp-remote-path}.
2189 2887
2190This transparent integration with the version control systems is one of 2888This transparent integration with the version control systems is one of
2191the most valuable features provided by @value{tramp}, but it is far from perfect. 2889the most valuable features provided by @value{tramp}, but it is far from perfect.
@@ -2204,7 +2902,7 @@ Work is ongoing to improve the transparency of the system.
2204@section Determining if a file is under version control 2902@section Determining if a file is under version control
2205 2903
2206The VC package uses the existence of on-disk revision control master 2904The VC package uses the existence of on-disk revision control master
2207files to determine if a given file is under revision control. These file 2905files to determine if a given file is under revision control. These file
2208tests happen on the remote machine through the standard @value{tramp} mechanisms. 2906tests happen on the remote machine through the standard @value{tramp} mechanisms.
2209 2907
2210 2908
@@ -2212,7 +2910,7 @@ tests happen on the remote machine through the standard @value{tramp} mechanisms
2212@section Executing the version control commands on the remote machine 2910@section Executing the version control commands on the remote machine
2213 2911
2214There are no hooks provided by VC to allow intercepting of the version 2912There are no hooks provided by VC to allow intercepting of the version
2215control command execution. The calls occur through the 2913control command execution. The calls occur through the
2216@code{call-process} mechanism, a function that is somewhat more 2914@code{call-process} mechanism, a function that is somewhat more
2217efficient than the @code{shell-command} function but that does not 2915efficient than the @code{shell-command} function but that does not
2218provide hooks for remote execution of commands. 2916provide hooks for remote execution of commands.
@@ -2239,7 +2937,7 @@ workfile and the version control master.
2239 2937
2240This requires that a shell command be executed remotely, a process that 2938This requires that a shell command be executed remotely, a process that
2241is notably heavier-weight than the mtime comparison used for local 2939is notably heavier-weight than the mtime comparison used for local
2242files. Unfortunately, unless a portable solution to the issue is found, 2940files. Unfortunately, unless a portable solution to the issue is found,
2243this will remain the cost of remote version control. 2941this will remain the cost of remote version control.
2244 2942
2245 2943
@@ -2247,7 +2945,7 @@ this will remain the cost of remote version control.
2247@section Bringing the workfile out of the repository 2945@section Bringing the workfile out of the repository
2248 2946
2249VC will, by default, check for remote files and refuse to act on them 2947VC will, by default, check for remote files and refuse to act on them
2250when checking out files from the repository. To work around this 2948when checking out files from the repository. To work around this
2251problem, the function @code{vc-checkout} knows about @value{tramp} files and 2949problem, the function @code{vc-checkout} knows about @value{tramp} files and
2252allows version control to occur. 2950allows version control to occur.
2253 2951
@@ -2266,14 +2964,14 @@ Minor implementation details, &c.
2266@node Remote File Ownership 2964@node Remote File Ownership
2267@subsection How VC determines who owns a workfile 2965@subsection How VC determines who owns a workfile
2268 2966
2269@value{emacsname} provides the @code{user-full-name} function to 2967@value{emacsname} provides the @code{user-login-name} function to
2270return the login name of the current user as well as mapping from 2968return the login name of the current user as well as mapping from
2271arbitrary user id values back to login names. The VC code uses this 2969arbitrary user id values back to login names. The VC code uses this
2272functionality to map from the uid of the owner of a workfile to the 2970functionality to map from the uid of the owner of a workfile to the
2273login name in some circumstances. 2971login name in some circumstances.
2274 2972
2275This will not, for obvious reasons, work if the remote system has a 2973This will not, for obvious reasons, work if the remote system has a
2276different set of logins. As such, it is necessary to delegate to the 2974different set of logins. As such, it is necessary to delegate to the
2277remote machine the job of determining the login name associated with a 2975remote machine the job of determining the login name associated with a
2278uid. 2976uid.
2279 2977
@@ -2282,7 +2980,7 @@ as @code{NIS}, @code{NIS+} and @code{NetInfo}, there is no simple,
2282reliable and portable method for performing this mapping. 2980reliable and portable method for performing this mapping.
2283 2981
2284Thankfully, the only place in the VC code that depends on the mapping of 2982Thankfully, the only place in the VC code that depends on the mapping of
2285a uid to a login name is the @code{vc-file-owner} function. This returns 2983a uid to a login name is the @code{vc-file-owner} function. This returns
2286the login of the owner of the file as a string. 2984the login of the owner of the file as a string.
2287 2985
2288This function has been advised to use the output of @command{ls} on the 2986This function has been advised to use the output of @command{ls} on the
@@ -2304,7 +3002,7 @@ executing a process and parsing its output each time the information is
2304needed. 3002needed.
2305 3003
2306Unfortunately, life is not quite so easy when remote version control 3004Unfortunately, life is not quite so easy when remote version control
2307comes into the picture. Each remote machine may have a different version 3005comes into the picture. Each remote machine may have a different version
2308of the version control tools and, while this is painful, we need to 3006of the version control tools and, while this is painful, we need to
2309ensure that unavailable features are not used remotely. 3007ensure that unavailable features are not used remotely.
2310 3008
@@ -2313,9 +3011,9 @@ approach of making the release values of the revision control tools
2313local to each @value{tramp} buffer, forcing VC to determine these values 3011local to each @value{tramp} buffer, forcing VC to determine these values
2314again each time a new file is visited. 3012again each time a new file is visited.
2315 3013
2316This has, quite obviously, some performance implications. Thankfully, 3014This has, quite obviously, some performance implications. Thankfully,
2317most of the common operations performed by VC do not actually require 3015most of the common operations performed by VC do not actually require
2318that the remote version be known. This makes the problem far less 3016that the remote version be known. This makes the problem far less
2319apparent. 3017apparent.
2320 3018
2321Eventually these values will be captured by @value{tramp} on a system by 3019Eventually these values will be captured by @value{tramp} on a system by
@@ -2334,11 +3032,11 @@ system basis and the results cached to improve performance.
2334@section Breaking a localname into its components. 3032@section Breaking a localname into its components.
2335 3033
2336@value{tramp} file names are somewhat different, obviously, to ordinary file 3034@value{tramp} file names are somewhat different, obviously, to ordinary file
2337names. As such, the lisp functions @code{file-name-directory} and 3035names. As such, the lisp functions @code{file-name-directory} and
2338@code{file-name-nondirectory} are overridden within the @value{tramp} 3036@code{file-name-nondirectory} are overridden within the @value{tramp}
2339package. 3037package.
2340 3038
2341Their replacements are reasonably simplistic in their approach. They 3039Their replacements are reasonably simplistic in their approach. They
2342dissect the filename, call the original handler on the localname and 3040dissect the filename, call the original handler on the localname and
2343then rebuild the @value{tramp} file name with the result. 3041then rebuild the @value{tramp} file name with the result.
2344 3042
@@ -2346,6 +3044,77 @@ This allows the platform specific hacks in the original handlers to take
2346effect while preserving the @value{tramp} file name information. 3044effect while preserving the @value{tramp} file name information.
2347 3045
2348 3046
3047@node Traces and Profiles
3048@chapter How to Customize Traces
3049
3050All @value{tramp} messages are raised with a verbosity level. The
3051verbosity level can be any number between 0 and 10. Only messages with
3052a verbosity level less than or equal to @code{tramp-verbose} are
3053displayed.
3054
3055The verbosity levels are
3056
3057 @w{ 0} silent (no @value{tramp} messages at all)
3058@*@indent @w{ 1} errors
3059@*@indent @w{ 2} warnings
3060@*@indent @w{ 3} connection to remote hosts (default verbosity)
3061@*@indent @w{ 4} activities
3062@*@indent @w{ 5} internal
3063@*@indent @w{ 6} sent and received strings
3064@*@indent @w{ 7} file caching
3065@*@indent @w{ 8} connection properties
3066@*@indent @w{10} traces (huge)
3067
3068When @code{tramp-verbose} is greater than or equal to 4, the messages
3069are also written into a @value{tramp} debug buffer. This debug buffer
3070is useful for analysing problems; sending a @value{tramp} bug report
3071should be done with @code{tramp-verbose} set to a verbosity level of at
3072least 6 (@pxref{Bug Reports}).
3073
3074The debug buffer is in
3075@ifinfo
3076@ref{Outline Mode, , , @value{emacsdir}}.
3077@end ifinfo
3078@ifnotinfo
3079Outline Mode.
3080@end ifnotinfo
3081That means, you can change the level of messages to be viewed. If you
3082want, for example, see only messages up to verbosity level 5, you must
3083enter @kbd{C-u 6 C-c C-q}.
3084@ifinfo
3085Other keys for navigating are described in
3086@ref{Outline Visibility, , , @value{emacsdir}}.
3087@end ifinfo
3088
3089@value{tramp} errors are handled internally in order to raise the
3090verbosity level 1 messages. When you want to get a Lisp backtrace in
3091case of an error, you need to set both
3092
3093@lisp
3094(setq debug-on-error t
3095 debug-on-signal t)
3096@end lisp
3097
3098Sometimes, it might be even necessary to step through @value{tramp}
3099function call traces. Such traces are enabled by the following code:
3100
3101@lisp
3102(require 'tramp)
3103(require 'trace)
3104(mapcar 'trace-function-background
3105 (mapcar 'intern
3106 (all-completions "tramp-" obarray 'functionp)))
3107(untrace-function 'tramp-read-passwd)
3108(untrace-function 'tramp-gw-basic-authentication)
3109@end lisp
3110
3111The function call traces are inserted in the buffer
3112@file{*trace-output*}. @code{tramp-read-passwd} and
3113@code{tramp-gw-basic-authentication} shall be disabled when the
3114function call traces are added to @value{tramp}, because both
3115functions return password strings, which should not be distributed.
3116
3117
2349@node Issues 3118@node Issues
2350@chapter Debatable Issues and What Was Decided 3119@chapter Debatable Issues and What Was Decided
2351 3120
@@ -2368,14 +3137,6 @@ printed and deleted.
2368But I have decided that this is too fragile to reliably work, so on some 3137But I have decided that this is too fragile to reliably work, so on some
2369systems you'll have to do without the uuencode methods. 3138systems you'll have to do without the uuencode methods.
2370 3139
2371@item @value{tramp} does not work on XEmacs 20.
2372
2373This is because it requires the macro @code{with-timeout} which does not
2374appear to exist in XEmacs 20. I'm somewhat reluctant to add an
2375emulation macro to @value{tramp}, but if somebody who uses XEmacs 20 steps
2376forward and wishes to implement and test it, please contact me or the
2377mailing list.
2378
2379@item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs. 3140@item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs.
2380 3141
2381The GNU Emacs maintainers wish to use a unified filename syntax for 3142The GNU Emacs maintainers wish to use a unified filename syntax for
@@ -2402,10 +3163,10 @@ The autoload of the @value{emacsname} @value{tramp} package must be
2402disabled. This can be achieved by setting file permissions @code{000} 3163disabled. This can be achieved by setting file permissions @code{000}
2403to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}. 3164to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}.
2404 3165
2405In case of unified filenames, all @value{emacsname} download sites 3166In case of unified filenames, all @value{emacsname} download sites are
2406are added to @code{tramp-default-method-alist} with default method 3167added to @code{tramp-default-method-alist} with default method
2407@option{ftp} @xref{Default Method}. These settings shouldn't be touched 3168@option{ftp} @xref{Default Method}. These settings shouldn't be
2408for proper working of the @value{emacsname} package system. 3169touched for proper working of the @value{emacsname} package system.
2409 3170
2410The syntax for unified filenames is described in the @value{tramp} manual 3171The syntax for unified filenames is described in the @value{tramp} manual
2411for @value{emacsothername}. 3172for @value{emacsothername}.
@@ -2430,7 +3191,6 @@ for @value{emacsothername}.
2430@c shells. 3191@c shells.
2431@c * Explain how tramp.el works in principle: open a shell on a remote 3192@c * Explain how tramp.el works in principle: open a shell on a remote
2432@c host and then send commands to it. 3193@c host and then send commands to it.
2433@c * Mention that bookmarks are a cool feature to go along with Tramp.
2434@c * Make terminology "inline" vs "out-of-band" consistent. 3194@c * Make terminology "inline" vs "out-of-band" consistent.
2435@c It seems that "external" is also used instead of "out-of-band". 3195@c It seems that "external" is also used instead of "out-of-band".
2436 3196
diff --git a/man/trampver.texi b/man/trampver.texi
index 6c770dc8ad1..6d97869d115 100644
--- a/man/trampver.texi
+++ b/man/trampver.texi
@@ -1,27 +1,26 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c texi/trampver.texi. Generated from trampver.texi.in by configure. 2@c texi/trampver.texi. Generated from trampver.texi.in by configure.
3 3
4@c This is part of the Emacs manual.
5@c Copyright (C) 2003, 2004, 2005, 2006, 2007
6@c Free Software Foundation, Inc.
7@c See file emacs.texi for copying conditions.
8
9@c In the Tramp CVS, the version number is auto-frobbed from 4@c In the Tramp CVS, the version number is auto-frobbed from
10@c configure.ac, so you should edit that file and run 5@c configure.ac, so you should edit that file and run
11@c "autoconf && ./configure" to change the version number. 6@c "autoconf && ./configure" to change the version number.
12@set trampver 2.0.56 7@set trampver 2.1.10-pre
13 8
14@c Other flags from configuration 9@c Other flags from configuration
15@set prefix /usr/local 10@set instprefix /usr/local
16@set lispdir /usr/local/share/emacs/site-lisp 11@set lispdir /usr/local/share/emacs/site-lisp
17@set infodir /usr/local/share/info 12@set infodir /usr/local/info
18 13
19@c Formatting of the tramp program name consistent. 14@c Formatting of the tramp program name consistent.
20@set tramp @sc{tramp} 15@set tramp @sc{tramp}
21 16
17@c Whether or not describe gateway methods.
18@ifclear noemacsgw
19@set emacsgw
20@end ifclear
21
22@c Some flags which make the text independent on the (X)Emacs flavor. 22@c Some flags which make the text independent on the (X)Emacs flavor.
23@c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs". 23@c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs".
24
25@ifclear emacs 24@ifclear emacs
26@ifclear xemacs 25@ifclear xemacs
27@set emacs 26@set emacs
@@ -34,10 +33,9 @@
34@set emacsdir emacs 33@set emacsdir emacs
35@set ftppackagename Ange-FTP 34@set ftppackagename Ange-FTP
36@set prefix / 35@set prefix /
37@set prefixsinglehop 36@set prefixhop
38@set postfix : 37@set postfix :
39@set postfixsinglehop : 38@set postfixhop :
40@set postfixmultihop :
41@set emacsothername XEmacs 39@set emacsothername XEmacs
42@set emacsotherdir xemacs 40@set emacsotherdir xemacs
43@set emacsotherfilename tramp-xemacs.html 41@set emacsotherfilename tramp-xemacs.html
@@ -50,10 +48,9 @@
50@set emacsdir xemacs 48@set emacsdir xemacs
51@set ftppackagename EFS 49@set ftppackagename EFS
52@set prefix /[ 50@set prefix /[
53@set prefixsinglehop [ 51@set prefixhop [
54@set postfix ] 52@set postfix ]
55@set postfixsinglehop / 53@set postfixhop /
56@set postfixmultihop :
57@set emacsothername GNU Emacs 54@set emacsothername GNU Emacs
58@set emacsotherdir emacs 55@set emacsotherdir emacs
59@set emacsotherfilename tramp-emacs.html 56@set emacsotherfilename tramp-emacs.html