home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / emacs / 2911 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.5 KB

  1. 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
  2. From: shankar@sgi.com (Shankar Unni)
  3. Newsgroups: comp.emacs
  4. Subject: Re: ??? Standard output into a buffer
  5. Message-ID: <oqr90gc@fido.asd.sgi.com>
  6. Date: 20 Aug 92 21:50:56 GMT
  7. References: <1992Aug19.161217.16223@awdprime.austin.ibm.com>
  8. Sender: news@fido.asd.sgi.com (Usenet News Admin)
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 22
  11.  
  12. In article <1992Aug19.161217.16223@awdprime.austin.ibm.com> burky@austin.ibm.com writes:
  13. >I'm trying to find a way to execute a program from within my emacs buffer
  14. >such that the standard output of that program is directed to the insertion
  15. >point in my buffer.
  16. >
  17. >The best I've come up with so far is to open a shell buffer, run the program,
  18. >and copy/paste the results.
  19.  
  20. One cheap and dirty way is to insert a space at the point you want to
  21. insert the shell output, set point and mark on either side of that
  22. space, and run shell-command-on-region (C-u M-|).
  23.  
  24. Shell-command-on-region runs command with the standard-input set to
  25. the region between point and mark. If your command does not read
  26. standard input (or it is explicitly redirected in the command using
  27. "|" or "<"), then the region contents are thrown away.
  28.  
  29. The region is automatically replaced by the output of the shell
  30. command.
  31. --
  32. Shankar Unni                E-Mail:    shankar@sgi.com
  33. Silicon Graphics Inc.            Phone:    +1-415-390-2072
  34.