aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2018-10-20 13:38:31 +0200
committerMichael Albinus2018-10-20 13:38:31 +0200
commit67d3b40e0cba5f34b1c7aacc4e1ccea6300eae76 (patch)
tree992635f6f00e83aea36a3e2de1ceff1a29c03da8 /doc
parentefb214622a0f4e077c09e721d134552dfe76ef70 (diff)
downloademacs-67d3b40e0cba5f34b1c7aacc4e1ccea6300eae76.tar.gz
emacs-67d3b40e0cba5f34b1c7aacc4e1ccea6300eae76.zip
Expand host names in Tramp's ad-hoc multi-hop file names
* doc/misc/tramp.texi (Quick Start Guide): Improve wording. (Change file name syntax): Say, that `tramp-file-name-regexp' is not constant. (Ad-hoc multi-hops): Explain host name expansion. * etc/NEWS: Mention that host names in Tramp ad-hoc multi-hop file names must match the previous hop for methods like "su" or "sudo". Fix typos. * lisp/net/tramp.el (tramp-find-method, tramp-find-user): Adapt docstring. (tramp-find-host): Mark default value. (tramp-dissect-file-name): Expand host name for hops. (tramp-dissect-hop-name, tramp-make-tramp-hop-name): New defuns. (tramp-clear-passwd): Simplify. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate) (tramp-test26-file-name-completion): Extend tests.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/tramp.texi26
1 files changed, 18 insertions, 8 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 7c5ebf334ae..128501c3908 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -464,7 +464,7 @@ this case it is written as @code{host#port}.
464@cindex @option{plink} method 464@cindex @option{plink} method
465 465
466If your local host runs an SSH client, and the remote host runs an SSH 466If your local host runs an SSH client, and the remote host runs an SSH
467server, the most simple remote file name is 467server, the simplest remote file name is
468@file{@trampfn{ssh,user@@host,/path/to/file}}. The remote file name 468@file{@trampfn{ssh,user@@host,/path/to/file}}. The remote file name
469@file{@trampfn{ssh,,}} opens a remote connection to yourself on the 469@file{@trampfn{ssh,,}} opens a remote connection to yourself on the
470local host, and is taken often for testing @value{tramp}. 470local host, and is taken often for testing @value{tramp}.
@@ -2459,9 +2459,10 @@ and @code{user@@} parts are optional.
2459 2459
2460@defvar tramp-file-name-regexp 2460@defvar tramp-file-name-regexp
2461This variable keeps a regexp which matches the selected remote file 2461This variable keeps a regexp which matches the selected remote file
2462name syntax. However, it is not recommended to use this variable in 2462name syntax. Its value changes after every call of
2463external packages, a call of @code{file-remote-p} is much more 2463@code{tramp-change-syntax}. However, it is not recommended to use
2464appropriate. 2464this variable in external packages, a call of @code{file-remote-p} is
2465much more appropriate.
2465@ifinfo 2466@ifinfo
2466@pxref{Magic File Names, , , elisp} 2467@pxref{Magic File Names, , , elisp}
2467@end ifinfo 2468@end ifinfo
@@ -2585,9 +2586,9 @@ directory contents.
2585@cindex multi-hop, ad-hoc 2586@cindex multi-hop, ad-hoc
2586@cindex proxy hosts, ad-hoc 2587@cindex proxy hosts, ad-hoc
2587 2588
2588@value{tramp} file name syntax can accommodate ad hoc specification of 2589@value{tramp} file name syntax can accommodate ad-hoc specification of
2589multiple proxies without using @code{tramp-default-proxies-alist} 2590multiple proxies without using @code{tramp-default-proxies-alist}
2590configuration setup(@pxref{Multi-hops}). 2591configuration setup (@pxref{Multi-hops}).
2591 2592
2592Each proxy is specified using the same syntax as the remote host 2593Each proxy is specified using the same syntax as the remote host
2593specification minus the file name part. Each hop is separated by a 2594specification minus the file name part. Each hop is separated by a
@@ -2600,8 +2601,6 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}:
2600@kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}} 2601@kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}}
2601@end example 2602@end example
2602 2603
2603Proxies can take patterns @code{%h} or @code{%u}.
2604
2605@value{tramp} adds the ad-hoc definitions on the fly to 2604@value{tramp} adds the ad-hoc definitions on the fly to
2606@code{tramp-default-proxies-alist} and is available for re-use 2605@code{tramp-default-proxies-alist} and is available for re-use
2607during that Emacs session. Subsequent @value{tramp} connections to 2606during that Emacs session. Subsequent @value{tramp} connections to
@@ -2618,6 +2617,17 @@ For ad-hoc definitions to be saved automatically in
2618@end lisp 2617@end lisp
2619@end defopt 2618@end defopt
2620 2619
2620Ad-hoc proxies can take patterns @code{%h} or @code{%u} like in
2621@code{tramp-default-proxies-alist}. The following file name expands
2622to user @code{root} on host @code{remotehost}, starting with an
2623@option{ssh} session on host @code{remotehost}:
2624@samp{@value{prefix}ssh@value{postfixhop}%h|su@value{postfixhop}remotehost@value{postfix}}.
2625
2626On the other hand, if a trailing hop does not specifiy a host name,
2627the host name of the previous hop is reused. Therefore, the following
2628file name is equivalent to the previous example:
2629@samp{@value{prefix}ssh@value{postfixhop}remotehost|su@value{postfixhop}@value{postfix}}.
2630
2621 2631
2622@node Remote processes 2632@node Remote processes
2623@section Integration with other Emacs packages 2633@section Integration with other Emacs packages