aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2009-12-09 10:10:18 +0000
committerMichael Albinus2009-12-09 10:10:18 +0000
commit020335dfbf84fadd414cf8310853605baf1df1d1 (patch)
treebffaa4d87aaa6a16d9f797001af958624899b243 /doc
parent99999a1d72bd57f7e902a66564599beb57b56011 (diff)
downloademacs-020335dfbf84fadd414cf8310853605baf1df1d1.tar.gz
emacs-020335dfbf84fadd414cf8310853605baf1df1d1.zip
* eshell.texi (History): Add the other built-in variables.
(Built-ins): Explain built-ins, and how to apply the external commands. Add `history', `su' and `sudo'. * tramp.texi (Remote processes): Add missing <RET> in the example.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/ChangeLog8
-rw-r--r--doc/misc/eshell.texi70
-rw-r--r--doc/misc/tramp.texi5
3 files changed, 80 insertions, 3 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index eb8877e9f51..05ee0cfb357 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,11 @@
12009-12-09 Michael Albinus <michael.albinus@gmx.de>
2
3 * eshell.texi (History): Add the other built-in variables.
4 (Built-ins): Explain built-ins, and how to apply the external commands.
5 Add `history', `su' and `sudo'.
6
7 * tramp.texi (Remote processes): Add missing <RET> in the example.
8
12009-12-01 Bill Wohler <wohler@newt.com> 92009-12-01 Bill Wohler <wohler@newt.com>
2 10
3 * mh-e.texi (Searching): Use mh vfolder_format and fix typo in database 11 * mh-e.texi (Searching): Use mh vfolder_format and fix typo in database
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index e7d4132c4b8..f0b2374b59a 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -334,6 +334,20 @@ This variable always contains the current working directory.
334This variable always contains the previous working directory (the 334This variable always contains the previous working directory (the
335current working directory from before the last @code{cd} command). 335current working directory from before the last @code{cd} command).
336 336
337@item $_
338@vindex $_
339It refers to the last argument of the last command.
340
341@item $$
342@vindex $$
343This is the result of the last command. In case of an external
344command, it is @code{t} or @code{nil}.
345
346@item $?
347@vindex $?
348This variable contains the exit code of the last command (0 or 1 for
349Lisp functions, based on successful completion).
350
337@end table 351@end table
338 352
339@node Scripts 353@node Scripts
@@ -343,7 +357,19 @@ current working directory from before the last @code{cd} command).
343@node Built-ins 357@node Built-ins
344@section Built-in commands 358@section Built-in commands
345 359
346Here is a list of built-in commands that Eshell knows about: 360Several commands are built-in in Eshell. In order to call the
361external variant of a built-in command @code{foo}, you could call
362@code{*foo}. Usually, this should not be necessary. You can check
363what will be applied by the @code{which} command:
364
365@example
366~ $ which ls
367eshell/ls is a compiled Lisp function in `em-ls.el'
368~ $ which *ls
369/bin/ls
370@end example
371
372Some of the built-in commands have a special behaviour in Eshell:
347 373
348@table @code 374@table @code
349 375
@@ -367,6 +393,48 @@ that directory.
367 393
368With @samp{cd -42}, you can access the directory stack by number. 394With @samp{cd -42}, you can access the directory stack by number.
369 395
396@item history
397@findex history
398The @samp{history} command shows all commands kept in the history ring
399as numbered list. If the history ring contains
400@code{eshell-history-size} commands, those numbers change after every
401command invocation, therefore the @samp{history} command shall be
402applied before using the expansion mechanism with history numbers.
403
404The n-th entry of the history ring can be applied with the @samp{!n}
405command. If @code{n} is negative, the entry is counted from the end
406of the history ring.
407
408@samp{!foo} expands to the last command beginning with @code{foo}, and
409@samp{!?foo} to the last command containing @code{foo}. The n-th
410argument of the last command beginning with @code{foo} is accessible
411by @code{!foo:n}.
412
413@item su
414@findex su
415@itemx sudo
416@findex sudo
417@code{su} and @code{sudo} work as expected: they apply the following
418commands (@code{su}), or the command being an argument (@code{sudo})
419under the permissions of somebody else.
420
421This does not work only on
422the local host, but even on a remote one, when
423@code{default-directory} is a remote file name. The necessary
424proxy configuration of Tramp is performed
425@ifinfo
426automatically, @ref{Multi-hops, , , tramp}.
427@end ifinfo
428@ifnotinfo
429automatically.
430@end ifnotinfo
431Example:
432
433@example
434~ $ cd /ssh:otherhost:/etc
435/ssh:user@@otherhost:/etc $ sudo find-file shadow
436@end example
437
370@end table 438@end table
371 439
372 440
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index f0c0b6a3924..d68be209a99 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2594,10 +2594,11 @@ variable @code{tramp-default-proxies-alist} (@pxref{Multi-hops}):
2594 2594
2595@example 2595@example
2596@b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET} 2596@b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET}
2597@b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow 2597@b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow @key{RET}
2598File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow} 2598File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow}
2599@b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow 2599@b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow @key{RET}
2600#<buffer shadow> 2600#<buffer shadow>
2601
2601@b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET} 2602@b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET}
2602@b{@trampfn{su, root, remotehost, /root} $} id @key{RET} 2603@b{@trampfn{su, root, remotehost, /root} $} id @key{RET}
2603uid=0(root) gid=0(root) groups=0(root) 2604uid=0(root) gid=0(root) groups=0(root)