/[tramp]/tramp/texi/tramp.texi
ViewVC logotype

Diff of /tramp/texi/tramp.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.50 by kai, Fri Sep 6 10:10:13 2002 UTC revision 2.51 by albinus, Sun Sep 8 18:33:03 2002 UTC
# Line 133  Configuring @tramp{} for use Line 133  Configuring @tramp{} for use
133  * Multi-hop Methods::           Connecting to a remote host using multiple hops.  * Multi-hop Methods::           Connecting to a remote host using multiple hops.
134  * Default Method::              Selecting a default method.  * Default Method::              Selecting a default method.
135  * Customizing Methods::         Using Non-Standard Methods.  * Customizing Methods::         Using Non-Standard Methods.
136    * Customizing Completion::      Selecting config files for user/host name completion.
137  * Remote Programs::             How @tramp{} finds and uses programs on the remote machine.  * Remote Programs::             How @tramp{} finds and uses programs on the remote machine.
138  * Remote shell setup::            * Remote shell setup::          
139    
140  Using @tramp  Using @tramp
141    
142  * Filename Syntax::             @tramp{} filename conventions.  * Filename Syntax::             @tramp{} filename conventions.
143  * Multi-hop filename syntax::   Multi-hop filename conventions  * Multi-hop filename syntax::   Multi-hop filename conventions.
144  * Dired::                       Dired and filename completion.  * Filename completion::         Filename completion.
145    * Dired::                       Dired.
146    
147  The inner workings of remote version control  The inner workings of remote version control
148    
# Line 549  can use to connect to remote machines an Line 551  can use to connect to remote machines an
551  * Multi-hop Methods::           Connecting to a remote host using multiple hops.  * Multi-hop Methods::           Connecting to a remote host using multiple hops.
552  * Default Method::              Selecting a default method.  * Default Method::              Selecting a default method.
553  * Customizing Methods::         Using Non-Standard Methods.  * Customizing Methods::         Using Non-Standard Methods.
554    * Customizing Completion::      Selecting config files for user/host name completion.
555  * Remote Programs::             How @tramp{} finds and uses programs on the remote machine.  * Remote Programs::             How @tramp{} finds and uses programs on the remote machine.
556  * Remote shell setup::          Remote shell setup hints.  * Remote shell setup::          Remote shell setup hints.
557  * Windows setup hints::         Issues with Cygwin ssh.  * Windows setup hints::         Issues with Cygwin ssh.
# Line 1211  For the time being, I'll refer you to th Line 1214  For the time being, I'll refer you to th
1214  variable, accessible with @kbd{C-h v tramp-methods @key{RET}}.  variable, accessible with @kbd{C-h v tramp-methods @key{RET}}.
1215    
1216    
1217    @node Customizing Completion
1218    @section Selecting config files for user/host name completion
1219    @cindex customizing completion
1220    @cindex selecting config files
1221    @vindex tramp-completion-function-alist
1222    
1223    The variable @code{tramp-completion-function-alist} is intended to
1224    customize, which files are taken into account for user and host name
1225    completion (@pxref{Filename completion}).  For every method, it keeps
1226    a set of configuration files, accompanied by a Lisp function able to
1227    parse that file.  Entries in @code{tramp-completion-function-alist}
1228    have the form (@var{method} @var{pair1} @var{pair2} ...).
1229    
1230    Each @var{pair} is composed of (@var{function} @var{file}).
1231    @var{function} is responsible to extract user names and host names
1232    from @var{file} for completion.  There are two functions which access
1233    this variable:
1234    
1235    @defun tramp-get-completion-function method
1236    This function returns the list of completion functions for @var{method}.
1237    
1238    Example:
1239    @example
1240    (tramp-get-completion-function "rsh")
1241    
1242         @result{} ((tramp-parse-rhosts "/etc/hosts.equiv")
1243             (tramp-parse-rhosts "~/.rhosts"))
1244    @end example
1245    @end defun
1246    
1247    @defun tramp-set-completion-function method function-list
1248    This function sets @var{function-list} as list of completion functions
1249    for @var{method}.
1250    
1251    Example:
1252    @example
1253    (tramp-set-completion-function "ssh"
1254     '((tramp-parse-shosts "/etc/ssh_known_hosts")
1255       (tramp-parse-shosts "~/.ssh/known_hosts")))
1256    
1257         @result{} ((tramp-parse-shosts "/etc/ssh_known_hosts")
1258             (tramp-parse-shosts "~/.ssh/known_hosts"))
1259    @end example
1260    @end defun
1261    
1262    The following predefined functions parsing configuration files exists:
1263    
1264    @table @asis
1265    @item @code{tramp-parse-rhosts}
1266    @findex tramp-parse-rhosts
1267    
1268    This function parses files which are syntactical equivalent to
1269    @file{~/.rhosts}.  It returns both host names and user names, if
1270    specified.
1271    
1272    @item @code{tramp-parse-shosts}
1273    @findex tramp-parse-shosts
1274    
1275    This function parses files which are syntactical equivalent to
1276    @file{/etc/ssh_known_hosts}.  Since there are no user names specified
1277    in such files, it can return host names only.
1278    
1279    @item @code{tramp-parse-hosts}
1280    @findex tramp-parse-hosts
1281    
1282    A function dedicated to @file{/etc/hosts} style files.  It returns
1283    host names only.
1284    
1285    @item @code{tramp-parse-passwd}
1286    @findex tramp-parse-passwd
1287    
1288    Finally a method which parses @file{/etc/passwd} like files.
1289    Obviously, it can return user names only.
1290    @end table
1291    
1292    A function which parses @file{~/.netrc"} file syntax doesn't exist in
1293    @tramp{}, because this task is delegated to @cite{Ange-FTP}. Its
1294    customization should be used instead.
1295    
1296    If you want to keep your own data in a file, with your own structure,
1297    you might provide such a function as well.  This function must meet
1298    the following conventions:
1299    
1300    @defun my-tramp-parse file
1301    @var{file} must be either a file name on your host, or @code{nil}. The
1302    function must return a list of (@var{user} @var{host}), which are
1303    taken as candidates for user and host name completion.
1304    
1305    Example:
1306    @example
1307    (my-tramp-parse "~/.my-tramp-hosts")
1308    
1309         @result{} ((nil "toto") ("daniel" "melancholia"))
1310    @end example
1311    @end defun
1312    
1313    
1314  @node Remote Programs  @node Remote Programs
1315  @section How @tramp{} finds and uses programs on the remote machine.  @section How @tramp{} finds and uses programs on the remote machine.
1316    
# Line 1381  key! Line 1481  key!
1481    
1482  @menu  @menu
1483  * Filename Syntax::             @tramp{} filename conventions.  * Filename Syntax::             @tramp{} filename conventions.
1484  * Multi-hop filename syntax::   Multi-hop filename conventions  * Multi-hop filename syntax::   Multi-hop filename conventions.
1485  * Dired::                       Dired and filename completion.  * Filename completion::         Filename completion.
1486    * Dired::                       Dired.
1487  @end menu  @end menu
1488    
1489    
# Line 1514  possible hop methods and information on Line 1615  possible hop methods and information on
1615  want to add your own.  want to add your own.
1616    
1617    
1618  @node Dired  @node Filename completion
1619  @section Dired and filename completion  @section Filename completion
 @cindex dired  
1620  @cindex filename completion  @cindex filename completion
1621    
 @tramp{} works transparently with dired, enabling you to use this powerful  
 file management tool to manage files on any machine you have access to  
 over the Internet.  
   
1622  Filename completion works with @tramp{} for both completing methods,  Filename completion works with @tramp{} for both completing methods,
1623  user names and machine names (except multi hop methods) as well as for  user names and machine names (except multi hop methods) as well as for
1624  files on remote machines.  files on remote machines.
1625    
1626    If you, for example, type @kbd{C-x C-f /t @key{TAB}}, @tramp{} might
1627    give you as result the choice for
1628    
1629    @example
1630    telnet:                            tmp/
1631    toto:
1632    @end example
1633        
1634    @samp{telnet:} is a possible completion for the respective method,
1635    @samp{tmp/} stands for the directory @file{/tmp} on your local
1636    machine, and @samp{toto:} might be a host @tramp has detected in your
1637    @file{~/.ssh/known_hosts} file (given you're using default method
1638    @option{ssh}).
1639    
1640    If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to
1641    @samp{/telnet:}.  Next @kbd{@key{TAB}} brings you all machine names
1642    @tramp{} detects in your @file{/etc/hosts} file, let's say
1643    
1644    @example
1645    telnet:127.0.0.1:                  telnet:192.168.0.1:
1646    telnet:localhost:                  telnet:melancholia.danann.net:
1647    telnet:melancholia:
1648    @end example
1649    
1650    Now you can choose the desired machine, and you can continue to
1651    complete file names on that machine.
1652    
1653  As filename completion needs to fetch the listing of files from the  As filename completion needs to fetch the listing of files from the
1654  remote machine, this feature is sometimes fairly slow.  As @tramp{} does not  remote machine, this feature is sometimes fairly slow.  As @tramp{}
1655  yet cache the results of directory listing, there is no gain in  does not yet cache the results of directory listing, there is no gain
1656  performance the second time you complete filenames.  in performance the second time you complete filenames.
1657    
1658    If the configuration files (@pxref{Customizing Completion}), which
1659    @tramp{} uses for analysis of completion, offer user names, those user
1660    names will be taken into account as well.
1661    
1662    
1663    @node Dired
1664    @section Dired
1665    @cindex dired
1666    
1667    @tramp{} works transparently with dired, enabling you to use this powerful
1668    file management tool to manage files on any machine you have access to
1669    over the Internet.
1670    
1671  If you need to browse a directory tree, Dired is a better choice, at  If you need to browse a directory tree, Dired is a better choice, at
1672  present, than filename completion.  Dired has its own cache mechanism  present, than filename completion.  Dired has its own cache mechanism
# Line 1946  would have to be installed from the star Line 2082  would have to be installed from the star
2082  @c * Make terminology "inline" vs "out-of-band" consistent.  @c * Make terminology "inline" vs "out-of-band" consistent.
2083  @c   It seems that "external" is also used instead of "out-of-band".  @c   It seems that "external" is also used instead of "out-of-band".
2084    
2085    @c * M. Albinus
2086    @c ** Use `filename' resp. `file name' consistently.
2087    @c ** Use `host' resp. `machine' consistently.
2088    @c ** Consequent `.' at the end of menues.
2089    @c ** Consistent small or capitalized words especially in menues.

Legend:
Removed from v.2.50  
changed lines
  Added in v.2.51

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26