From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Zimmerman Newsgroups: gmane.emacs.help Subject: Re: Gist: get output of an external program on region Date: Tue, 25 Aug 2015 23:59:21 -0700 Message-ID: <20150826065432.19832.0393CFDE@ahiker.mooo.com> References: <20150826044653.19275.0DC19FFF@ahiker.mooo.com> <87y4gy4m13.fsf@kuiper.lan.informatimago.com> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1440572391 9933 80.91.229.3 (26 Aug 2015 06:59:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2015 06:59:51 +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 Aug 26 08:59:38 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZUUgL-0007o4-GZ for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Aug 2015 08:59:37 +0200 Original-Received: from localhost ([::1]:36377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUUgK-0002gf-Fo for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Aug 2015 02:59:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUUg9-0002gN-T9 for help-gnu-emacs@gnu.org; Wed, 26 Aug 2015 02:59:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUUg8-0001lp-HQ for help-gnu-emacs@gnu.org; Wed, 26 Aug 2015 02:59:25 -0400 Original-Received: from disorder-1-pt.tunnel.tserv3.fmt2.ipv6.he.net ([2001:470:1f04:51a::2]:33946 helo=acedia.primate.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUUg8-0001kw-8a for help-gnu-emacs@gnu.org; Wed, 26 Aug 2015 02:59:24 -0400 Original-Received: from acedia.primate.net (localhost [127.0.0.1]) by acedia.primate.net (8.14.9/8.14.9/Debian-4) with ESMTP id t7Q6xMwh007443 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Aug 2015 23:59:22 -0700 Original-Received: (from itz@localhost) by acedia.primate.net (8.14.9/8.14.9/Submit) id t7Q6xMW7007438 for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 23:59:22 -0700 X-Authentication-Warning: acedia.primate.net: itz set sender to itz@buug.org using -f Original-Received: from itz by ahiker.mooo.com with local (Exim 4.80) (envelope-from ) id 1ZUUg5-0005Ao-Vb for help-gnu-emacs@gnu.org; Tue, 25 Aug 2015 23:59:21 -0700 Content-Disposition: inline In-Reply-To: <87y4gy4m13.fsf@kuiper.lan.informatimago.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f04:51a::2 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106847 Archived-At: On 2015-08-26 08:11 +0200, Pascal J. Bourguignon wrote: > > There is shell-command-on-region and shell-command-as-string, but > > nothing that combines the input marshalling and the output marshalling. > You mean, just like C-u M-| ? No: M-| runs the command shell-command-on-region, which is an interactive compiled Lisp function in `simple.el'. It is bound to M-|, . (shell-command-on-region START END COMMAND &optional OUTPUT-BUFFER REPLACE ERROR-BUFFER DISPLAY-ERROR-BUFFER) Execute string COMMAND in inferior shell with region as input. Normally display output (if any) in temp buffer `*Shell Command Output*'; Prefix arg means replace the region with it. Return the exit code of COMMAND. 1. I need the output _as a string_. Not in some " *itz-temp-buffer*" which I then have to messily kill. 2. I need to pass the region to the program _as stdin_. and also 3. I need to avoid the interactive side-effects of shell-command-on-region, such as its tendency to create a new window to view the output buffer. -- Please *no* private copies of mailing list or newsgroup messages. Rule 420: All persons more than eight miles high to leave the court.