aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-06-20 10:50:04 +0000
committerRichard M. Stallman2001-06-20 10:50:04 +0000
commitd408f8d038598bedab89d12025abfb5f45cf6e16 (patch)
tree1b43e6af06233f0a0f67f6c2ff858948fceffcbd
parentc4a9bc8e6d6939b31e6c23b311faa7d7f7cbb020 (diff)
downloademacs-d408f8d038598bedab89d12025abfb5f45cf6e16.tar.gz
emacs-d408f8d038598bedab89d12025abfb5f45cf6e16.zip
Give examples for M-! and M-|.
-rw-r--r--man/misc.texi25
1 files changed, 20 insertions, 5 deletions
diff --git a/man/misc.texi b/man/misc.texi
index 2b5bca029ca..f3f4850b17f 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -357,15 +357,23 @@ for that command. Standard input for the command comes from the null
357device. If the shell command produces any output, the output appears 357device. If the shell command produces any output, the output appears
358either in the echo area (if it is short), or in an Emacs buffer named 358either in the echo area (if it is short), or in an Emacs buffer named
359@samp{*Shell Command Output*}, which is displayed in another window 359@samp{*Shell Command Output*}, which is displayed in another window
360but not selected (if the output is long). A numeric argument, as in 360but not selected (if the output is long).
361@kbd{M-1 M-!}, directs this command to insert any output into the 361
362current buffer instead. In that case, point is left before the output 362 For instance, one way to decompress a file @file{foo.gz} from Emacs
363and the mark is set after the output. 363is to type @kbd{M-! gunzip foo.gz @key{RET}}. That shell command
364normally creates the file @file{foo} and produces no terminal output.
365
366 A numeric argument, as in @kbd{M-1 M-!}, says to insert terminal
367output into the current buffer instead of a separate buffer. It puts
368point before the output, and sets the mark after the output. For
369instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the
370uncompressed equivalent of @file{foo.gz} into the current buffer.
364 371
365 If the shell command line ends in @samp{&}, it runs asynchronously. 372 If the shell command line ends in @samp{&}, it runs asynchronously.
366For a synchronous shell command, @code{shell-command} returns the 373For a synchronous shell command, @code{shell-command} returns the
367command's exit status (0 means success), when it is called from a Lisp 374command's exit status (0 means success), when it is called from a Lisp
368program. 375program. You do not get any status information for an asynchronous
376command, since it hasn't finished yet.
369 377
370@kindex M-| 378@kindex M-|
371@findex shell-command-on-region 379@findex shell-command-on-region
@@ -376,6 +384,13 @@ insert the output in the current buffer, then the old region is deleted
376first and the output replaces it as the contents of the region. It 384first and the output replaces it as the contents of the region. It
377returns the command's exit status when it is called from a Lisp program. 385returns the command's exit status when it is called from a Lisp program.
378 386
387 One use for @kbd{M-|} is to run @code{uudecode}. For instance, if
388the buffer contains uuencoded text, type @kbd{C-x h M-| uudecode
389@key{RET}} to feed the entire buffer contents to the @code{uudecode}
390program. That program will ignore everything except the encoded text,
391and will store the decoded output into the file whose name is
392specified in the encoded text.
393
379@vindex shell-file-name 394@vindex shell-file-name
380@cindex environment 395@cindex environment
381 Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify the 396 Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify the