summaryrefslogtreecommitdiff
path: root/doc/misc/tramp.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/misc/tramp.texi')
-rw-r--r--doc/misc/tramp.texi1443
1 files changed, 631 insertions, 812 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index dae514033f8..1ba22e0b594 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -12,14 +12,11 @@
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
-@c Additionally, flags are set with respect to the Emacs flavor; and
-@c depending whether Tramp is packaged into (X)Emacs, or standalone.
-
@include trampver.texi
-@c Macro for formatting a file name according to the respective syntax.
-@c Macro arguments should not have any leading or
-@c trailing whitespace. Not very elegant, but I don't know it better.
+@c Macro for formatting a file name according to the respective
+@c syntax. Macro arguments should not have any leading or trailing
+@c whitespace. Not very elegant, but I don't know it better.
@macro trampfn {method, userhost, localname}
@value{prefix}@c
@@ -51,56 +48,39 @@ copy and modify this GNU manual.''
@end copying
@c Entries for @command{install-info} to use
-@dircategory @value{emacsname} network features
+@dircategory Emacs network features
@direntry
* TRAMP: (tramp). Transparent Remote Access, Multiple Protocol
- @value{emacsname} remote file access via ssh and scp.
+ Emacs remote file access via ssh and scp.
@end direntry
@titlepage
@title @value{tramp} version @value{trampver} User Manual
@author by Daniel Pittman
@author based on documentation by Kai Großjohann
-@page
-@insertcopying
@end titlepage
@contents
-@ifnottex
@node Top, Overview, (dir), (dir)
@top @value{tramp} version @value{trampver} User Manual
This file documents @value{tramp} version @value{trampver}, a remote file
-editing package for @value{emacsname}.
+editing package for Emacs.
@value{tramp} stands for ``Transparent Remote (file) Access, Multiple
Protocol''. This package provides remote file editing, similar to
-@value{ftppackagename}.
+Ange FTP.
-The difference is that @value{ftppackagename} uses FTP to transfer
-files between the local and the remote host, whereas @value{tramp} uses a
-combination of @command{rsh} and @command{rcp} or other work-alike
-programs, such as @command{ssh}/@command{scp}.
+The difference is that Ange FTP uses FTP to transfer files between the
+local and the remote host, whereas @value{tramp} uses a combination of
+@command{rsh} and @command{rcp} or other work-alike programs, such as
+@command{ssh}/@command{scp}.
You can find the latest version of this document on the web at
@uref{http://www.gnu.org/software/tramp/}.
-@c Pointer to the other Emacs flavor is necessary only in case of
-@c standalone installation.
-@ifset installchapter
-The manual has been generated for @value{emacsname}.
-@ifinfo
-If you want to read the info pages for @value{emacsothername}, you
-should read in @ref{Installation} how to create them.
-@end ifinfo
-@ifhtml
-If you're using the other Emacs flavor, you should read the
-@uref{@value{emacsotherfilename}, @value{emacsothername}} pages.
-@end ifhtml
-@end ifset
-
@ifhtml
The latest release of @value{tramp} is available for
@uref{ftp://ftp.gnu.org/gnu/tramp/, download}, or you may see
@@ -115,20 +95,10 @@ There is a mailing list for @value{tramp}, available at
@email{tramp-devel@@gnu.org}, and archived at
@uref{http://lists.gnu.org/archive/html/tramp-devel/, the
@value{tramp} Mail Archive}.
-@ifhtml
-Older archives are located at
-@uref{http://sourceforge.net/mailarchive/forum.php?forum=tramp-devel,
-SourceForge Mail Archive} and
-@uref{http://www.mail-archive.com/emacs-rcp@@ls6.cs.uni-dortmund.de/,
-The Mail Archive}.
-@c in HTML output, there's no new paragraph.
-@*@*
-@end ifhtml
+@page
@insertcopying
-@end ifnottex
-
@menu
* Overview:: What @value{tramp} can and cannot do.
@@ -137,7 +107,7 @@ For the end user:
* Obtaining Tramp:: How to obtain @value{tramp}.
* History:: History of @value{tramp}.
@ifset installchapter
-* Installation:: Installing @value{tramp} with your @value{emacsname}.
+* Installation:: Installing @value{tramp} with your Emacs.
@end ifset
* Configuration:: Configuring @value{tramp} for use.
* Usage:: An overview of the operation of @value{tramp}.
@@ -150,7 +120,6 @@ For the developer:
How file names, directories and localnames
are mangled and managed.
* Traces and Profiles:: How to Customize Traces.
-* Issues:: Debatable Issues and What Was Decided.
* GNU Free Documentation License:: The license for this documentation.
* Function Index:: @value{tramp} functions.
@@ -161,7 +130,7 @@ For the developer:
--- The Detailed Node Listing ---
@c
@ifset installchapter
-Installing @value{tramp} with your @value{emacsname}
+Installing @value{tramp} with your Emacs
* Installation parameters:: Parameters in order to control installation.
* Load paths:: How to plug-in @value{tramp} into your environment.
@@ -173,16 +142,12 @@ Configuring @value{tramp} for use
* Connection types:: Types of connections to remote hosts.
* Inline methods:: Inline methods.
* External methods:: External methods.
-@ifset emacsgvfs
* GVFS based methods:: GVFS based external methods.
-@end ifset
-@ifset emacsgw
-* Gateway methods:: Gateway methods.
-@end ifset
* Default Method:: Selecting a default method.
* Default User:: Selecting a default user.
* Default Host:: Selecting a default host.
* Multi-hops:: Connecting to a remote host using multiple hops.
+* Firewalls:: Passing firewalls.
* Customizing Methods:: Using Non-Standard Methods.
* Customizing Completion:: Selecting config files for user/host name completion.
* Password handling:: Reusing passwords for several connections.
@@ -200,15 +165,13 @@ Using @value{tramp}
* File name Syntax:: @value{tramp} file name conventions.
* File name completion:: File name completion.
* Ad-hoc multi-hops:: Declaring multiple hops in the file name.
-* Remote processes:: Integration with other @value{emacsname} packages.
+* Remote processes:: Integration with other Emacs packages.
* Cleanup remote connections:: Cleanup remote connections.
How file names, directories and localnames are mangled and managed
* Localname deconstruction:: Breaking a localname into its components.
-@ifset emacs
* External packages:: Integration with external Lisp packages.
-@end ifset
@end detailmenu
@end menu
@@ -219,10 +182,9 @@ How file names, directories and localnames are mangled and managed
@cindex overview
@value{tramp} is for transparently accessing remote files from within
-@value{emacsname}. @value{tramp} enables an easy, convenient, and
-consistent interface to remote files as if they are local files.
-@value{tramp}'s transparency extends to editing, version control, and
-@code{dired}.
+Emacs. @value{tramp} enables an easy, convenient, and consistent
+interface to remote files as if they are local files. @value{tramp}'s
+transparency extends to editing, version control, and @code{dired}.
@value{tramp} can access remote hosts using any number of access
methods, such as @command{rsh}, @command{rlogin}, @command{telnet},
@@ -245,7 +207,7 @@ and transparent access.
@value{tramp} temporarily transfers a remote file's contents to the
local host editing and related operations. @value{tramp} can also
transfer files between hosts using standard Emacs interfaces, a
-benefit of direct integration of @value{tramp} in @value{emacsname}.
+benefit of direct integration of @value{tramp} in Emacs.
@value{tramp} can transfer files using any number of available host
programs for remote files, such as @command{rcp}, @command{scp},
@@ -279,8 +241,7 @@ first time connection to that host, here's what happens:
@value{tramp} invokes @samp{telnet @var{host}} or @samp{rsh @var{host}
-l @var{user}} and establishes an external process to connect to the
remote host. @value{tramp} communicates with the process through an
-@value{emacsname} buffer, which also shows output from the remote
-host.
+Emacs buffer, which also shows output from the remote host.
@item
The remote host may prompt for a login name (for @command{telnet}, for
@@ -358,7 +319,7 @@ behind the scenes when you open a file with @value{tramp}.
@c For the end user
@node Obtaining Tramp
-@chapter Obtaining Tramp.
+@chapter Obtaining @value{tramp}
@cindex obtaining Tramp
@value{tramp} is included as part of Emacs (since Emacs version 22.1).
@@ -380,16 +341,20 @@ navigation bar at the top.
Another way is to follow the terminal session below:
@example
-] @strong{cd ~/@value{emacsdir}}
+@group
+] @strong{cd ~/emacs}
] @strong{git clone git://git.savannah.gnu.org/tramp.git}
+@end group
@end example
@noindent
From behind a firewall:
@example
+@group
] @strong{git config --global http.proxy http://user:pwd@@proxy.server.com:8080}
] @strong{git clone http://git.savannah.gnu.org/r/tramp.git}
+@end group
@end example
@noindent
@@ -400,15 +365,17 @@ Tramp developers:
@end example
@noindent
-After one of the above commands, @file{~/@value{emacsdir}/tramp} will
+After one of the above commands, @file{~/emacs/tramp} will
containing the latest version of @value{tramp}.
@noindent
To fetch updates from the repository, use git pull:
@example
-] @strong{cd ~/@value{emacsdir}/tramp}
+@group
+] @strong{cd ~/emacs/tramp}
] @strong{git pull}
+@end group
@end example
@noindent
@@ -416,8 +383,10 @@ Run @command{autoconf} as follows to generate an up-to-date
@file{configure} script:
@example
-] @strong{cd ~/@value{emacsdir}/tramp}
+@group
+] @strong{cd ~/emacs/tramp}
] @strong{autoconf}
+@end group
@end example
@@ -436,23 +405,14 @@ for version control.
April 2000 was the first time when multi-hop methods were added. In
July 2002, @value{tramp} unified file names with Ange-FTP@. In July
2004, proxy hosts replaced multi-hop methods. Running commands on
-remote hosts was introduced in December 2005.
-@ifset emacsgw
-Support for gateways since April 2007.
-@end ifset
-@ifset emacsgvfs
-GVFS integration started in February 2009.
-@end ifset
-@ifset emacs
-Remote commands on Windows hosts since September 2011.
-@end ifset
-Ad-hoc multi-hop methods (with a changed syntax) re-enabled in November
-2011.
-
-In November 2012, added Juergen Hoetzel's @file{tramp-adb.el}.
-
-In December 2001, XEmacs package repository adds @value{tramp}.
+remote hosts was introduced in December 2005. Support for gateways
+since April 2007 (and removed in December 2016). GVFS integration
+started in February 2009. Remote commands on Windows hosts since
+September 2011. Ad-hoc multi-hop methods (with a changed syntax)
+re-enabled in November 2011. In November 2012, added Juergen
+Hoetzel's @file{tramp-adb.el}.
+XEmacs support has been stopped in January 2016.
@c Installation chapter is necessary only in case of standalone
@c installation. Text taken from trampinst.texi.
@@ -469,21 +429,23 @@ In December 2001, XEmacs package repository adds @value{tramp}.
@value{tramp} is initially configured to use the @command{scp} program
to connect to the remote host. Just type @kbd{C-x C-f} and then enter
file name @file{@trampf{user@@host,/path/to.file}}. For details,
-see @xref{Default Method}.
+@xref{Default Method}, @xref{Default User}, @xref{Default Host}.
-For problems related to the behavior of remote shell, see @ref{Remote
-shell setup} for details.
+For problems related to the behavior of the remote shell, @xref{Remote
+shell setup}.
For changing the connection type and file access method from the
-defaults to one of several other options, see (@pxref{Connection
-types}).
+defaults to one of several other options, @xref{Connection types}.
-@strong{Note} that some user options and variables described in these
-examples are not auto loaded by @value{emacsname}. All examples
-require @value{tramp} is installed and loaded:
+@strong{Note} that some user options described in these examples are
+not auto loaded by Emacs. All examples require @value{tramp} is
+installed and loaded:
@lisp
-(require 'tramp)
+@group
+(custom-set-variables
+ '(tramp-verbose 6 nil (tramp) "Enable remote command traces"))
+@end group
@end lisp
@@ -491,12 +453,7 @@ require @value{tramp} is installed and loaded:
* Connection types:: Types of connections to remote hosts.
* Inline methods:: Inline methods.
* External methods:: External methods.
-@ifset emacsgvfs
* GVFS based methods:: GVFS based external methods.
-@end ifset
-@ifset emacsgw
-* Gateway methods:: Gateway methods.
-@end ifset
* Default Method:: Selecting a default method.
Here we also try to help those who
don't have the foggiest which method
@@ -504,6 +461,7 @@ require @value{tramp} is installed and loaded:
* Default User:: Selecting a default user.
* Default Host:: Selecting a default host.
* Multi-hops:: Connecting to a remote host using multiple hops.
+* Firewalls:: Passing firewalls.
* Customizing Methods:: Using Non-Standard Methods.
* Customizing Completion:: Selecting config files for user/host name completion.
* Password handling:: Reusing passwords for several connections.
@@ -529,11 +487,6 @@ they differ in the file access methods. Choosing the right method
becomes important for editing files, transferring large files, or
operating on a large number of files.
-@cindex inline methods
-@cindex external methods
-@cindex methods, inline
-@cindex methods, external
-
The performance of the external methods is generally better than that
of the inline methods, at least for large files. This is caused by
the need to encode and decode the data when transferring inline.
@@ -561,7 +514,7 @@ Inline methods use the same login connection to transfer file
contents. Inline methods are quick and easy for small files. They
depend on the availability of suitable encoding and decoding programs
on the remote host. For local source and destination, @value{tramp}
-may use built-in equivalents of such programs in @value{emacsname}.
+may use built-in equivalents of such programs in Emacs.
Inline methods can work in situations where an external transfer
program is unavailable. Inline methods also work when transferring
@@ -582,8 +535,9 @@ unavailable, @value{tramp} first transfers a small Perl program to the
remote host, and then tries that program for encoding and decoding.
To increase transfer speeds for large text files, use compression
-before encoding. The variable @var{tramp-inline-compress-start-size}
-specifies the file size for such optimization.
+before encoding. The user option
+@option{tramp-inline-compress-start-size} specifies the file size for
+such optimization.
@table @asis
@item @option{rsh}
@@ -593,7 +547,6 @@ specifies the file size for such optimization.
@command{rsh} is an option for connecting to hosts within local
networks since @command{rsh} is not as secure as other methods.
-
@item @option{ssh}
@cindex method ssh
@cindex ssh method
@@ -604,7 +557,7 @@ remote host.
@command{ssh} can also take extra parameters as port numbers. For
example, a host on port 42 is specified as @file{host#42} (the real
host name, a hash sign, then a port number). It is the same as passing
-@code{-p 42} to the @command{ssh} command.
+@samp{-p 42} to the @command{ssh} command.
@item @option{telnet}
@cindex method telnet
@@ -613,7 +566,6 @@ host name, a hash sign, then a port number). It is the same as passing
Connecting to a remote host with @command{telnet} is as insecure
as the @option{rsh} method.
-
@item @option{su}
@cindex method su
@cindex su method
@@ -630,6 +582,22 @@ the host returned by the function @command{(system-name)}. See
Similar to @option{su} method, @option{sudo} uses @command{sudo}.
@command{sudo} must have sufficient rights to start a shell.
+@item @option{doas}
+@cindex method doas
+@cindex doas method
+
+This method is used on OpenBSD like the @command{sudo} command.
+
+@item @option{sg}
+@cindex method sg
+@cindex sg method
+
+The @command{sg} program allows editing as different group. The host
+can be either @samp{localhost} or the host returned by the function
+@command{(system-name)}. The user name must be specified, but it
+denotes a group name. See @ref{Multi-hops} for an exception to this
+behavior.
+
@item @option{sshx}
@cindex method sshx
@cindex sshx method
@@ -666,7 +634,6 @@ This method is also similar to @option{ssh}. It uses the
This is another method from the Kerberos suite. It behaves like @option{su}.
-
@item @option{plink}
@cindex method plink
@cindex plink method
@@ -680,7 +647,6 @@ session.
@option{plink} method supports the @samp{-P} argument.
-
@item @option{plinkx}
@cindex method plinkx
@cindex plinkx method
@@ -712,7 +678,7 @@ files smaller than @var{tramp-copy-size-limit} still use inline
methods.
@table @asis
-@item @option{rcp}---@command{rsh} and @command{rcp}
+@item @option{rcp}
@cindex method rcp
@cindex rcp method
@cindex rcp (with rcp method)
@@ -725,7 +691,7 @@ access method available.
The alternative method @option{remcp} uses the @command{remsh} and
@command{rcp} commands.
-@item @option{scp}---@command{ssh} and @command{scp}
+@item @option{scp}
@cindex method scp
@cindex scp method
@cindex scp (with scp method)
@@ -742,7 +708,7 @@ port numbers. For example, @file{host#42} passes @samp{-p 42} in the
argument list to @command{ssh}, and @samp{-P 42} in the argument list
to @command{scp}.
-@item @option{rsync}---@command{ssh} and @command{rsync}
+@item @option{rsync}
@cindex method rsync
@cindex rsync method
@cindex rsync (with rsync method)
@@ -757,8 +723,7 @@ is lost if the file exists only on one side of the connection.
This method supports the @samp{-p} argument.
-
-@item @option{scpx}---@command{ssh} and @command{scp}
+@item @option{scpx}
@cindex method scpx
@cindex scpx method
@cindex scp (with scpx method)
@@ -768,15 +733,14 @@ This method supports the @samp{-p} argument.
in performance to @option{scp}. @option{scpx} uses @samp{ssh -t -t
@var{host} -l @var{user} /bin/sh} to open a connection.
-@option{sshx} is useful for Windows users when @command{ssh} triggers
+@option{scpx} is useful for Windows users when @command{ssh} triggers
an error about allocating a pseudo tty. This happens due to missing
shell prompts that confuses @value{tramp}.
This method supports the @samp{-p} argument.
-
-@item @option{pscp}---@command{plink} and @command{pscp}
-@item @option{psftp}---@command{plink} and @command{psftp}
+@item @option{pscp}
+@item @option{psftp}
@cindex method pscp
@cindex pscp method
@cindex pscp (with pscp method)
@@ -798,8 +762,7 @@ session.
These methods support the @samp{-P} argument.
-
-@item @option{fcp}---@command{fsh} and @command{fcp}
+@item @option{fcp}
@cindex method fcp
@cindex fcp method
@cindex fsh (with fcp method)
@@ -822,7 +785,7 @@ The command used for this connection is: @samp{fsh @var{host} -l
not useful for @value{tramp}. @command{fsh} connects to remote host
and @value{tramp} keeps that one connection open.
-@item @option{nc}---@command{telnet} and @command{nc}
+@item @option{nc}
@cindex method nc
@cindex nc method
@cindex nc (with nc method)
@@ -839,15 +802,10 @@ decode programs.
@cindex ftp method
When @value{tramp} uses @option{ftp}, it forwards requests to whatever
-ftp program is specified by @value{ftppackagename}. This external
-program must be capable of servicing requests from @value{tramp}.
-
-@ifset xemacs
-This method works only for unified file names, see @ref{Issues}.
-@end ifset
-
+ftp program is specified by Ange FTP. This external program must be
+capable of servicing requests from @value{tramp}.
-@item @option{smb}---@command{smbclient}
+@item @option{smb}
@cindex method smb
@cindex smb method
@@ -866,7 +824,7 @@ Since SMB shares end in the @code{$} character, @value{tramp} must use
substitutions.
When @value{tramp} is not specific about the share name or uses the
-generic remote directory @code{/}, @command{smbclient} returns all
+generic remote directory @file{/}, @command{smbclient} returns all
available shares.
Since SMB authentication is based on each SMB share, @value{tramp}
@@ -905,9 +863,9 @@ uses the anonymous user (without prompting for password). This
behavior is unlike other @value{tramp} methods, where local user name
is substituted.
-The @option{smb} method is unavailable if @value{emacsname} is run under a
-local user authentication context in MS Windows. However such users
-can still access remote files using UNC file names instead of @value{tramp}:
+The @option{smb} method is unavailable if Emacs is run under a local
+user authentication context in MS Windows. However such users can
+still access remote files using UNC file names instead of @value{tramp}:
@example
//melancholia/daniel$$/.emacs
@@ -925,20 +883,20 @@ can.
This method uses Android Debug Bridge program for accessing Android
devices. The Android Debug Bridge must be installed locally for
@value{tramp} to work. Some GNU/Linux distributions provide Android
-Debug Bridge as an installation package. Alternatively, the program is
-installed as part of the Android SDK@. @value{tramp} finds the
+Debug Bridge as an installation package. Alternatively, the program
+is installed as part of the Android SDK@. @value{tramp} finds the
@command{adb} program either via the @env{PATH} environment variable
-or the absolute path set in the variable @var{tramp-adb-program}.
+or the absolute path set in the user option @option{tramp-adb-program}.
@value{tramp} connects to Android devices with @option{adb} only when
-the custom option @option{tramp-adb-connect-if-not-connected} is not
+the user option @option{tramp-adb-connect-if-not-connected} is not
@code{nil}. Otherwise, the connection must be established outside
-@value{emacsname}.
+Emacs.
@value{tramp} does not require a host name part of the remote file
name when a single Android device is connected to @command{adb}.
-@value{tramp} instead uses @file{@trampfn{adb,,}} as the default
-name. @command{adb devices} shows available host names.
+@value{tramp} instead uses @file{@trampfn{adb,,}} as the default name.
+@command{adb devices} shows available host names.
@option{adb} method normally does not need user name to authenticate
on the Android device because it runs under the @command{adbd}
@@ -955,7 +913,6 @@ numbers are not applicable to Android devices connected through USB@.
@end table
-@ifset emacsgvfs
@node GVFS based methods
@section GVFS based external methods
@cindex methods, gvfs
@@ -967,9 +924,9 @@ GVFS is the virtual file system for the Gnome Desktop,
mounted locally through FUSE and @value{tramp} uses this locally
mounted directory internally.
-@value{emacsname} uses the D-Bus mechanism to communicate with GVFS@.
-@value{emacsname} must have the message bus system, D-Bus integration
-active, @pxref{Top, , D-Bus, dbus}.
+Emacs uses the D-Bus mechanism to communicate with GVFS@. Emacs must
+have the message bus system, D-Bus integration active, @pxref{Top, ,
+D-Bus, dbus}.
@table @asis
@item @option{afp}
@@ -992,6 +949,22 @@ syntax requires a leading volume (share) name, for example:
based on standard protocols, such as HTTP@. @option{davs} does the same
but with SSL encryption. Both methods support the port numbers.
+@item @option{gdrive}
+@cindex method gdrive
+@cindex gdrive method
+@cindex Google Drive
+
+Via the @option{gdrive} method it is possible to access your Google
+Drive online storage. User and host name of the remote file name are
+your email address of the Google Drive credentials, like
+@file{@trampfn{gdrive,john.doe@@gmail.com,/}}. These credentials must
+be populated in your @command{Online Accounts} application outside Emacs.
+
+Since Google Drive uses cryptic blob file names internally,
+@value{tramp} works with the @code{display-name} of the files. This
+could produce unexpected behavior in case two files in the same
+directory have the same @code{display-name}, such a situation must be avoided.
+
@item @option{obex}
@cindex method obex
@cindex obex method
@@ -999,7 +972,6 @@ but with SSL encryption. Both methods support the port numbers.
OBEX is an FTP-like access protocol for cell phones and similar simple
devices. @value{tramp} supports OBEX over Bluetooth.
-
@item @option{sftp}
@cindex method sftp
@cindex sftp method
@@ -1019,81 +991,32 @@ requires the SYNCE-GVFS plugin.
@end table
@defopt tramp-gvfs-methods
-@vindex tramp-gvfs-methods
-This custom option is a list of external methods for GVFS@. By
-default, this list includes @option{afp}, @option{dav}, @option{davs},
-@option{obex}, @option{sftp} and @option{synce}. Other methods to
-include are: @option{ftp} and @option{smb}.
+This user option is a list of external methods for GVFS@. By default,
+this list includes @option{afp}, @option{dav}, @option{davs},
+@option{gdrive}, @option{obex}, @option{sftp} and @option{synce}.
+Other methods to include are: @option{ftp} and @option{smb}.
@end defopt
-@end ifset
-
-
-@ifset emacsgw
-@node Gateway methods
-@section Gateway methods
-@cindex methods, gateway
-@cindex gateway methods
-
-Gateway methods are for proxy host declarations (@pxref{Multi-hops})
-so as to pass through firewalls and proxy servers. They are not like
-the other methods that declare direct connections to a remote host.
-
-A gateway method always comes with a port setting. @value{tramp}
-targets the port number with the gateway method
-@file{localhost#random_port} from where the firewall or proxy server
-is accessed.
-
-Gateway methods support user name and password declarations for
-authenticating the corresponding firewall or proxy server. Such
-authentication can be passed through only if granted access by system
-administrators.
-
-@table @asis
-@item @option{tunnel}
-@cindex method tunnel
-@cindex tunnel method
-
-This method implements an HTTP tunnel via the @command{CONNECT}
-command (conforming to RFC 2616, 2817 specifications). Proxy servers
-using HTTP version 1.1 or later protocol support this command.
-
-For authentication, this protocol uses only @option{Basic
-Authentication} (see RFC 2617). When no port number is specified, this
-protocol defaults to @option{8080}.
-
-
-@item @option{socks}
-@cindex method socks
-@cindex socks method
-
-The @option{socks} method connects to SOCKSv5 servers (see RFC 1928)
-and supports @option{Username/Password Authentication}.
-
-The default port number for the socks server is @option{1080}, if not
-specified otherwise.
-
-@end table
-@end ifset
@node Default Method
@section Selecting a default method
@cindex default method
-@vindex tramp-default-method
-@vindex tramp-default-method-alist
-Default method is for transferring files. The variable
-@code{tramp-default-method} sets it. @value{tramp} uses this variable
-to determine the default method for tramp file names that do not have
-one specified.
+@defopt tramp-default-method
+Default method is for transferring files. The user option
+@option{tramp-default-method} sets it. @value{tramp} uses this user
+option to determine the default method for remote file names that do
+not have one specified.
@lisp
-(setq tramp-default-method "ssh")
+(custom-set-variables '(tramp-default-method "ssh" nil (tramp)))
@end lisp
+@end defopt
+@defopt tramp-default-method-alist
Default methods for transferring files can be customized for specific
-user and host combinations through the alist variable
-@code{tramp-default-method-alist}.
+user and host combinations through the user option
+@option{tramp-default-method-alist}.
For example, the following two lines specify to use the @option{ssh}
method for all user names matching @samp{john} and the @option{rsync}
@@ -1102,22 +1025,18 @@ specifies to use the @option{su} method for the user @samp{root} on
the host @samp{localhost}.
@lisp
+@group
(add-to-list 'tramp-default-method-alist '("" "john" "ssh"))
(add-to-list 'tramp-default-method-alist '("lily" "" "rsync"))
(add-to-list 'tramp-default-method-alist
'("\\`localhost\\'" "\\`root\\'" "su"))
+@end group
@end lisp
+@end defopt
@noindent
-See the documentation for the variable
-@code{tramp-default-method-alist} for details.
-
-@noindent
-External methods performance faster for large files.
-
-@noindent
-@xref{Inline methods}.
-@xref{External methods}.
+External methods performance faster for large files. @pxref{Inline
+methods}. @pxref{External methods}.
Choosing the access method also depends on the security environment.
For example, @option{rsh} and @option{telnet} methods that use clear
@@ -1169,85 +1088,91 @@ improvement is not always true.
@node Default User
@section Selecting a default user
@cindex default user
-@vindex tramp-default-user
-@vindex tramp-default-user-alist
+@defopt tramp-default-user
@value{tramp} file name can omit the user name part since
@value{tramp} substitutes the currently logged-in user name. However
-this substitution can be overridden with @code{tramp-default-user}.
+this substitution can be overridden with @option{tramp-default-user}.
For example:
@lisp
-(setq tramp-default-user "root")
+(custom-set-variables'(tramp-default-user "root" nil (tramp)))
@end lisp
+@end defopt
-Instead of a single default user, @code{tramp-default-user-alist}
+@defopt tramp-default-user-alist
+Instead of a single default user, @option{tramp-default-user-alist}
allows multiple default user values based on access method or host
name combinations. The alist can hold multiple values. For example, to
use the @samp{john} as the default user for the domain
@samp{somewhere.else} only:
@lisp
+@group
(add-to-list 'tramp-default-user-alist
'("ssh" ".*\\.somewhere\\.else\\'" "john"))
+@end group
@end lisp
-@noindent
-See the documentation for the variable @code{tramp-default-user-alist}
-for more details.
-
A Caution: @value{tramp} will override any default user specified in
-the configuration files outside @value{emacsname}, such as
-@file{~/.ssh/config}. To stop @value{tramp} from applying the default
-value, set the corresponding alist entry to nil:
+the configuration files outside Emacs, such as @file{~/.ssh/config}.
+To stop @value{tramp} from applying the default value, set the
+corresponding alist entry to nil:
@lisp
+@group
(add-to-list 'tramp-default-user-alist
'("ssh" "\\`here\\.somewhere\\.else\\'" nil))
+@end group
@end lisp
-The last entry in @code{tramp-default-user-alist} should be reserved
+The last entry in @option{tramp-default-user-alist} should be reserved
for catch-all or most often used login.
@lisp
+@group
(add-to-list 'tramp-default-user-alist
'(nil nil "jonas") t)
+@end group
@end lisp
+@end defopt
@node Default Host
@section Selecting a default host
@cindex default host
-@vindex tramp-default-host
-@vindex tramp-default-host-alist
+@defopt tramp-default-host
When host name is omitted, @value{tramp} substitutes the value from
-the @code{tramp-default-host} variable. It is initially populated with
-the local hostname where @value{emacsname} is running. Both the
+the @option{tramp-default-host} user option. It is initially
+populated with the local hostname where Emacs is running. Both the
default user and default host can be overridden as follows:
@lisp
-(setq tramp-default-user "john"
- tramp-default-host "target")
+@group
+(custom-set-variables
+ '(tramp-default-user "john" nil (tramp))
+ '(tramp-default-host "target" nil (tramp)))
+@end group
@end lisp
With both defaults set, @samp{@trampfn{ssh,,}} will connect
-@value{tramp} to John's home directory on target.
+@value{tramp} to John's home directory on @code{target}.
-@ifset emacs
@strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix
for quoted file names.
-@end ifset
+@ifinfo
+@pxref{Quoted File Names, , , emacs}.
+@end ifinfo
+@end defopt
-Instead of a single default host, @code{tramp-default-host-alist}
+@defopt tramp-default-host-alist
+Instead of a single default host, @option{tramp-default-host-alist}
allows multiple default host values based on access method or user
name combinations. The alist can hold multiple values. While
-@code{tramp-default-host} is sufficient in most cases, some methods,
+@option{tramp-default-host} is sufficient in most cases, some methods,
like @option{adb}, require defaults overwritten.
-
-@noindent
-See the documentation for the variable @code{tramp-default-host-alist}
-for more details.
+@end defopt
@node Multi-hops
@@ -1263,10 +1188,9 @@ hop kind, where the start and end points of the connection did not
have intermediate check points.
@defopt tramp-default-proxies-alist
-@vindex tramp-default-proxies-alist
@option{tramp-default-proxies-alist} specifies proxy hosts to pass
-through. This variable is list of triples consisting of (@var{host}
-@var{user} @var{proxy}).
+through. This user option is list of triples consisting of
+@code{(@var{host} @var{user} @var{proxy})}.
The first match is the proxy host through which passes the file name
and the target host matching @var{user}@@@var{host}. @var{host} and
@@ -1276,24 +1200,20 @@ regular expression which always matches.
@var{proxy} is a literal @value{tramp} file name whose local name part
is ignored, and the method and user name parts are optional.
-@ifset emacsgw
-The method must be an inline or gateway method (@pxref{Inline
-methods}, @pxref{Gateway methods}).
-@end ifset
-@ifclear emacsgw
-The method must be an inline method (@pxref{Inline methods}).
-@end ifclear
-If @var{proxy} is @code{nil}, no additional hop is required reaching
+The method must be an inline method (@pxref{Inline methods}). If
+@var{proxy} is @code{nil}, no additional hop is required reaching
@var{user}@@@var{host}.
For example, to pass through the host @samp{bastion.your.domain} as
user @samp{bird} to reach remote hosts outside the local domain:
@lisp
+@group
(add-to-list 'tramp-default-proxies-alist
'("\\." nil "@trampfn{ssh,bird@@bastion.your.domain,}"))
(add-to-list 'tramp-default-proxies-alist
'("\\.your\\.domain\\'" nil nil))
+@end group
@end lisp
@strong{Note}: @code{add-to-list} adds elements at the beginning of a
@@ -1304,10 +1224,12 @@ called @samp{jump.your.domain}, which is the only host allowed to
connect to @samp{bastion.your.domain}, then:
@lisp
+@group
(add-to-list 'tramp-default-proxies-alist
'("\\`bastion\\.your\\.domain\\'"
"\\`bird\\'"
"@trampfn{ssh,jump.your.domain,}"))
+@end group
@end lisp
@var{proxy} can take patterns @code{%h} or @code{%u} for @var{host} or
@@ -1318,13 +1240,15 @@ To login as @samp{root} on remote hosts in the domain
access, then use this alist entry:
@lisp
+@group
(add-to-list 'tramp-default-proxies-alist
'("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh,%h,}"))
+@end group
@end lisp
-Opening @file{@trampfn{sudo,randomhost.your.domain,}} first
-connects to @samp{randomhost.your.domain} via @code{ssh} under your
-account name, and then perform @code{sudo -u root} on that host.
+Opening @file{@trampfn{sudo,randomhost.your.domain,}} first connects
+to @samp{randomhost.your.domain} via @code{ssh} under your account
+name, and then perform @code{sudo -u root} on that host.
It is key for the sudo method in the above example to be applied on
the host after reaching it and not on the local host.
@@ -1337,37 +1261,13 @@ local one, first connect via @command{ssh}, and then apply
@command{sudo -u root}:
@lisp
+@group
(add-to-list 'tramp-default-proxies-alist
'(nil "\\`root\\'" "@trampfn{ssh,%h,}"))
(add-to-list 'tramp-default-proxies-alist
'((regexp-quote (system-name)) nil nil))
+@end group
@end lisp
-
-The above configuration allows @value{tramp} connection as @samp{root}
-to remote Ubuntu hosts.
-
-@ifset emacsgw
-@code{tramp-default-proxies-alist} is also used for passing through
-firewalls or proxy servers.
-
-For example, the local host @samp{proxy.your.domain} on port 3128
-serves as HTTP proxy to the outer world. User has access rights to
-another proxy server on @samp{host.other.domain}.@footnote{HTTP tunnels
-are intended for secure SSL/TLS communication. Therefore, many proxy
-servers restrict the tunnels to related target ports. You might need
-to run your ssh server on your target host @samp{host.other.domain} on
-such a port, like 443 (https). See
-@uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall} for
-discussion of ethical issues.} Then the configuration is:
-
-@lisp
-(add-to-list 'tramp-default-proxies-alist
- '("\\`host\\.other\\.domain\\'" nil
- "@trampfn{tunnel,proxy.your.domain#3128,}"))
-@end lisp
-
-Gateway methods in a multiple hop chain can be declared only as the first hop.
-@end ifset
@end defopt
Passing through hops involves dealing with restricted shells, such as
@@ -1375,7 +1275,6 @@ Passing through hops involves dealing with restricted shells, such as
them for proxies only.
@defopt tramp-restricted-shell-hosts-alist
-@vindex tramp-restricted-shell-hosts-alist
An alist of regular expressions of hosts running restricted shells,
such as @command{rbash}. @value{tramp} will then use them only as
proxies.
@@ -1384,12 +1283,58 @@ To specify the bastion host from the example above as running a
restricted shell:
@lisp
+@group
(add-to-list 'tramp-restricted-shell-hosts-alist
"\\`bastion\\.your\\.domain\\'")
+@end group
@end lisp
@end defopt
+@node Firewalls
+@section Passing firewalls
+@cindex HTTP tunnel
+@cindex proxy hosts, HTTP tunnel
+
+Sometimes, it is not possible to reach a remote host directly. A
+firewall might be in the way, which could be passed via a proxy
+server.
+
+Both ssh and PuTTY support such proxy settings, using an HTTP tunnel
+via the @command{CONNECT} command (conforming to RFC 2616, 2817
+specifications). Proxy servers using HTTP version 1.1 or later
+protocol support this command.
+
+@subsection Tunneling with ssh
+
+With ssh, you could use the @code{ProxyCommand} entry in the
+@file{~/.ssh/config}:
+
+@example
+@group
+Host host.other.domain
+ ProxyCommand nc -X connect -x proxy.your.domain:3128 %h %p
+@end group
+@end example
+
+@code{nc} is BSD's netcat program, which establishes HTTP tunnels. Any
+other program with such a feature could be used as well.
+
+In the example, opening @file{@trampfn{ssh,host.your.domain,}} passes
+the HTTP proxy server @samp{proxy.your.domain} on port 3128.
+
+@subsection Tunneling with PuTTY
+
+PuTTY does not need an external program, HTTP tunnel support is
+built-in. In the PuTTY config program, create a session for
+@samp{host.your.domain}. In the @option{Connection/Data} entry,
+select the @option{HTTP} option, and add @samp{proxy.your.domain} as
+@option{Proxy hostname}, and 3128 as @option{Port}.
+
+Opening @file{@trampfn{plinkx,host.your.domain,}} passes the HTTP
+proxy server @samp{proxy.your.domain} on port 3128.
+
+
@node Customizing Methods
@section Using Non-Standard Methods
@cindex customizing methods
@@ -1424,10 +1369,12 @@ This function returns the list of completion functions for @var{method}.
Example:
@example
+@group
(tramp-get-completion-function "rsh")
@result{} ((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "~/.rhosts"))
+@end group
@end example
@end defun
@@ -1437,12 +1384,14 @@ for @var{method}.
Example:
@example
+@group
(tramp-set-completion-function "ssh"
'((tramp-parse-sconfig "/etc/ssh_config")
(tramp-parse-sconfig "~/.ssh/config")))
@result{} ((tramp-parse-sconfig "/etc/ssh_config")
(tramp-parse-sconfig "~/.ssh/config"))
+@end group
@end example
@end defun
@@ -1464,7 +1413,7 @@ This function parses files which are syntactical equivalent to
in such files, it can return host names only.
@item @code{tramp-parse-sconfig}
-@findex tramp-parse-shosts
+@findex tramp-parse-sconfig
This function returns the host nicknames defined by @code{Host} entries
in @file{~/.ssh/config} style files.
@@ -1478,7 +1427,7 @@ SSH2 parsing of directories @file{/etc/ssh2/hostkeys/*} and
are always @code{nil}.
@item @code{tramp-parse-sknownhosts}
-@findex tramp-parse-shostkeys
+@findex tramp-parse-sknownhosts
Another SSH2 style parsing of directories like
@file{/etc/ssh2/knownhosts/*} and @file{~/ssh2/knownhosts/*}. This
@@ -1495,6 +1444,11 @@ A function dedicated to @file{/etc/hosts} for host names.
A function which parses @file{/etc/passwd} files for user names.
+@item @code{tramp-parse-etc-group}
+@findex tramp-parse-etc-group
+
+A function which parses @file{/etc/group} files for group names.
+
@item @code{tramp-parse-netrc}
@findex tramp-parse-netrc
@@ -1513,9 +1467,11 @@ taken as candidates for completion for user and host names.
Example:
@example
+@group
(my-tramp-parse "~/.my-tramp-hosts")
@result{} ((nil "toto") ("daniel" "melancholia"))
+@end group
@end example
@end defun
@@ -1563,27 +1519,14 @@ Setting @code{auth-source-debug} to @code{t} to debug messages.
the same user or host name independent of the access method.
@vindex password-cache-expiry
-
@code{password-cache-expiry} sets the duration (in seconds) the
passwords are remembered. Passwords are never saved permanently nor
-can they extend beyond the lifetime of the current @value{emacsname}
-session. Set @code{password-cache-expiry} to @code{nil} to disable
-expiration.
+can they extend beyond the lifetime of the current Emacs session. Set
+@code{password-cache-expiry} to @code{nil} to disable expiration.
@vindex password-cache
-
Set @code{password-cache} to @code{nil} to disable password caching.
-@strong{Implementation Note}: password caching depends on
-@file{password-cache.el} package. @value{tramp} activates password
-caching only if @value{tramp} can discover, while @value{emacsname} is
-loading, the package through @code{load-path}.
-
-@ifset installchapter
-@file{password.el} is available from No Gnus or from the @value{tramp}
-@file{contrib} directory, see @ref{Installation parameters}.
-@end ifset
-
@node Connection caching
@section Reusing connection related information
@@ -1591,22 +1534,17 @@ loading, the package through @code{load-path}.
@vindex tramp-persistency-file-name
For faster initial connection times, @value{tramp} stores previous
-connection properties in a file specified by the variable
-@code{tramp-persistency-file-name}.
+connection properties in a file specified by the user option
+@option{tramp-persistency-file-name}.
-The default file name for @code{tramp-persistency-file-name} is:
-@ifset emacs
+The default file name for @option{tramp-persistency-file-name} is
@file{~/.emacs.d/tramp}.
-@end ifset
-@ifset xemacs
-@file{~/.xemacs/tramp}.
-@end ifset
-@value{tramp} reads this file during @value{emacsname} startup, and
-writes to it when exiting @value{emacsname}. Delete this file for
-@value{tramp} to recreate a new one on next @value{emacsname} startup.
+@value{tramp} reads this file during Emacs startup, and writes to it
+when exiting Emacs. Delete this file for @value{tramp} to recreate a
+new one on next Emacs startup.
-Set @code{tramp-persistency-file-name} to @code{nil} to disable
+Set @option{tramp-persistency-file-name} to @code{nil} to disable
storing connections persistently.
To reuse connection information from the persistent list,
@@ -1633,11 +1571,12 @@ connection related information for that host and creates a new entry.
For more precise customization, parameters specified by
@code{tramp-methods} can be overwritten manually.
-Set @code{tramp-connection-properties} to manually override
+Set @option{tramp-connection-properties} to manually override
@code{tramp-methods}. Properties in this list are in the form
-@code{(@var{regexp} @var{property} @var{value})}. @var{regexp} matches
-remote file names. Use @code{nil} to match all. @var{property} is the
-property's name, and @var{value} is the property's value.
+@code{(@var{regexp} @var{property} @var{value})}. @var{regexp}
+matches remote file names. Use @code{nil} to match all.
+@var{property} is the property's name, and @var{value} is the
+property's value.
@var{property} is any method specific parameter contained in
@code{tramp-methods}. The parameter key in @code{tramp-methods} is a
@@ -1646,12 +1585,17 @@ string @samp{<foo>} for @var{property}. For example, this changes the
remote shell:
@lisp
+@group
(add-to-list 'tramp-connection-properties
(list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
"remote-shell" "/bin/ksh"))
+@end group
+
+@group
(add-to-list 'tramp-connection-properties
(list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
"remote-shell-login" '("-")))
+@end group
@end lisp
The parameters @code{tramp-remote-shell} and
@@ -1659,15 +1603,17 @@ The parameters @code{tramp-remote-shell} and
values for the remote host.
@var{property} could also be any property found in
-@code{tramp-persistency-file-name}.
+@option{tramp-persistency-file-name}.
To get around how restricted shells randomly drop connections, set the
special property @samp{busybox}. For example:
@lisp
+@group
(add-to-list 'tramp-connection-properties
(list (regexp-quote "@trampfn{ssh,user@@randomhost.your.domain,}")
"busybox" t))
+@end group
@end lisp
@@ -1686,12 +1632,10 @@ To improve performance and accuracy of remote file access,
@command{grep} when available.
@defopt tramp-remote-path
-@vindex tramp-remote-path
-@vindex tramp-default-remote-path
-@vindex tramp-own-remote-path
@option{tramp-remote-path} specifies which remote directory paths
@value{tramp} can search for @ref{Remote programs}.
+@vindex tramp-default-remote-path
@value{tramp} uses standard defaults, such as @file{/bin} and
@file{/usr/bin}, which are reasonable for most hosts. To accommodate
differences in hosts and paths, for example, @file{/bin:/usr/bin} on
@@ -1708,21 +1652,25 @@ shown below for @value{tramp} to use when connecting.
(add-to-list 'tramp-remote-path "/usr/local/perl/bin")
@end lisp
+@vindex tramp-own-remote-path
Another way to find the remote path is to use the path assigned to the
remote user by the remote host. @value{tramp} does not normally retain
-this remote path after logging. However, @code{tramp-own-remote-path}
+this remote path after login. However, @code{tramp-own-remote-path}
preserves the path value, which can be used to update
-@code{tramp-remote-path}.
+@option{tramp-remote-path}.
@lisp
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
@end lisp
+
+@strong{Note} that this works only if your remote @command{/bin/sh}
+shell supports the login argument @samp{-l}.
@end defopt
When remote search paths are changed, local @value{tramp} caches must
be recomputed. To force @value{tramp} to recompute afresh, exit
-@value{emacsname}, remove the persistent file (@pxref{Connection
-caching}), and restart @value{emacsname}.
+Emacs, remove the persistent file (@pxref{Connection caching}), and
+restart Emacs.
@node Remote shell setup
@@ -1753,42 +1701,47 @@ login security, especially not the exotic ones. However, @value{tramp}
provides a few tweaks to address the most common ones.
@table @asis
-@item @var{tramp-shell-prompt-pattern}
+@item @option{tramp-shell-prompt-pattern}
@vindex tramp-shell-prompt-pattern
-@code{tramp-shell-prompt-pattern} is for remote login shell prompt,
+@option{tramp-shell-prompt-pattern} is for remote login shell prompt,
which may not be the same as the local login shell prompt,
@code{shell-prompt-pattern}. Since most hosts use identical prompts,
@value{tramp} sets a similar default value for both prompts.
-@item @var{tramp-password-prompt-regexp}
-@item @var{tramp-wrong-passwd-regexp}
+@item @option{tramp-password-prompt-regexp}
+@item @option{tramp-wrong-passwd-regexp}
@vindex tramp-password-prompt-regexp
@vindex tramp-wrong-passwd-regexp
-@value{tramp} uses @var{tramp-password-prompt-regexp} to distinguish
-between prompts for passwords and prompts for passphrases. By default,
-@var{tramp-password-prompt-regexp} handles the detection in English
-language environments. See a localization example below:
+@value{tramp} uses @option{tramp-password-prompt-regexp} to
+distinguish between prompts for passwords and prompts for passphrases.
+By default, @option{tramp-password-prompt-regexp} handles the
+detection in English language environments. See a localization
+example below:
@lisp
-(setq
- tramp-password-prompt-regexp
- (concat
- "^.*"
- (regexp-opt
- '("passphrase" "Passphrase"
- ;; English
- "password" "Password"
- ;; Deutsch
- "passwort" "Passwort"
- ;; Français
- "mot de passe" "Mot de passe") t)
- ".*:\0? *"))
+@group
+(custom-set-variables
+ '(tramp-password-prompt-regexp
+ (concat
+ "^.*"
+ (regexp-opt
+ '("passphrase" "Passphrase"
+ ;; English
+ "password" "Password"
+ ;; Deutsch
+ "passwort" "Passwort"
+ ;; Français
+ "mot de passe" "Mot de passe")
+ t)
+ ".*:\0? *")
+ nil (tramp)))
+@end group
@end lisp
Similar localization may be necessary for handling wrong password
-prompts, for which @value{tramp} uses @var{tramp-wrong-passwd-regexp}.
+prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}.
@item @command{tset} and other questions
@cindex Unix command tset
@@ -1797,8 +1750,8 @@ prompts, for which @value{tramp} uses @var{tramp-wrong-passwd-regexp}.
To suppress inappropriate prompts for terminal type, @value{tramp}
sets the @env{TERM} to @code{dumb} before the remote login process
-begins via the variable @code{tramp-terminal-type}. This will silence
-common @command{tset} related prompts.
+begins via the user option @option{tramp-terminal-type}. This will
+silence common @command{tset} related prompts.
@value{tramp}'s strategy for handling such prompts (commonly triggered
from login scripts on remote hosts) is to set the environment
@@ -1806,26 +1759,31 @@ variables so that no prompts interrupt the shell initialization
process.
@vindex tramp-actions-before-shell
-
An alternative approach is to configure @value{tramp} with strings
that can identify such questions using
@code{tramp-actions-before-shell}. Example:
@lisp
+@group
(defconst my-tramp-prompt-regexp
(concat (regexp-opt '("Enter the birth date of your mother:") t)
"\\s-*")
"Regular expression matching my login prompt question.")
+@end group
+@group
(defun my-tramp-action (proc vec)
"Enter \"19000101\" in order to give a correct answer."
(save-window-excursion
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string))
(tramp-send-string vec "19000101"))))
+@end group
+@group
(add-to-list 'tramp-actions-before-shell
'(my-tramp-prompt-regexp my-tramp-action))
+@end group
@end lisp
@@ -1886,16 +1844,16 @@ follows:
Then re-set the prompt string in @file{~/.emacs_SHELLNAME} as follows:
@example
+@group
# Reset the prompt for remote Tramp shells.
if [ "$@{INSIDE_EMACS/*tramp*/tramp@}" == "tramp" ] ; then
PS1="[\u@@\h \w]$ "
fi
+@end group
@end example
@ifinfo
-@ifset emacs
-@xref{Interactive Shell, , , @value{emacsdir}}.
-@end ifset
+@xref{Interactive Shell, , , emacs}.
@end ifinfo
@item @command{busybox} / @command{nc}
@@ -1910,13 +1868,16 @@ install and execute a listener as follows (see @code{tramp-methods}):
@end example
The above command-line syntax has changed with @command{busybox}
-versions. If @command{nc} refuses the @command{-p} parameter, then
+versions. If @command{nc} refuses the @samp{-p} parameter, then
overwrite as follows:
@lisp
+@group
(add-to-list
'tramp-connection-properties
- `(,(regexp-quote "192.168.0.1") "remote-copy-args" (("-l") ("%r"))))
+ `(,(regexp-quote "192.168.0.1")
+ "remote-copy-args" (("-l") ("%r"))))
+@end group
@end lisp
@noindent
@@ -1938,13 +1899,15 @@ Applications such as @code{SSHDroid} that run @command{sshd} process
on the Android device can accept any @option{ssh}-based methods
provided these settings are adjusted:
-@code{sh} must be specified for remote shell since Android devices do
-not provide @code{/bin/sh}. @code{sh} will then invoke whatever shell is
-installed on the device with this setting:
+@command{sh} must be specified for remote shell since Android devices
+do not provide @command{/bin/sh}. @command{sh} will then invoke
+whatever shell is installed on the device with this setting:
@lisp
+@group
(add-to-list 'tramp-connection-properties
(list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
+@end group
@end lisp
@noindent
@@ -1956,8 +1919,10 @@ user settings. Android devices prefer @file{/system/xbin} path over
@file{/system/bin}. Both of these are set as follows:
@lisp
+@group
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(add-to-list 'tramp-remote-path "/system/xbin")
+@end group
@end lisp
@noindent
@@ -1970,17 +1935,19 @@ directory for temporary files:
@noindent
Open a remote connection with the command @kbd{C-x C-f
-@trampfn{ssh,192.168.0.26#2222,}}, where @command{sshd} is listening on port
-@samp{2222}.
+@trampfn{ssh,192.168.0.26#2222,}}, where @command{sshd} is listening
+on port @samp{2222}.
To add a corresponding entry to the @file{~/.ssh/config} file
(recommended), use this:
@example
+@group
Host android
HostName 192.168.0.26
User root
Port 2222
+@end group
@end example
@noindent
@@ -1988,8 +1955,10 @@ To use the host name @samp{android} instead of the IP address shown in
the previous example, fix the connection properties as follows:
@lisp
+@group
(add-to-list 'tramp-connection-properties
(list (regexp-quote "android") "remote-shell" "sh"))
+@end group
@end lisp
@noindent
@@ -2001,64 +1970,40 @@ Open a remote connection with a more concise command @kbd{C-x C-f
@section Auto-save and Backup configuration
@cindex auto-save
@cindex backup
-@ifset emacs
@vindex backup-directory-alist
-@end ifset
-@ifset xemacs
-@vindex bkup-backup-directory-info
-@end ifset
-To avoid @value{tramp} from saving backup files owned by root to
-locations accessible to others, default backup settings in
-@ifset emacs
-@code{backup-directory-alist}
-@end ifset
-@ifset xemacs
-@code{bkup-backup-directory-info}
-@end ifset
-have to be altered.
+To avoid @value{tramp} from saving backup files owned by @samp{root}
+to locations accessible to others, default backup settings in
+@option{backup-directory-alist} have to be altered.
-Here's a scenario where files could be inadvertently
-exposed. @value{emacsname} by default writes backup files to the same
-directory as the original files unless changed to another location,
-such as @file{~/.emacs.d/backups/}. Such a directory will also be used
-by default by @value{tramp} when using, say, a restricted file
+Here's a scenario where files could be inadvertently exposed. Emacs
+by default writes backup files to the same directory as the original
+files unless changed to another location, such as
+@file{~/.emacs.d/backups/}. Such a directory will also be used by
+default by @value{tramp} when using, say, a restricted file
@file{@trampfn{su,root@@localhost,/etc/secretfile}}. The backup file
-of the secretfile is now owned by the user logged in from tramp and
-not root.
+of the secretfile is now owned by the user logged in from
+@value{tramp} and not @samp{root}.
-When
-@ifset emacs
-@code{backup-directory-alist}
-@end ifset
-@ifset xemacs
-@code{bkup-backup-directory-info}
-@end ifset
-is @code{nil} (the default), such problems do not occur.
+When @option{backup-directory-alist} is @code{nil} (the default), such
+problems do not occur.
To ``turn off'' the backup feature for @value{tramp} files and stop
@value{tramp} from saving to the backup directory, use this:
-@ifset emacs
@lisp
+@group
(add-to-list 'backup-directory-alist
(cons tramp-file-name-regexp nil))
+@end group
@end lisp
-@end ifset
-@ifset xemacs
-@lisp
-(require 'backup-dir)
-(add-to-list 'bkup-backup-directory-info
- (list tramp-file-name-regexp ""))
-@end lisp
-@end ifset
-@ifset emacs
@noindent
Disabling backups can be targeted to just the @option{su} and
@option{sudo} methods:
@lisp
+@group
(setq backup-enable-predicate
(lambda (name)
(and (normal-backup-enable-predicate name)
@@ -2066,27 +2011,15 @@ Disabling backups can be targeted to just the @option{su} and
(let ((method (file-remote-p name 'method)))
(when (stringp method)
(member method '("su" "sudo"))))))))
+@end group
@end lisp
-@end ifset
Another option is to create better backup file naming with user and
host names prefixed to the file name. For example, transforming
@file{/etc/secretfile} to
@file{~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile}, set the
-@value{tramp} variable
-@ifset emacs
-@code{tramp-backup-directory-alist}
-@end ifset
-@ifset xemacs
-@code{tramp-bkup-backup-directory-info}
-@end ifset
-from the existing variable
-@ifset emacs
-@code{backup-directory-alist}.
-@end ifset
-@ifset xemacs
-@code{bkup-backup-directory-info}.
-@end ifset
+@value{tramp} user option @option{tramp-backup-directory-alist} from
+the existing user option @option{backup-directory-alist}.
Then @value{tramp} backs up to a file name that is transformed with a
prefix consisting of the DIRECTORY name. This file name prefixing
@@ -2095,51 +2028,38 @@ happens only when the DIRECTORY is an absolute local file name.
@noindent
Example:
-@ifset emacs
@lisp
+@group
(add-to-list 'backup-directory-alist
(cons "." "~/.emacs.d/backups/"))
-(setq tramp-backup-directory-alist backup-directory-alist)
-@end lisp
-@end ifset
-@ifset xemacs
-@lisp
-(require 'backup-dir)
-(add-to-list 'bkup-backup-directory-info
- (list "." "~/.emacs.d/backups/" 'full-path))
-(setq tramp-bkup-backup-directory-info bkup-backup-directory-info)
+(custom-set-variables
+ '(tramp-backup-directory-alist backup-directory-alist 6 nil (tramp)))
+@end group
@end lisp
-@end ifset
@noindent
The backup file name of
@file{@trampfn{su,root@@localhost,/etc/secretfile}} would be
-@ifset emacs
+@ifset unified
@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
@end ifset
-@ifset xemacs
+@ifset separate
@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
@end ifset
Just as for backup files, similar issues of file naming affect
-auto-saving @value{tramp} files.
-@ifset emacs
-Auto-saved files are saved in the directory specified by the variable
-@code{auto-save-file-name-transforms}. By default this is set to the
-local temporary directory. But in some versions of Debian GNU/Linux,
-this points to the source directory where the @value{emacsname} was
-compiled. Reset such values to a valid directory.
-
-Set @code{auto-save-file-name-transforms} to @code{nil} to save
+auto-saving @value{tramp} files. Auto-saved files are saved in the
+directory specified by the user option
+@option{auto-save-file-name-transforms}. By default this is set to
+the local temporary directory. But in some versions of Debian
+GNU/Linux, this points to the source directory where the Emacs was
+compiled. Reset such values to a valid directory.
+
+Set @option{auto-save-file-name-transforms} to @code{nil} to save
auto-saved files to the same directory as the original file.
-Alternatively, set the variable @code{tramp-auto-save-directory} to
-direct all auto saves to that location.
-@end ifset
-@ifset xemacs
-@code{auto-save-directory} can also be used here instead of other
-locations specified above.
-@end ifset
+Alternatively, set the user option @option{tramp-auto-save-directory}
+to direct all auto saves to that location.
@node Windows setup hints
@section Issues with Cygwin ssh
@@ -2150,9 +2070,9 @@ This section is incomplete. Please share your solutions.
@cindex method sshx with Cygwin
@cindex sshx method with Cygwin
-Cygwin's @command{ssh} works only with a Cygwin version of
-@value{emacsname}. To check for compatibility: type @kbd{M-x eshell}, and
-start @kbd{ssh test.host}. Incompatibilities trigger this message:
+Cygwin's @command{ssh} works only with a Cygwin version of Emacs. To
+check for compatibility: type @kbd{M-x eshell}, and start @kbd{ssh
+test.host}. Incompatibilities trigger this message:
@example
Pseudo-terminal will not be allocated because stdin is not a terminal.
@@ -2162,11 +2082,17 @@ Some older versions of Cygwin's @command{ssh} work with the
@option{sshx} access method. Consult Cygwin's FAQ at
@uref{http://cygwin.com/faq/} for details.
+@cindex Cygwin and fakecygpty
+@cindex fakecygpty and Cygwin
+
+On @uref{https://www.emacswiki.org/emacs/SshWithNTEmacs, the Emacs
+Wiki} it is explained how to use the helper program @code{fakecygpty}
+to fix this problem.
@cindex method scpx with Cygwin
@cindex scpx method with Cygwin
-When using the @option{scpx} access method, @value{emacsname} may call
+When using the @option{scpx} access method, Emacs may call
@command{scp} with Windows file naming, such as @code{c:/foo}. But
the version of @command{scp} that is installed with Cygwin does not
know about Windows file naming, which causes it to incorrectly look
@@ -2176,18 +2102,17 @@ A workaround: write a wrapper script for @option{scp} to convert
Windows file names to Cygwin file names.
@cindex Cygwin and ssh-agent
-@cindex SSH_AUTH_SOCK and @value{emacsname} on Windows
+@cindex SSH_AUTH_SOCK and Emacs on Windows
When using the @command{ssh-agent} on Windows for password-less
interaction, @option{ssh} methods depend on the environment variable
-@env{SSH_AUTH_SOCK}. But this variable is not set when
-@value{emacsname} is started from a Desktop shortcut and
-authentication fails.
+@env{SSH_AUTH_SOCK}. But this variable is not set when Emacs is
+started from a Desktop shortcut and authentication fails.
One workaround is to use a Windows based SSH Agent, such as
Pageant. It is part of the Putty Suite of tools.
-The fallback is to start @value{emacsname} from a shell.
+The fallback is to start Emacs from a shell.
@node Usage
@@ -2198,27 +2123,24 @@ The fallback is to start @value{emacsname} from a shell.
they are local. However, @value{tramp} employs a formalized remote
file naming syntax to perform its functions transparently. This
syntax consists of many parts specifying access methods,
-authentication, host names, and file names.
-@ifset emacs
-@value{ftppackagename} uses a similar syntax.
-@end ifset
+authentication, host names, and file names. Ange FTP uses a similar
+syntax.
@cindex type-ahead
-Unlike opening local files in @value{emacsname}, which are
-instantaneous, opening remote files in @value{tramp} is slower at
-first. Sometimes there is a noticeable delay before the prompts for
-passwords or authentication appear in the minibuffer. Hitting
-@kbd{@key{RET}} or other keys during this gap will be processed by
-@value{emacsname}. This type-ahead facility is a feature of
-@value{emacsname} that may cause missed prompts when using
+Unlike opening local files in Emacs, which are instantaneous, opening
+remote files in @value{tramp} is slower at first. Sometimes there is
+a noticeable delay before the prompts for passwords or authentication
+appear in the minibuffer. Hitting @kbd{@key{RET}} or other keys
+during this gap will be processed by Emacs. This type-ahead facility
+is a feature of Emacs that may cause missed prompts when using
@value{tramp}.
@menu
* File name Syntax:: @value{tramp} file name conventions.
* File name completion:: File name completion.
* Ad-hoc multi-hops:: Declaring multiple hops in the file name.
-* Remote processes:: Integration with other @value{emacsname} packages.
+* Remote processes:: Integration with other Emacs packages.
* Cleanup remote connections:: Cleanup remote connections.
@end menu
@@ -2228,9 +2150,9 @@ passwords or authentication appear in the minibuffer. Hitting
@cindex file name syntax
@cindex file name examples
-@file{@trampf{host,localfilename}}
-opens file @var{localfilename} on the remote host @var{host}, using
-the default method. @xref{Default Method}.
+@file{@trampf{host,localfilename}} opens file @var{localfilename} on
+the remote host @var{host}, using the default method. @xref{Default
+Method}.
@table @file
@item @value{prefix}melancholia@value{postfix}.emacs
@@ -2257,7 +2179,7 @@ For the file @file{/etc/squid.conf} on the host @code{melancholia}.
@var{host} can take IPv4 or IPv6 address, as in
@file{@trampf{127.0.0.1,.emacs}} or
@file{@trampf{@value{ipv6prefix}::1@value{ipv6postfix},.emacs}}.
-@ifset emacs
+@ifset unified
For syntactical reasons, IPv6 addresses must be embedded in square
brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}.
@end ifset
@@ -2270,24 +2192,16 @@ name using the proper syntax will override this default behavior:
@trampf{user@@host,path/to.file}
@end example
-@file{@trampf{daniel@@melancholia,.emacs}} is for file
-@file{.emacs} in @code{daniel}'s home directory on the host,
-@code{melancholia}.
+@file{@trampf{daniel@@melancholia,.emacs}} is for file @file{.emacs}
+in @code{daniel}'s home directory on the host, @code{melancholia}.
Specify other file access methods (@pxref{Inline methods},
@pxref{External methods}) as part of the file name.
-@ifset emacs
Method name comes before user name, as in
@file{@value{prefix}@var{method}@value{postfixhop}} (Note the trailing
-colon).
-@end ifset
-@ifset xemacs
-This is done by replacing the initial @file{@value{prefix}} with
-@file{@value{prefix}@var{method}@value{postfixhop}} (Note the trailing
-slash!).
-@end ifset
-The syntax specifications for user, host, and file do not change.
+colon). The syntax specifications for user, host, and file do not
+change.
To connect to the host @code{melancholia} as @code{daniel}, using
@option{ssh} method for @file{.emacs} in @code{daniel}'s home
@@ -2307,44 +2221,38 @@ name. For example: @file{@trampfn{ssh,daniel@@melancholia#42,.emacs}}.
@value{tramp} can complete the following @value{tramp} file name
components: method names, user names, host names, and file names
-located on remote hosts.
-@ifset emacs
-Enable this by activating partial completion in @file{.emacs}.
+located on remote hosts. Enable this by activating partial completion
+in @file{.emacs}.
@ifinfo
-@xref{Completion Options, , , @value{emacsdir}}.
+@xref{Completion Options, , , emacs}.
@end ifinfo
-@end ifset
For example, type @kbd{C-x C-f @value{prefix}t @key{TAB}},
@value{tramp} completion choices show up as
@example
+@group
@c @multitable {@trampfn{telnet,melancholia.danann.net,}} {@trampfn{telnet,192.168.0.1,}}
@multitable @columnfractions .5 .5
-@ifset emacs
@item @value{prefixhop}telnet@value{postfixhop} @tab tmp/
@item @value{prefixhop}toto@value{postfix} @tab
-@end ifset
-@ifset xemacs
-@item @value{prefixhop}telnet@value{postfixhop} @tab @value{prefixhop}toto@value{postfix}
-@end ifset
@end multitable
+@end group
@end example
-@samp{@value{prefixhop}telnet@value{postfixhop}}
-is a possible completion for the respective method,
-@ifset emacs
-@samp{tmp/} stands for the directory @file{/tmp} on your local host,
-@end ifset
-and @samp{@value{prefixhop}toto@value{postfix}}
-might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts}
-file (when using @option{ssh} as default method).
+@samp{@value{prefixhop}telnet@value{postfixhop}} is a possible
+completion for the respective method, @samp{tmp/} stands for the
+directory @file{/tmp} on your local host, and
+@samp{@value{prefixhop}toto@value{postfix}} might be a host
+@value{tramp} has detected in your @file{~/.ssh/known_hosts} file
+(when using @option{ssh} as default method).
Type @kbd{e @key{TAB}} for the minibuffer completion to
@samp{@value{prefix}telnet@value{postfixhop}}. Typing @kbd{@key{TAB}}
shows host names @value{tramp} from @file{/etc/hosts} file, for example.
@example
+@group
@multitable @columnfractions .5 .5
@c @multitable {@trampfn{telnet,melancholia.danann.net,}} {@trampfn{telnet,192.168.0.1,}}
@item @trampfn{telnet,127.0.0.1,} @tab @trampfn{telnet,192.168.0.1,}
@@ -2352,6 +2260,7 @@ shows host names @value{tramp} from @file{/etc/hosts} file, for example.
@item @value{prefix}telnet@value{postfixhop}@value{ipv6prefix}::1@value{ipv6postfix}@value{postfix} @tab @trampfn{telnet,localhost,}
@item @trampfn{telnet,melancholia.danann.net,} @tab @trampfn{telnet,melancholia,}
@end multitable
+@end group
@end example
Choose a host from the above list and then continue to complete file
@@ -2365,21 +2274,19 @@ persistently (@pxref{Connection caching}) will be included in the
completion lists.
After remote host name completion comes completion of file names on
-the remote host. It works the same as with local host file completion,
+the remote host. It works the same as with local host file completion
except that killing with double-slash @file{//} kills only the file
-name part of the @value{tramp} file name syntax.
-@ifset emacs
-A triple-slash stands for the default behavior.
-@end ifset
+name part of the @value{tramp} file name syntax. A triple-slash
+stands for the default behavior.
@ifinfo
-@xref{Minibuffer File, , , @value{emacsdir}}.
+@xref{Minibuffer File, , , emacs}.
@end ifinfo
@noindent
Example:
@example
-@ifset emacs
+@group
@kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin//etc} @key{TAB}}
@print{} @trampfn{telnet,melancholia,/etc}
@@ -2388,28 +2295,20 @@ Example:
@kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin///etc} @key{TAB}}
@print{} /etc
-@end ifset
-
-@ifset xemacs
-@kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin//}}
- @print{} @trampfn{telnet,melancholia,/}
-
-@kbd{C-x C-f @trampfn{telnet,melancholia,//}}
- @print{} /
-@end ifset
+@end group
@end example
During file name completion, remote directory contents are re-read
regularly to account for any changes in the filesystem that may affect
the completion candidates. Such re-reads can account for changes to
-the file system by applications outside @value{emacsname}
-(@pxref{Connection caching}).
+the file system by applications outside Emacs (@pxref{Connection
+caching}).
@defopt tramp-completion-reread-directory-timeout
-@vindex tramp-completion-reread-directory-timeout
The timeout is number of seconds since last remote command for
-rereading remote directory contents. 0 re-reads immediately during
-file name completion, @code{nil} uses cached directory contents.
+rereading remote directory contents. A value of 0 re-reads
+immediately during file name completion, @code{nil} uses cached
+directory contents.
@end defopt
@@ -2419,7 +2318,7 @@ file name completion, @code{nil} uses cached directory contents.
@cindex proxy hosts, ad-hoc
@value{tramp} file name syntax can accommodate ad hoc specification of
-multiple proxies without using @code{tramp-default-proxies-alist}
+multiple proxies without using @option{tramp-default-proxies-alist}
configuration setup(@pxref{Multi-hops}).
Each proxy is specified using the same syntax as the remote host
@@ -2436,32 +2335,30 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}:
Proxies can take patterns @code{%h} or @code{%u}.
@value{tramp} adds the ad-hoc definitions on the fly to
-@code{tramp-default-proxies-alist} and is available for re-use during
-that @value{emacsname} session. Subsequent @value{tramp} connections
-to the same remote host can then use the shortcut form:
+@option{tramp-default-proxies-alist} and is available for re-use
+during that Emacs session. Subsequent @value{tramp} connections to
+the same remote host can then use the shortcut form:
@samp{@trampfn{ssh,you@@remotehost,/path}}.
@defopt tramp-save-ad-hoc-proxies
-@vindex tramp-save-ad-hoc-proxies
For ad-hoc definitions to be saved automatically in
-@option{tramp-default-proxies-alist} for future @value{emacsname}
-sessions, set @option{tramp-save-ad-hoc-proxies}.
+@option{tramp-default-proxies-alist} for future Emacs sessions, set
+@option{tramp-save-ad-hoc-proxies} to non-@code{nil}.
@lisp
-(setq tramp-save-ad-hoc-proxies t)
+(custom-set-variables '(tramp-save-ad-hoc-proxies t nil (tramp)))
@end lisp
@end defopt
@node Remote processes
-@section Integration with other @value{emacsname} packages
+@section Integration with other Emacs packages
@cindex compile
@cindex recompile
@value{tramp} supports starting new running processes on the remote
-host for discovering remote file names. @value{emacsname} packages on
-the remote host need no specific modifications for @value{tramp}'s
-use.
+host for discovering remote file names. Emacs packages on the remote
+host need no specific modifications for @value{tramp}'s use.
This type of integration does not work with the @option{ftp} method,
and does not support the pty association as specified in
@@ -2471,17 +2368,16 @@ and does not support the pty association as specified in
host when the variable @code{default-directory} is remote:
@lisp
+@group
(let ((default-directory "/ssh:remote.host:"))
(start-file-process "grep" (get-buffer-create "*grep*")
"/bin/sh" "-c" "grep -e tramp *"))
+@end group
@end lisp
-
-@ifset emacsgvfs
Remote processes do not apply to GVFS (see @ref{GVFS based methods})
because the remote file system is mounted on the local host and
@value{tramp} just accesses by changing the @code{default-directory}.
-@end ifset
@value{tramp} starts a remote process when a command is executed in a
remote file or directory buffer. As of now, these packages have been
@@ -2492,22 +2388,24 @@ like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or
For @value{tramp} to find the command on the remote, it must be
accessible through the default search path as setup by @value{tramp}
upon first connection. Alternatively, use an absolute path or extend
-@code{tramp-remote-path} (see @ref{Remote programs}):
+@option{tramp-remote-path} (see @ref{Remote programs}):
@lisp
+@group
(add-to-list 'tramp-remote-path "~/bin")
(add-to-list 'tramp-remote-path "/appli/pub/bin")
+@end group
@end lisp
-Customize @code{tramp-remote-process-environment} to suit the remote
-program's environment for the remote host.
-@code{tramp-remote-process-environment} is a list of strings
+Customize user option @option{tramp-remote-process-environment} to
+suit the remote program's environment for the remote host.
+@option{tramp-remote-process-environment} is a list of strings
structured similar to @code{process-environment}, where each element
is a string of the form @samp{ENVVARNAME=VALUE}.
-To avoid any conflicts with local host variables set through local
-configuration files, such as @file{~/.profile}, use @samp{ENVVARNAME=}
-to unset them for the remote environment.
+To avoid any conflicts with local host environment variables set
+through local configuration files, such as @file{~/.profile}, use
+@samp{ENVVARNAME=} to unset them for the remote environment.
@noindent
Use @code{add-to-list} to add entries:
@@ -2517,17 +2415,31 @@ Use @code{add-to-list} to add entries:
@end lisp
Modifying or deleting already existing values in the
-@code{tramp-remote-process-environment} list may not be feasible on
+@option{tramp-remote-process-environment} list may not be feasible on
restricted remote hosts. For example, some system administrators
-disallow changing @env{HISTORY} variable. To accommodate such
-restrictions when using @value{tramp}, fix the
-@code{tramp-remote-process-environment} by the following code in the
+disallow changing @env{HISTORY} environment variable. To accommodate
+such restrictions when using @value{tramp}, fix the
+@option{tramp-remote-process-environment} by the following code in the
local @file{.emacs} file:
@lisp
+@group
(let ((process-environment tramp-remote-process-environment))
(setenv "HISTORY" nil)
(setq tramp-remote-process-environment process-environment))
+@end group
+@end lisp
+
+Setting the @env{ENV} environment variable instructs some shells to
+read an initialization file. Per default, @value{tramp} has disabled
+this. You could overwrite this behavior by evaluating
+
+@lisp
+@group
+(let ((process-environment tramp-remote-process-environment))
+ (setenv "ENV" "$HOME/.profile")
+ (setq tramp-remote-process-environment process-environment))
+@end group
@end lisp
@value{tramp} does not use the defaults specified in
@@ -2537,15 +2449,17 @@ local @file{.emacs} file:
them as follows:
@lisp
+@group
(let ((process-environment (cons "HGPLAIN=1" process-environment)))
(process-file @dots{}))
+@end group
@end lisp
This works only for environment variables not already set in the
@code{process-environment}.
-For integrating other @value{emacsname} packages so @value{tramp} can
-execute remotely, please file a bug report. @xref{Bug Reports}.
+For integrating other Emacs packages so @value{tramp} can execute
+remotely, please file a bug report. @xref{Bug Reports}.
@subsection Running remote programs that create local X11 windows
@@ -2555,8 +2469,10 @@ set the @env{DISPLAY} environment variable for the remote host as
follows in the local @file{.emacs} file:
@lisp
+@group
(add-to-list 'tramp-remote-process-environment
(format "DISPLAY=%s" (getenv "DISPLAY")))
+@end group
@end lisp
@noindent
@@ -2580,11 +2496,9 @@ when using @value{tramp} between two hosts with different operating
systems, such as @samp{windows-nt} and @samp{gnu/linux}. This option
ensures the correct name of the remote shell program.
-@ifset emacs
Starting with Emacs 24, when @option{explicit-shell-file-name} is
equal to @code{nil}, calling @code{shell} interactively will prompt
for a shell name.
-@end ifset
@subsection Running @code{shell-command} on a remote host
@@ -2595,16 +2509,16 @@ on remote hosts and displays output in buffers on the local
host. Example:
@example
+@group
@kbd{C-x C-f @trampfn{sudo,,} @key{RET}}
@kbd{M-! tail -f /var/log/syslog.log & @key{RET}}
+@end group
@end example
@command{tail} command outputs continuously to the local buffer,
@file{*Async Shell Command*}
-@ifset emacs
@kbd{M-x auto-revert-tail-mode} runs similarly showing continuous output.
-@end ifset
@subsection Running @code{eshell} on a remote host
@@ -2617,6 +2531,7 @@ You must add the module @code{eshell-tramp} to
@kbd{M-x eshell} on a remote host:
@example
+@group
@b{~ $} cd @trampfn{sudo,,/etc} @key{RET}
@b{@trampfn{sudo,root@@host,/etc} $} hostname @key{RET}
host
@@ -2625,28 +2540,31 @@ uid=0(root) gid=0(root) groups=0(root)
@b{@trampfn{sudo,root@@host,/etc} $} find-file shadow @key{RET}
#<buffer shadow>
@b{@trampfn{sudo,root@@host,/etc} $}
+@end group
@end example
-@ifset emacs
-@code{eshell} in @value{emacsname} 23.2 added custom @code{su} and
-@code{sudo} commands that set the default directory correctly for the
+@code{eshell} in Emacs 23.2 added custom @code{su} and @code{sudo}
+commands that set the default directory correctly for the
@file{*eshell*} buffer. @value{tramp} silently updates
-@code{tramp-default-proxies-alist} with an entry for this directory
+@option{tramp-default-proxies-alist} with an entry for this directory
(@pxref{Multi-hops}):
@example
+@group
@b{~ $} cd @trampfn{ssh,user@@remotehost,/etc} @key{RET}
@b{@trampfn{ssh,user@@remotehost,/etc} $} find-file shadow @key{RET}
File is not readable: @trampfn{ssh,user@@remotehost,/etc/shadow}
@b{@trampfn{ssh,user@@remotehost,/etc} $} sudo find-file shadow @key{RET}
#<buffer shadow>
+@end group
+@group
@b{@trampfn{ssh,user@@remotehost,/etc} $} su - @key{RET}
@b{@trampfn{su,root@@remotehost,/root} $} id @key{RET}
uid=0(root) gid=0(root) groups=0(root)
@b{@trampfn{su,root@@remotehost,/root} $}
+@end group
@end example
-@end ifset
@anchor{Running a debugger on a remote host}
@@ -2656,26 +2574,36 @@ uid=0(root) gid=0(root) groups=0(root)
@cindex perldb
@file{gud.el} provides a unified interface to symbolic debuggers
-@ifset emacs
@ifinfo
-(@ref{Debuggers, , , @value{emacsdir}}).
+(@ref{Debuggers, , , emacs}).
@end ifinfo
-@end ifset
@value{tramp} can run debug on remote hosts by calling @code{gdb}
with a remote file name:
@example
+@group
@kbd{M-x gdb @key{RET}}
-@b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh,host,~/myprog} @key{RET}
+@b{Run gdb (like this):} gdb -i=mi @trampfn{ssh,host,~/myprog} @key{RET}
+@end group
+@end example
+
+Since the remote @code{gdb} and @code{gdb-inferior} processes do not
+belong to the same process group on the remote host, there will be a
+warning, which can be ignored:
+
+@example
+&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n"
@end example
Relative file names are based on the remote default directory. When
-@file{myprog.pl} exists in @file{@trampfn{ssh,host,/home/user}},
-valid calls include:
+@file{myprog.pl} exists in @file{@trampfn{ssh,host,/home/user}}, valid
+calls include:
@example
+@group
@kbd{M-x perldb @key{RET}}
@b{Run perldb (like this):} perl -d myprog.pl @key{RET}
+@end group
@end example
Just the local part of a remote file name, such as @kbd{perl -d
@@ -2702,16 +2630,20 @@ be set properly so @kbd{M-x shell} can open a proper remote shell on a
Windows host. To open @command{cmd}, set it as follows:
@lisp
+@group
(setq explicit-shell-file-name "cmd"
explicit-cmd-args '("/q"))
+@end group
@end lisp
@noindent
To open @command{powershell} as a remote shell, use this:
@lisp
+@group
(setq explicit-shell-file-name "powershell"
explicit-powershell-args '("-file" "-"))
+@end group
@end lisp
@@ -2727,9 +2659,8 @@ the internal representation of a remote connection. When called
interactively, this command lists active remote connections in the
minibuffer. Each connection is of the format
@file{@trampfn{method,user@@host,}}. Flushing remote connections also
-cleans the password
-cache (@pxref{Password handling}), file cache, connection cache
-(@pxref{Connection caching}), and connection buffers.
+cleans the password cache (@pxref{Password handling}), file cache,
+connection cache (@pxref{Connection caching}), and connection buffers.
@end deffn
@deffn Command tramp-cleanup-this-connection
@@ -2772,11 +2703,9 @@ To subscribe to the mailing list, visit:
@uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, the
@value{tramp} Mail Subscription Page}.
-@ifset emacs
@ifset installchapter
Before sending a bug report, run the test suite first @ref{Testing}.
@end ifset
-@end ifset
@findex tramp-bug
Check if the bug or problem is already addressed in @xref{Frequently
@@ -2835,8 +2764,7 @@ Where is the latest @value{tramp}?
@item
Which systems does it work on?
-The package works successfully on Emacs 22, Emacs 23, Emacs 24, Emacs
-25, XEmacs 21 (starting with 21.4), and SXEmacs 22.
+The package works successfully on Emacs 23, Emacs 24, and Emacs 25.
While Unix and Unix-like systems are the primary remote targets,
@value{tramp} has equal success connecting to other platforms, such as
@@ -2855,7 +2783,7 @@ responsiveness slows down. Some suggestions within the scope of
Use an external method, such as @option{scp}, which are faster than
internal methods.
-Keep the file @code{tramp-persistency-file-name}, which is where
+Keep the file @option{tramp-persistency-file-name}, which is where
@value{tramp} caches remote information about hosts and files. Caching
is enabled by default. Don't disable it.
@@ -2864,16 +2792,18 @@ files are not independently updated outside @value{tramp}'s control.
That cache cleanup will be necessary if the remote directories or
files are updated independent of @value{tramp}.
-Set @code{tramp-completion-reread-directory-timeout} to @code{nil} to
+Set @option{tramp-completion-reread-directory-timeout} to @code{nil} to
speed up completions, @ref{File name completion}.
Disable version control to avoid delays:
@lisp
+@group
(setq vc-ignore-dir-regexp
(format "\\(%s\\)\\|\\(%s\\)"
vc-ignore-dir-regexp
tramp-file-name-regexp))
+@end group
@end lisp
Disable excessive traces. Set @code{tramp-verbose} to 3 or lower,
@@ -2918,6 +2848,7 @@ When using fish shell on remote hosts, disable fancy formatting by
adding the following to @file{~/.config/fish/config.fish}:
@example
+@group
function fish_prompt
if test $TERM = "dumb"
echo "\$ "
@@ -2925,10 +2856,24 @@ function fish_prompt
@dots{}
end
end
+@end group
@end example
-When using WinSSHD on remote hosts, @value{tramp} do not recognize the
-strange prompt settings.
+When using WinSSHD on remote hosts, @value{tramp} does not recognize
+the strange prompt settings.
+
+A similar problem exist with the iTerm2 shell integration, which sends
+proprietary escape codes when starting a shell. This can be
+suppressed by changing the respective integration snippet in your
+@file{~/.profile} like this:
+
+@example
+@group
+[ $TERM = "dumb" ] || \
+test -e "$@{HOME@}/.iterm2_shell_integration.bash" && \
+source "$@{HOME@}/.iterm2_shell_integration.bash"
+@end group
+@end example
@item
Echoed characters after login
@@ -2956,11 +2901,13 @@ first saving to a temporary file.
@end ifinfo
@lisp
+@group
(add-hook
'find-file-hook
(lambda ()
(when (file-remote-p default-directory)
(set (make-local-variable 'file-precious-flag) t))))
+@end group
@end lisp
@end itemize
@@ -2974,8 +2921,10 @@ configuration for @command{ssh} can be configured to kill such hangs
with the following command in the @file{~/.ssh/config}:
@example
+@group
Host *
ServerAliveInterval 5
+@end group
@end example
@@ -2984,30 +2933,37 @@ Host *
@value{tramp} overwrites @code{ControlPath} settings when initiating
@command{ssh} sessions. @value{tramp} does this to fend off a stall
-if a master session opened outside the @value{emacsname} session is no
-longer open. That is why @value{tramp} prompts for the password again
-even if there is an @command{ssh} already open.
+if a master session opened outside the Emacs session is no longer
+open. That is why @value{tramp} prompts for the password again even
+if there is an @command{ssh} already open.
+@vindex tramp-ssh-controlmaster-options
Some @command{ssh} versions support a @code{ControlPersist} option,
which allows you to set the @code{ControlPath} provided the variable
@code{tramp-ssh-controlmaster-options} is customized as follows:
@lisp
+@group
(setq tramp-ssh-controlmaster-options
(concat
"-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
"-o ControlMaster=auto -o ControlPersist=yes"))
+@end group
@end lisp
Note how "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and
"%%p".
+@vindex tramp-use-ssh-controlmaster-options
If the @file{~/.ssh/config} is configured appropriately for the above
behavior, then any changes to @command{ssh} can be suppressed with
this @code{nil} setting:
@lisp
-(setq tramp-use-ssh-controlmaster-options nil)
+@group
+(custom-set-variables
+ '(tramp-use-ssh-controlmaster-options nil nil (tramp)))
+@end group
@end lisp
@@ -3021,9 +2977,9 @@ To test if this is the case, open a remote shell and check if the output
of @command{ls} is in color.
To disable @acronym{ANSI} escape sequences from the remote hosts,
-disable @option{--color=yes} or @option{--color=auto} in the remote
-host's @file{.bashrc} or @file{.profile}. Turn this alias on and off
-to see if file name completion works.
+disable @samp{--color=yes} or @samp{--color=auto} in the remote host's
+@file{.bashrc} or @file{.profile}. Turn this alias on and off to see
+if file name completion works.
@item
File name completion does not work in directories with large number of
@@ -3036,7 +2992,7 @@ shell's limit on length of command lines and hang. @value{tramp} uses
globbing.
To test if globbing hangs, open a shell on the remote host and then
-run @samp{ls -d * ..?* > /dev/null}.
+run @command{ls -d * ..?* > /dev/null}.
When testing, ensure the remote shell is the same shell
(@command{/bin/sh}, @command{ksh} or @command{bash}), that
@@ -3046,117 +3002,62 @@ When testing, ensure the remote shell is the same shell
@item
How to get notified after @value{tramp} completes file transfers?
-Make @value{emacsname} beep after reading from or writing to the
-remote host with the following code in @file{~/.emacs} file.
+Make Emacs beep after reading from or writing to the remote host with
+the following code in @file{~/.emacs} file.
@lisp
+@group
(defadvice tramp-handle-write-region
(after tramp-write-beep-advice activate)
"Make tramp beep after writing a file."
(interactive)
(beep))
+@end group
+@group
(defadvice tramp-handle-do-copy-or-rename-file
(after tramp-copy-beep-advice activate)
"Make tramp beep after copying a file."
(interactive)
(beep))
+@end group
+@group
(defadvice tramp-handle-insert-file-contents
(after tramp-insert-beep-advice activate)
"Make tramp beep after inserting a file."
(interactive)
(beep))
+@end group
@end lisp
-@ifset emacs
-@item
-How to get a Visual Warning when working with @samp{root} privileges
-
-Get a modeline indication when working with @samp{root} privileges
-with the following code (tested with @value{emacsname} 22.1) in
-@file{~/.emacs} file:
-
-@lisp
-(defun my-mode-line-function ()
- (when (string-match "^/su\\(do\\)?:" default-directory)
- (setq mode-line-format
- (format-mode-line mode-line-format 'font-lock-warning-face))))
-
-(add-hook 'find-file-hook 'my-mode-line-function)
-(add-hook 'dired-mode-hook 'my-mode-line-function)
-@end lisp
-@end ifset
-
-
-@ifset emacs
@item
-How to get host indication in the mode line?
-
-The following code (tested with @value{emacsname} 22.1) in
-@file{~/.emacs} file shows it:
-
-@lisp
-(defconst my-mode-line-buffer-identification
- (list
- '(:eval
- (let ((host-name
- (if (file-remote-p default-directory)
- (tramp-file-name-host
- (tramp-dissect-file-name default-directory))
- (system-name))))
- (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
- (substring host-name 0 (match-beginning 1))
- host-name)))
- ": %12b"))
-
-(setq-default
- mode-line-buffer-identification
- my-mode-line-buffer-identification)
-
-(add-hook
- 'dired-mode-hook
- (lambda ()
- (setq
- mode-line-buffer-identification
- my-mode-line-buffer-identification)))
-@end lisp
-
-The mode line in @value{emacsname} 23.1 and later versions now
-contains an indication if @code{default-directory} for the current
-buffer is on a remote host. Moreover, the corresponding tool-tip
-shows the remote host name. The above @code{:eval} clause can also be
-simplified to show the host name in the mode line:
+How to get a Visual Warning when working with @samp{root} privileges?
+Host indication in the mode line?
-@lisp
- '(:eval
- (let ((host-name
- (or (file-remote-p default-directory 'host)
- (system-name))))
- (if (string-match "^[^0-9][^.]*\\(\\..*\\)" host-name)
- (substring host-name 0 (match-beginning 1))
- host-name)))
-@end lisp
-@end ifset
+Install @file{tramp-theme} from GNU ELPA via Emacs' Package Manager.
+Enable it via @kbd{M-x load-theme @key{RET} tramp}. Further
+customization is explained in user option
+@option{tramp-theme-face-remapping-alist}.
-@ifset emacs
@item
Remote host does not understand default options for directory listing
-@value{emacsname} computes the @command{dired} options based on the
-local host but if the remote host cannot understand the same
-@command{ls} command, then set them with a hook as follows:
+Emacs computes the @command{dired} options based on the local host but
+if the remote host cannot understand the same @command{ls} command,
+then set them with a hook as follows:
@lisp
+@group
(add-hook
'dired-before-readin-hook
(lambda ()
(when (file-remote-p default-directory)
(setq dired-actual-switches "-al"))))
+@end group
@end lisp
-@end ifset
@item
@@ -3168,6 +3069,7 @@ turn off saving history by putting this shell code in the
@file{.kshrc} file:
@example
+@group
if [ -f $HOME/.sh_history ] ; then
/bin/rm $HOME/.sh_history
fi
@@ -3177,6 +3079,7 @@ fi
if [ "$@{HISTSIZE-unset@}" != "unset" ] ; then
unset HISTSIZE
fi
+@end group
@end example
For @option{ssh}-based method, add the following line to your
@@ -3202,8 +3105,11 @@ You can define default methods and user names for hosts,
(@pxref{Default Method}, @pxref{Default User}):
@lisp
-(setq tramp-default-method "ssh"
- tramp-default-user "news")
+@group
+(custom-set-variables
+ '(tramp-default-method "ssh" nil (tramp))
+ '(tramp-default-user "news" nil (tramp)))
+@end group
@end lisp
The reduced typing: @kbd{C-x C-f @trampf{news.my.domain,/opt/news/etc}}.
@@ -3220,9 +3126,11 @@ Programs used for access methods already offer powerful configurations
file @file{~/.ssh/config}:
@example
+@group
Host xy
HostName news.my.domain
User news
+@end group
@end example
The reduced typing: @kbd{C-x C-f @trampfn{ssh,xy,/opt/news/etc}}.
@@ -3235,8 +3143,8 @@ completion can further reduce key strokes: @kbd{C-x C-f
Use environment variables to expand long strings
For long file names, set up environment variables that are expanded in
-the minibuffer. Environment variables are set either outside
-@value{emacsname} or inside @value{emacsname} with Lisp:
+the minibuffer. Environment variables are set either outside Emacs or
+inside Emacs with Lisp:
@lisp
(setenv "xy" "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")
@@ -3250,9 +3158,10 @@ minibuffer.
@item Define own keys:
-Redefine another key sequence in @value{emacsname} for @kbd{C-x C-f}:
+Redefine another key sequence in Emacs for @kbd{C-x C-f}:
@lisp
+@group
(global-set-key
[(control x) (control y)]
(lambda ()
@@ -3261,13 +3170,14 @@ Redefine another key sequence in @value{emacsname} for @kbd{C-x C-f}:
(read-file-name
"Find Tramp file: "
"@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))))
+@end group
@end lisp
Simply typing @kbd{C-x C-y} would prepare minibuffer editing of file
name.
-See @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the Emacs
-Wiki} for a more comprehensive example.
+See @uref{https://www.emacswiki.org/emacs/TrampMode, the Emacs Wiki}
+for a more comprehensive example.
@item
Define own abbreviation (1):
@@ -3275,9 +3185,11 @@ Define own abbreviation (1):
Abbreviation list expansion can be used to reduce typing long file names:
@lisp
+@group
(add-to-list
'directory-abbrev-alist
'("^/xy" . "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
+@end group
@end lisp
The reduced typing: @kbd{C-x C-f /xy @key{RET}}.
@@ -3293,23 +3205,31 @@ The @code{abbrev-mode} gives additional flexibility for editing in the
minibuffer:
@lisp
+@group
(define-abbrev-table 'my-tramp-abbrev-table
'(("xy" "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")))
+@end group
+@group
(add-hook
'minibuffer-setup-hook
(lambda ()
(abbrev-mode 1)
(setq local-abbrev-table my-tramp-abbrev-table)))
+@end group
+@group
(defadvice minibuffer-complete
(before my-minibuffer-complete activate)
(expand-abbrev))
+@end group
+@group
;; If you use partial-completion-mode
(defadvice PC-do-completion
(before my-PC-do-completion activate)
(expand-abbrev))
+@end group
@end lisp
The reduced typing: @kbd{C-x C-f xy @key{TAB}}.
@@ -3320,157 +3240,118 @@ The minibuffer expands for further editing.
Use bookmarks to save Tramp file names.
@ifinfo
-@pxref{Bookmarks, , , @value{emacsdir}}.
+@pxref{Bookmarks, , , emacs}.
@end ifinfo
Upon visiting a location with @value{tramp}, save it as a bookmark with
-@ifset emacs
@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}.
-@end ifset
-@ifset xemacs
-@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}.
-@end ifset
To revisit that bookmark:
-@ifset emacs
@kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}.
-@end ifset
-@ifset xemacs
-@kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{jump}}.
-@end ifset
@item Use recent files:
-@ifset emacs
-@file{recentf}
-@end ifset
-@ifset xemacs
-@file{recent-files}
-@end ifset
-remembers visited places.
+@file{recentf} remembers visited places.
@ifinfo
-@ifset emacs
-@pxref{File Conveniences, , , @value{emacsdir}}.
-@end ifset
-@ifset xemacs
-@pxref{recent-files, , , edit-utils}.
-@end ifset
+@pxref{File Conveniences, , , emacs}.
@end ifinfo
Keep remote file names in the recent list without have to check for
their accessibility through remote access:
@lisp
-@ifset emacs
(recentf-mode 1)
-@end ifset
-@ifset xemacs
-(recent-files-initialize)
-(add-hook
- 'find-file-hook
- (lambda ()
- (when (file-remote-p (buffer-file-name))
- (recent-files-make-permanent)))
- 'append)
-@end ifset
@end lisp
-Reaching recently opened files:
-@ifset emacs
-@kbd{@key{menu-bar} @key{file} @key{Open Recent}}.
-@end ifset
-@ifset xemacs
-@kbd{@key{menu-bar} @key{Recent Files}}.
-@end ifset
+Reaching recently opened files: @kbd{@key{menu-bar} @key{file}
+@key{Open Recent}}.
-@ifset emacs
@item Use filecache:
Since @file{filecache} remembers visited places, add the remote
directory to the cache:
@lisp
+@group
@c `with-eval-after-load' has been introduced with Emacs 24.4. Shall
@c be used when appropriate.
(eval-after-load "filecache"
'(file-cache-add-directory
"@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}"))
+@end group
@end lisp
Then use directory completion in the minibuffer with @kbd{C-x C-f
C-@key{TAB}}.
-@end ifset
-@ifset emacs
@item Use bbdb:
-@file{bbdb} has a built-in feature for @value{ftppackagename} files,
-which also works for @value{tramp} file names.
+@file{bbdb} has a built-in feature for Ange FTP files, which also
+works for @value{tramp} file names.
@ifinfo
@pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb}.
@end ifinfo
-Load @file{bbdb} in @value{emacs}:
+Load @file{bbdb} in Emacs:
@lisp
+@group
(require 'bbdb)
(bbdb-initialize)
+@end group
@end lisp
Create a BBDB entry with @kbd{M-x bbdb-create-ftp-site}. Then specify
a method and user name where needed. Examples:
@example
+@group
@kbd{M-x bbdb-create-ftp-site @key{RET}}
@b{Ftp Site:} news.my.domain @key{RET}
@b{Ftp Directory:} /opt/news/etc/ @key{RET}
@b{Ftp Username:} ssh@value{postfixhop}news @key{RET}
@b{Company:} @key{RET}
@b{Additional Comments:} @key{RET}
+@end group
@end example
In BBDB buffer, access an entry by pressing the key @key{F}.
-@end ifset
@end enumerate
Thanks to @value{tramp} users for contributing to these recipes.
@item
-Why saved multi-hop file names do not work in a new @value{emacsname}
-session?
+Why saved multi-hop file names do not work in a new Emacs session?
When saving ad-hoc multi-hop @value{tramp} file names (@pxref{Ad-hoc
-multi-hops}) via bookmarks, recent files,
-@ifset emacs
-filecache, bbdb,
-@end ifset
-or another package, use the full ad-hoc file name including all hops,
-like
+multi-hops}) via bookmarks, recent files, filecache, bbdb, or another
+package, use the full ad-hoc file name including all hops, like
@file{@trampfn{ssh,bird@@bastion|ssh@value{postfixhop}news.my.domain,/opt/news/etc}}.
Alternatively, when saving abbreviated multi-hop file names
-@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, the custom
-option @code{tramp-save-ad-hoc-proxies} must be set non-@code{nil}
+@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, the user
+option @option{tramp-save-ad-hoc-proxies} must be set non-@code{nil}
value.
-@ifset emacs
@item
-How to connect to a remote @value{emacsname} session using @value{tramp}?
+How to connect to a remote Emacs session using @value{tramp}?
Configure Emacs Client
@ifinfo
-(@pxref{Emacs Server, , , @value{emacsdir}}).
+(@pxref{Emacs Server, , , emacs}).
@end ifinfo
Then on the remote host, start the Emacs Server:
@lisp
+@group
(require 'server)
(setq server-host (system-name)
server-use-tcp t)
(server-start)
+@end group
@end lisp
If @code{(system-name)} of the remote host cannot be resolved on the
@@ -3492,8 +3373,10 @@ To make Emacs Client an editor for other programs, use a wrapper
script @file{emacsclient.sh}:
@example
+@group
#!/bin/sh
emacsclient @trampfn{ssh,$(whoami)@@$(hostname --fqdn),$1}
+@end group
@end example
Then change the environment variable @env{EDITOR} to point to the
@@ -3502,7 +3385,6 @@ wrapper script:
@example
export EDITOR=/path/to/emacsclient.sh
@end example
-@end ifset
@item
@@ -3520,8 +3402,7 @@ disable such features.
Disable @value{tramp} file name completion:
@lisp
-(custom-set-variables
- '(ido-enable-tramp-completion nil))
+(custom-set-variables '(ido-enable-tramp-completion nil))
@end lisp
@item
@@ -3539,35 +3420,25 @@ Disable remote directory tracking mode:
How to disable @value{tramp}?
@itemize @minus
-@ifset emacs
@item
-To keep @value{ftppackagename} as default the remote files access
-package, set this in @file{.emacs}:
+To keep Ange FTP as default the remote files access package, set this
+in @file{.emacs}:
@lisp
-(setq tramp-default-method "ftp")
+(custom-set-variables '(tramp-default-method "ftp" nil (tramp)))
@end lisp
-@end ifset
@item
-To disable both
-@ifset emacs
-@value{tramp} (and @value{ftppackagename}),
-@end ifset
-@ifset xemacs
-@value{tramp},
-@end ifset
-set @code{tramp-mode} to @code{nil} in @file{.emacs}.
+To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to
+@code{nil} in @file{.emacs}.
@lisp
-(setq tramp-mode nil)
+(custom-set-variables '(tramp-mode nil nil (tramp)))
@end lisp
@item
-To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp}.
-@ifset emacs
-Unloading @value{tramp} resets @value{ftppackagename} plugins also.
-@end ifset
+To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp}. Unloading
+@value{tramp} resets Ange FTP plugins also.
@end itemize
@end itemize
@@ -3578,9 +3449,7 @@ Unloading @value{tramp} resets @value{ftppackagename} plugins also.
@menu
* Localname deconstruction:: Splitting a localname into its component parts.
-@ifset emacs
* External packages:: Integrating with external Lisp packages.
-@end ifset
@end menu
@@ -3598,7 +3467,6 @@ file name. By relying on the original handlers for localnames,
handlers.
-@ifset emacs
@node External packages
@section Integrating with external Lisp packages
@subsection File name completion.
@@ -3617,8 +3485,10 @@ the variable @code{non-essential} temporarily and bind it to
non-@code{nil} value.
@lisp
+@group
(let ((non-essential t))
@dots{})
+@end group
@end lisp
@@ -3636,8 +3506,10 @@ situations where callers to @code{process-file} know there are no file
attribute changes. The let-bind form to accomplish this:
@lisp
+@group
(let (process-file-side-effects)
@dots{})
+@end group
@end lisp
For asynchronous processes, @value{tramp} uses a process sentinel to
@@ -3649,14 +3521,15 @@ sentinel is overwritten. The caller can still flush the file
attributes cache in its process sentinel with this code:
@lisp
+@group
(unless (memq (process-status proc) '(run open))
(dired-uncache remote-directory))
+@end group
@end lisp
Since @value{tramp} traverses subdirectories starting with the
root-directory, it is most likely sufficient to make the
@code{default-directory} of the process buffer as the root directory.
-@end ifset
@node Traces and Profiles
@@ -3687,7 +3560,7 @@ set the @code{tramp-verbose} level to 6 (@pxref{Bug Reports}).
The debug buffer is in
@ifinfo
-@ref{Outline Mode, , , @value{emacsdir}}.
+@ref{Outline Mode, , , emacs}.
@end ifinfo
@ifnotinfo
Outline Mode.
@@ -3696,88 +3569,34 @@ In this buffer, messages can be filtered by their level. To see
messages up to verbosity level 5, enter @kbd{C-u 6 C-c C-q}.
@ifinfo
Other navigation keys are described in
-@ref{Outline Visibility, , , @value{emacsdir}}.
+@ref{Outline Visibility, , , emacs}.
@end ifinfo
@value{tramp} handles errors internally. But to get a Lisp backtrace,
both the error and the signal have to be set as follows:
@lisp
+@group
(setq debug-on-error t
debug-on-signal t)
+@end group
@end lisp
To enable stepping through @value{tramp} function call traces, they
have to be specifically enabled as shown in this code:
@lisp
+@group
(require 'trace)
(dolist (elt (all-completions "tramp-" obarray 'functionp))
(trace-function-background (intern elt)))
(untrace-function 'tramp-read-passwd)
-(untrace-function 'tramp-gw-basic-authentication)
+@end group
@end lisp
The buffer @file{*trace-output*} contains the output from the function
-call traces. Disable @code{tramp-read-passwd} and
-@code{tramp-gw-basic-authentication} to stop password strings from
-being written to @file{*trace-output*}.
-
-
-@node Issues
-@chapter Debatable Issues and What Was Decided
-
-@itemize @bullet
-@item The uuencode method does not always work.
-
-@command{uudecode} on some systems cannot write to stdout, but
-@value{tramp} depends on encoding and decoding programs to be able to
-read from stdin and write to stdout.
-
-We can find ways to circumvent @command{uudecode}'s ability to write
-to stdout, such as writing to a temporary file and then piping that to
-stdout.
-
-But I have decided not to implement workarounds as they are too
-fragile to work reliably. Some on systems, @value{tramp} will not have
-uuencode method.
-
-@item The @value{tramp} file name syntax differs between Emacs and XEmacs.
-
-The Emacs maintainers wish to use a unified file name syntax for
-Ange-FTP and @value{tramp} so that users don't have to learn yet
-another syntax though it is okay to learn new extensions.
-
-For the XEmacs maintainers, the disruption from a unified file name
-syntax are not worth the gains. Firstly, the XEmacs package system
-relies on EFS for downloading new packages and therefore is already
-installed. On the other hand, @value{tramp} is not installed by
-default in XEmacs. Unifying will require @value{tramp} installed from
-the start.
-
-@ifset xemacs
-@strong{Note:} To make the syntax similar to @value{ftppackagename},
-make this change to the init file:
-
-@lisp
-(setq tramp-unified-filenames t)
-(require 'tramp)
-@end lisp
-
-To disable auto loading @value{emacsname} @value{tramp} package, set
-file permissions of
-@file{@dots{}/xemacs-packages/lisp/tramp/auto-autoloads.el*} to
-@code{000}.
-
-When using unified file names, @value{emacsname} download sites are
-added to @code{tramp-default-method-alist} with default method of
-@option{ftp} @xref{Default Method} for proper working of the
-@value{emacsname} package system.
-
-The syntax for unified file names is described in the @value{tramp} manual
-for @value{emacsothername}.
-@end ifset
-@end itemize
+call traces. Disable @code{tramp-read-passwd} to stop password
+strings from being written to @file{*trace-output*}.
@node GNU Free Documentation License