home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!daresbury!doc.ic.ac.uk!ibmassc!yktnews!admin!newsgate.watson.ibm.com!newsgate.watson.ibm.com!news.ans.net!europa.asd.contel.com!darwin.sura.net!mips!odin!fido!shankar
- From: shankar@sgi.com (Shankar Unni)
- Newsgroups: comp.emacs
- Subject: Re: ??? Standard output into a buffer
- Message-ID: <oqr90gc@fido.asd.sgi.com>
- Date: 20 Aug 92 21:50:56 GMT
- References: <1992Aug19.161217.16223@awdprime.austin.ibm.com>
- Sender: news@fido.asd.sgi.com (Usenet News Admin)
- Organization: Silicon Graphics, Inc.
- Lines: 22
-
- In article <1992Aug19.161217.16223@awdprime.austin.ibm.com> burky@austin.ibm.com writes:
- >I'm trying to find a way to execute a program from within my emacs buffer
- >such that the standard output of that program is directed to the insertion
- >point in my buffer.
- >
- >The best I've come up with so far is to open a shell buffer, run the program,
- >and copy/paste the results.
-
- One cheap and dirty way is to insert a space at the point you want to
- insert the shell output, set point and mark on either side of that
- space, and run shell-command-on-region (C-u M-|).
-
- Shell-command-on-region runs command with the standard-input set to
- the region between point and mark. If your command does not read
- standard input (or it is explicitly redirected in the command using
- "|" or "<"), then the region contents are thrown away.
-
- The region is automatically replaced by the output of the shell
- command.
- --
- Shankar Unni E-Mail: shankar@sgi.com
- Silicon Graphics Inc. Phone: +1-415-390-2072
-