emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/man/tramp.texi,v
Date: Sun, 22 Jul 2007 16:42:03 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/07/22 16:42:02

Index: tramp.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/man/tramp.texi,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- tramp.texi  17 Jul 2007 21:16:36 -0000      1.57
+++ tramp.texi  22 Jul 2007 16:42:02 -0000      1.58
@@ -17,23 +17,24 @@
 
 @include trampver.texi
 
address@hidden Macros for formatting a filename.
address@hidden trampfn is for a full filename, trampfnmhl means method, host, 
localname
address@hidden were given, and so on.
address@hidden trampfn {method, user, host, localname}
address@hidden@value{postfixhop}\user\@@address@hidden
address@hidden macro
address@hidden Macro for formatting a filename according to the repective 
syntax.
address@hidden xxx and yyy are auxiliary macros in order to omit leading and
address@hidden trailing whitespace.  Not very elegant, but I don't know it 
better.
 
address@hidden trampfnmhl {method, host, localname}
address@hidden@address@hidden
address@hidden xxx address@hidden
address@hidden address@hidden
 @end macro
 
address@hidden trampfnuhl {user, host, localname}
address@hidden@@address@hidden
address@hidden yyy {one, address@hidden
address@hidden@c
address@hidden address@hidden
address@hidden@c
address@hidden ifclear
address@hidden address@hidden
 @end macro
 
address@hidden trampfnhl {host, localname}
address@hidden@value{postfix}\localname\
address@hidden trampfn {method, user, host, address@hidden
address@hidden@yyy{\method\,@address@hidden,@@address@hidden@c
 @end macro
 
 @copying
@@ -497,7 +498,7 @@
 installed.  It is initially configured to use the @command{scp}
 program to connect to the remote host.  So in the easiest case, you
 just type @kbd{C-x C-f} and then enter the filename
address@hidden@trampfnuhl{user, machine, /path/to.file}}.
address@hidden@trampfn{, user, machine, /path/to.file}}.
 
 On some hosts, there are problems with opening a connection.  These are
 related to the behavior of the remote shell.  See @xref{Remote shell
@@ -1180,7 +1181,7 @@
 For the special case of editing files on the local host as another
 user, see the @option{su} or @option{sudo} methods.  They offer
 shortened syntax for the @samp{root} account, like
address@hidden@trampfnmhl{su, , /etc/motd}}.
address@hidden@trampfn{su, , , /etc/motd}}.
 
 People who edit large files may want to consider @option{scpc} instead
 of @option{ssh}, or @option{pscp} instead of @option{plink}.  These
@@ -1273,11 +1274,11 @@
       tramp-default-host "target")
 @end lisp
 
-Then the simple file name @address@hidden,,}} will connect you
+Then the simple file name @address@hidden, , ,}} will connect you
 to John's home directory on target.
 @ifset emacs
-Note, however, that the most simplification @address@hidden,,}}
-won't work, because @samp{/:} is the prefix for quoted file names.
+Note, however, that the most simplification @samp{/::} won't work,
+because @samp{/:} is the prefix for quoted file names.
 @end ifset
 
 
@@ -1339,7 +1340,7 @@
 (add-to-list 'tramp-default-proxies-alist
              '("\\`bastion\\.your\\.domain\\'"
                "\\`bird\\'"
-               "@trampfnmhl{ssh, jump.your.domain,}"))
+               "@trampfn{ssh, , jump.your.domain,}"))
 @end lisp
 
 @var{proxy} can contain the patterns @code{%h} or @code{%u}.  These
@@ -1352,15 +1353,15 @@
 
 @lisp
 (add-to-list 'tramp-default-proxies-alist
-             '("\\.your\\.domain\\'" "\\`root\\'" "@trampfnmhl{ssh, %h,}"))
+             '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}"))
 @end lisp
 
-Opening @address@hidden, randomhost.your.domain,}} would
-connect first @samp{randomhost.your.domain} via @code{ssh} under your
-account name, and perform @code{sudo -u root} on that host afterwards.
-It is important to know that the given method is applied on the host
-which has been reached so far.  @code{sudo -u root}, applied on your
-local host, wouldn't be useful here.
+Opening @address@hidden, , randomhost.your.domain,}} would connect
+first @samp{randomhost.your.domain} via @code{ssh} under your account
+name, and perform @code{sudo -u root} on that host afterwards.  It is
+important to know that the given method is applied on the host which
+has been reached so far.  @code{sudo -u root}, applied on your local
+host, wouldn't be useful here.
 
 This is the recommended configuration to work as @samp{root} on remote
 Ubuntu hosts.
@@ -1382,7 +1383,7 @@
 @lisp
 (add-to-list 'tramp-default-proxies-alist
              '("\\`host\\.other\\.domain\\'" nil
-               "@trampfnmhl{tunnel, proxy.your.domain#3128,}"))
+               "@trampfn{tunnel, , proxy.your.domain#3128,}"))
 @end lisp
 
 Gateway methods can be declared as first hop only in a multiple hop
@@ -2029,32 +2030,32 @@
 @cindex filename examples
 
 To access the file @var{localname} on the remote machine @var{machine}
-you would specify the filename @address@hidden@var{machine},
+you would specify the filename @address@hidden, , @var{machine},
 @var{localname}}}.  This will connect to @var{machine} and transfer
 the file using the default method.  @xref{Default Method}.
 
 Some examples of @value{tramp} filenames are shown below.
 
 @table @file
address@hidden @trampfnhl{melancholia, .emacs}
address@hidden @trampfn{, , melancholia, .emacs}
 Edit the file @file{.emacs} in your home directory on the machine
 @code{melancholia}.
 
address@hidden @trampfnhl{melancholia.danann.net, .emacs}
address@hidden @trampfn{, , melancholia.danann.net, .emacs}
 This edits the same file, using the fully qualified domain name of
 the machine.
 
address@hidden @trampfnhl{melancholia, ~/.emacs}
address@hidden @trampfn{, , melancholia, ~/.emacs}
 This also edits the same file --- the @file{~} is expanded to your
 home directory on the remote machine, just like it is locally.
 
address@hidden @trampfnhl{melancholia, ~daniel/.emacs}
address@hidden @trampfn{, , melancholia, ~daniel/.emacs}
 This edits the file @file{.emacs} in the home directory of the user
 @code{daniel} on the machine @code{melancholia}.  The @file{~<user>}
 construct is expanded to the home directory of that user on the remote
 machine.
 
address@hidden @trampfnhl{melancholia, /etc/squid.conf}
address@hidden @trampfn{, , melancholia, /etc/squid.conf}
 This edits the file @file{/etc/squid.conf} on the machine
 @code{melancholia}.
 
@@ -2066,10 +2067,10 @@
 part of the filename.
 
 To log in to the remote machine as a specific user, you use the syntax
address@hidden@address@hidden, @var{machine}, @var{path/to.file}}}.
address@hidden@trampfn{, @var{user}, @var{machine}, @var{path/to.file}}}.
 That means that connecting to @code{melancholia} as @code{daniel} and
 editing @file{.emacs} in your home directory you would specify
address@hidden@trampfnuhl{daniel, melancholia, .emacs}}.
address@hidden@trampfn{, daniel, melancholia, .emacs}}.
 
 It is also possible to specify other file transfer methods
 (@pxref{Default Method}) as part of the filename.
@@ -2184,9 +2185,9 @@
 your @file{/etc/hosts} file, let's say
 
 @example
address@hidden,127.0.0.1,}                 @trampfnmhl{telnet,192.168.0.1,}
address@hidden,localhost,}                 
@trampfnmhl{telnet,melancholia.danann.net,}
address@hidden,melancholia,}
address@hidden, , 127.0.0.1,}             @trampfn{telnet, , 192.168.0.1,}
address@hidden, , localhost,}             @trampfn{telnet, , 
melancholia.danann.net,}
address@hidden, , melancholia,}
 @end example
 
 Now you can choose the desired machine, and you can continue to
@@ -2209,20 +2210,20 @@
 @end ifinfo
 
 @ifset emacs
-As example, @address@hidden,melancholia,/usr/local/bin//etc}
+As example, @address@hidden, , melancholia, /usr/local/bin//etc}
 @key{TAB}} would result in
address@hidden@trampfnmhl{telnet,melancholia,/etc}}, whereas
address@hidden@trampfnmhl{telnet,melancholia,//etc} @key{TAB}} reduces the
address@hidden@trampfn{telnet, , melancholia, /etc}}, whereas
address@hidden@trampfn{telnet, , melancholia, //etc} @key{TAB}} reduces the
 minibuffer contents to @file{/etc}.  A triple-slash stands for the
 default behaviour,
-i.e. @address@hidden,melancholia,/usr/local/bin///etc}
+i.e. @address@hidden, , melancholia, /usr/local/bin///etc}
 @key{TAB}} expands directly to @file{/etc}.
 @end ifset
 
 @ifset xemacs
-As example, @address@hidden,melancholia,/usr/local/bin//}}
-would result in @address@hidden,melancholia,/}}, whereas
address@hidden@trampfnmhl{telnet,melancholia,//}} expands the minibuffer
+As example, @address@hidden, , melancholia, /usr/local/bin//}}
+would result in @address@hidden, , melancholia, /}}, whereas
address@hidden@trampfn{telnet, , melancholia, //}} expands the minibuffer
 contents to @file{/}.
 @end ifset
 
@@ -2295,7 +2296,7 @@
 this:
 
 @example
address@hidden $} cd @trampfnmhl{sudo, , /etc} @key{RET}
address@hidden $} cd @trampfn{sudo, , , /etc} @key{RET}
 @address@hidden, root, host, /etc} $} hostname @key{RET}
 host
 @address@hidden, root, host, /etc} $} id @key{RET}
@@ -2324,12 +2325,12 @@
 
 @example
 @kbd{M-x gdb @key{RET}}
address@hidden gdb (like this):} gdb --annotate=3 @trampfnmhl{ssh, host, 
~/myprog} @key{RET}
address@hidden gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, 
~/myprog} @key{RET}
 @end example
 
 The file name can also be relative to a remote default directory.
 Given you are in a buffer that belongs to the remote directory
address@hidden, host, /home/user}, you could call
address@hidden, , host, /home/user}, you could call
 
 @example
 @kbd{M-x perldb @key{RET}}
@@ -2602,7 +2603,7 @@
 @item
 I'ld like to see a host indication in the mode line when I'm remote
 
-The following code has been tested with @value{emacsname} 22.  You
+The following code has been tested with @value{emacsname} 22.1.  You
 should put it into your @file{~/.emacs}:
 
 @lisp
@@ -2630,6 +2631,18 @@
      mode-line-buffer-identification
      my-mode-line-buffer-identification)))
 @end lisp
+
+Since @value{emacsname} 23, the @code{:eval} clause can be simplified:
+
address@hidden
+   '(: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)))
address@hidden lisp
 @end ifset
 
 
@@ -2693,11 +2706,11 @@
 @end lisp
 
 The file name left to type would be
address@hidden C-f @trampfnhl{news.my.domain, /opt/news/etc}}.
address@hidden C-f @trampfn{, , news.my.domain, /opt/news/etc}}.
 
 Note, that there are some useful settings already.  Accessing your
 local host as @samp{root} user, is possible just by @kbd{C-x C-f
address@hidden,,}}.
address@hidden, , ,}}.
 
 @item Use configuration possibilities of your method:
 
@@ -2711,7 +2724,7 @@
      User news
 @end example
 
-The file name left to type would be @kbd{C-x C-f @trampfnmhl{ssh, xy,
+The file name left to type would be @kbd{C-x C-f @trampfn{ssh, , xy,
 /opt/news/etc}}.  Depending on files in your directories, it is even
 possible to complete the hostname with @kbd{C-x C-f
 @address@hidden @key{TAB}}.
@@ -2881,8 +2894,44 @@
 directory.
 @end ifset
 
address@hidden emacs
address@hidden Use bbdb:
+
address@hidden has a built-in feature for @value{ftppackagename} files,
+which works also for @value{tramp}.
address@hidden
address@hidden, Storing FTP sites in the BBDB, , bbdb}
address@hidden ifinfo
+
+You need to load @file{bbdb}:
+
address@hidden
+(require 'bbdb)
+(bbdb-initialize)
address@hidden lisp
+
+Then you can create a BBDB entry via @kbd{M-x bbdb-create-ftp-site}.
+Because BBDB is not prepared for @value{tramp} syntax, you must
+specify a method together with the user name, when needed. Example:
+
address@hidden
address@hidden bbdb-create-ftp-site @key{RET}}
address@hidden Site:} news.my.domain @key{RET}
address@hidden Directory:} /opt/news/etc/ @key{RET}
address@hidden Username:} address@hidden @key{RET}
address@hidden:} @key{RET}
address@hidden Comments:} @key{RET}
address@hidden example
+
+When you have opened your BBDB buffer, you can access such an entry by
+pressing the key @key{F}.
address@hidden ifset
+
 @end enumerate
 
+I would like to thank all @value{tramp} users, who have contributed to
+the different recipes!
+
 
 @item
 How can I disable @value{tramp}?




reply via email to

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