tramp-default-host "target")
@end lisp
- With both defaults set, @samp{@trampfn{ssh, , ,}} will connect
+ With both defaults set, @samp{@trampfn{ssh,,}} will connect
@value{tramp} to John's home directory on target.
-@ifset emacs
@strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix
for quoted file names.
-@end ifset
Instead of a single default host, @code{tramp-default-host-alist}
allows multiple default host values based on access method or user
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.
-
-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
-@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.
-
-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.
+@code{backup-directory-alist} have to be altered.
+
+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{@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.
+
+When @code{backup-directory-alist} is @code{nil} (the default), such
+problems do not occur.
To ``turns off'' the backup feature for @value{tramp} files and stop
@value{tramp} from saving to the backup directory, use this:
(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)
-@end lisp
-@end ifset
@noindent
- The backup file name of @file{@trampfn{su, root, localhost,
- /etc/secretfile}} would be @file{@trampfn{su, root, localhost,
- ~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
+ The backup file name of
+ @file{@trampfn{su,root@@localhost,/etc/secretfile}} would be
-@ifset emacs
-@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}
-@end ifset
-@ifset xemacs
-@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}}
-@end ifset
++@file{@trampfn{su,root@@localhost,~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~}}.
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
+auto-saving @value{tramp} files. 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.
+this points to the source directory where the Emacs was compiled.
+Reset such values to a valid directory.
Set @code{auto-save-file-name-transforms} to @code{nil} to save
auto-saved files to the same directory as the original file.
@end table
- @var{host} can take IPv4 or IPv6 address, as in @file{@trampfn{, ,
- 127.0.0.1, .emacs}} or @file{@trampfn{, ,
- @value{ipv6prefix}::1@value{ipv6postfix}, .emacs}}. For syntactical
- reasons, IPv6 addresses must be embedded in square brackets
- @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}.
+ @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
+ For syntactical reasons, IPv6 addresses must be embedded in square
+ brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}.
-@end ifset
By default, @value{tramp} will use the current local user name as the
remote user name for log in to the remote host. Specifying a different
@value{tramp} completion choices show up as
@example
- @c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}}
+ @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 example
Example:
@example
- @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin//etc} @key{TAB}}
- @print{} @trampfn{telnet, , melancholia, /etc}
-@ifset emacs
+ @kbd{C-x C-f @trampfn{telnet,melancholia,/usr/local/bin//etc} @key{TAB}}
+ @print{} @trampfn{telnet,melancholia,/etc}
- @kbd{C-x C-f @trampfn{telnet, , melancholia, //etc} @key{TAB}}
+ @kbd{C-x C-f @trampfn{telnet,melancholia,//etc} @key{TAB}}
@print{} /etc
- @kbd{C-x C-f @trampfn{telnet, , melancholia, /usr/local/bin///etc} @key{TAB}}
+ @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 example
During file name completion, remote directory contents are re-read
@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:
+that Emacs session. Subsequent @value{tramp} connections to the same
- remote host can then use the shortcut form: @samp{@trampfn{ssh, you,
- remotehost, /path}}.
++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
@kbd{M-x eshell} on a remote host:
@example
- @b{~ $} cd @trampfn{sudo, , , /etc} @key{RET}
- @b{@trampfn{sudo, root, host, /etc} $} hostname @key{RET}
+ @b{~ $} cd @trampfn{sudo,,/etc} @key{RET}
+ @b{@trampfn{sudo,root@@host,/etc} $} hostname @key{RET}
host
- @b{@trampfn{sudo, root, host, /etc} $} id @key{RET}
+ @b{@trampfn{sudo,root@@host,/etc} $} id @key{RET}
uid=0(root) gid=0(root) groups=0(root)
- @b{@trampfn{sudo, root, host, /etc} $} find-file shadow @key{RET}
+ @b{@trampfn{sudo,root@@host,/etc} $} find-file shadow @key{RET}
#<buffer shadow>
- @b{@trampfn{sudo, root, host, /etc} $}
+ @b{@trampfn{sudo,root@@host,/etc} $}
@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
(@pxref{Multi-hops}):
@example
- @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}
+ @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>
- @b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET}
- @b{@trampfn{su, root, remotehost, /root} $} id @key{RET}
+ @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} $}
+ @b{@trampfn{su,root@@remotehost,/root} $}
@end example
-@end ifset
@anchor{Running a debugger on a remote host}
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/}")
+ (setenv "xy" "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")
@end lisp
The reduced typing: @kbd{C-x C-f $xy @key{RET}}.
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}}.
+ @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
+ @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}
value.