From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: stdin/stdout Date: Wed, 23 Jul 2008 21:03:23 +1000 Organization: Rapt Technologies Message-ID: <87iquw277o.fsf@lion.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1216813288 17264 80.91.229.12 (23 Jul 2008 11:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2008 11:41:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 23 13:42:17 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KLcjP-0004m9-09 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Jul 2008 13:42:07 +0200 Original-Received: from localhost ([127.0.0.1]:52255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLciV-0008F9-JJ for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Jul 2008 07:41:11 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!flpi089.ffdc.sbc.com!prodigy.net!news.astraweb.com!border2.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:E+RtUqUNgUkIKd3OdzTzgbiuUVc= Original-Lines: 47 Original-NNTP-Posting-Host: 21e98b8e.news.astraweb.com Original-X-Trace: DXC=9X; mPHQRCM^; 0`5D\QI41SL?0kYOcDh@Z\; EUAhjO1]]9jMSI8HST^^RTFYYW29Y\ZH^`; 1jGmH1\ Original-Xref: news.stanford.edu gnu.emacs.help:160502 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55851 Archived-At: "Jack O'Connor" writes: > Is there any way in Emacs to read standard input into a buffer or to > send the contents of a buffer to the standard output (particularly > both with editing in between)? I'm interested in being able to do > things like the following: > > decrypt file.crypt | emacs | encrypt > file2.crypt > ---or perhaps--- > curl some-website-with-code.com | emacs | python > ---or even just--- > emacs < file.txt > edited_file.txt > > Thanks very much for your help. > > - Jack O'Connor Not really answering your question, but .... For each of the examples you have, emacs has a solution. For encryption/decryption, there is crypt++ that will allow you to encrypt files and decrypt them from within emacs. Note also that emacs 23 comes with support for gnupg built-in. For your curl example, there is an interface for wget (wget.el) and I think also curl. Your last example, I don't really get. Emacs does have a 'script' mode that will allow you to process files and apply emacs functions to them (assuming your example is about non-interactive editing/processing of files. The point to note is that emacs is a pretty heavy duty piece of software that can be a bit slow to start/stop. While batch mode and script mode does mean you can do stuff non0interactively, in most cases, there are far beter tools. Most long-term emacs users learn to adjust to a paradigm where emacs is left running for long periods of time. I usually have my emacs running for weeks at a time - using things like the emacs client and server mode, you can leave emacs running and configure your system to just opo up a frame when an application needs input - for example, when you run crontab -e etc. tim -- tcross (at) rapttech dot com dot au