Installing TRAMP into Emacs
***************************

TRAMP is part of Emacs since version 22.  If you use the version that
comes with your Emacs, the following information is not necessary.

TRAMP 2.4.1 has been used successfully on Emacs 24, on Emacs 25, on
Emacs 26, and on Emacs 27.

System Requirements
===================

For installation, it requires at least the following program versions:

   * GNU Autoconf 2.50 if sources are taken from GIT
   * GNU make 3.76
   * GNU texinfo 4.6

On MS Windows, you need Posix programs for installation.  These and
other useful Posix utilities can be obtained from one of several
projects:

   * <http://www.mingw.org/msys.shtml>  ( MSYS )
   * <http://www.cygwin.com/>           ( Cygwin )
   * <http://unxutils.sourceforge.net/> ( UnxUtils )
   * <http://gnuwin32.sourceforge.net/> ( GnuWin32 )

Basic Installation
==================

Installing TRAMP into your Emacs is a relatively easy process, at least
compared to rebuilding your machine from scratch.  ;)

Seriously, though, the installation should be a fairly simple matter.
The easiest way to proceed is as follows:

   * Choose a directory, say '~/emacs/'.  Change into that directory and
     unpack the tarball.  This will give you a directory
     '~/emacs/tramp-2.4.1/' which contains subdirectories 'lisp' for the
     Lisp code, 'texi' for the documentation, and 'test' for code
     running TRAMP's test suite.  Make a symbolic link:

          $ ln -s tramp-2.4.1 tramp

   * 'cd' to '~/emacs/tramp/'.  If you've taken TRAMP from the GIT
     sources, type 'autoconf' in order to get an up-to-date 'configure'
     script.

   * Type './configure' to configure TRAMP for your system.

     Running 'configure' takes a while.  While running, it prints some
     messages telling which features it is checking for.

   * Type 'make' to build the byte-compiled Lisp files as well as the
     Info manual.

   * Type 'make install' to install the TRAMP Lisp files and Info
     manual.

   * You can remove the byte-compiled Lisp files and the Info manual
     from the source directory by typing 'make clean'.  To also remove
     the files that 'configure' created, type 'make distclean'.

   * NOTE: If you run into problems running the example 'make' command,
     don't despair.  You can still byte compile the '*.el' files by
     opening Emacs in 'dired' ('C-x d') mode, at '~/emacs/tramp/lisp'.
     Mark the lisp files with 'm', then press 'B' to byte compile your
     selections.

     Something similar can be done to create the info manual.  Just
     change to directory '~/emacs/tramp/texi' and load the 'tramp.texi'
     file in Emacs.  Then press 'M-x texinfo-format-buffer <RET>' to
     generate '~/emacs/tramp/info/tramp'.

Parameters in order to control installation
===========================================

By default, 'make install' will install TRAMP's files in
'/usr/local/share/emacs/site-lisp' and '/usr/local/share/info'.  You can
specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PATH'.  On GNU/Linux systems, it has
been reported useful to apply

     $ ./configure --prefix=/usr

If your installed copy of Emacs is named something other than 'emacs',
you will need to tell 'make' where to find it so that it can correctly
byte-compile the TRAMP sources.

For example, to pass the Emacs command to be called:

     $ ./configure --with-emacs=emacs24

If you specify the absolute path of the command, it must not contain
whitespaces.  If you need it, the corresponding path shall be appended
to the 'PATH' environment variable.

Also, the '--prefix=PATH' option to 'configure' may not be general
enough to set the paths you want.  If not, you can declare the
directories Lisp and Info files should be installed.

For example, to put the Lisp files in '$HOME/elisp' and the Info file in
'$HOME/info', you would type:

     $ ./configure --with-lispdir=$HOME/elisp --infodir=$HOME/info

On MS Windows, given Emacs is installed at 'C:/Program Files/Emacs', you
should apply

     $ ./configure \
         --with-lispdir='C:/Program Files/Emacs/share/emacs/site-lisp' \
         --infodir='C:/Program Files/Emacs/share/info'

or in Emacs versions prior 24.4

     $ ./configure \
         --with-lispdir='C:/Program Files/Emacs/site-lisp' \
         --infodir='C:/Program Files/Emacs/info'

'make' supports the 'DESTDIR' environment variable for staged
installation; *note (standards)Command Variables:::

     $ make DESTDIR=/tmp install

Running 'configure' might result in errors or warnings.  The output
explains in detail what's going wrong.

In case of errors, it is mandatory to fix them before continuation.
This can be missing or wrong versions of 'emacs', Emacs packages,
'make', or 'makeinfo'.

Warnings let 'configure' (and the whole installation process) continue,
but parts of TRAMP aren't installed.  This can happen with missing or
wrong versions of 'texi2dvi' or 'install-info'.  Here you can decide
yourself whether you want to renounce on the related feature
('tramp.dvi' file for printed output, TRAMP entry in Info's 'dir' file),
or whether you want to adapt your 'PATH' environment variable, and rerun
'configure'.  An alternative is calling the missed parts manually later
on.

A test suite for TRAMP
======================

TRAMP comes with an own test suite.  This requires at least Emacs 24.4.
In order to run this test suite, you call

     $ make check

This test suite uses a mock-up connection method for the tests.  This
means, that no real connection is established, and no password is
required for the tests.  You can change this default behaviour by
tweaking the environment variable 'REMOTE_TEMPORARY_FILE_DIRECTORY':

     $ env REMOTE_TEMPORARY_FILE_DIRECTORY=/sudo::/tmp make check

If you are using MS Windows, the mock-up trick does not work, and you
must change the default anyway.

The makefile contains an environment variable 'TRAMP_TEST_ARGS', which
could be used for changing connection properties:

     $ make TRAMP_TEST_ARGS=--eval\ \\\"\(add-to-list\ \'tramp-connection-properties\ \(list\ nil\ \\\\\\\"remote-shell\\\\\\\"\ \\\\\\\"/bin/bash\\\\\\\"\)\)\\\" check

How to plug-in TRAMP into your environment
==========================================

If you don't install TRAMP into the intended directories, but prefer to
use from the source directory, you need to add the following lines into
your '.emacs':

     (add-to-list 'load-path "~/emacs/tramp/lisp/")
     (require 'tramp)

If the environment variable 'INFOPATH' is set, add the directory
'~/emacs/tramp/info/' to it.  Else, add the directory to
'Info-directory-list', as follows:

     (add-to-list 'Info-directory-list "~/emacs/tramp/info/")

Suggestions/Bug Reports
=======================

Send all suggestions for fixes, etc to <tramp-devel@gnu.org>.
