From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: How to communicate with a running external process with given PID? Date: Mon, 22 Jul 2013 07:02:06 -0600 Message-ID: References: <87fvv9ha6o.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1374498070 29105 80.91.229.3 (22 Jul 2013 13:01:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jul 2013 13:01:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 22 15:01:11 2013 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 1V1Fjf-0005t7-V8 for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jul 2013 15:01:08 +0200 Original-Received: from localhost ([::1]:44886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Fjf-0000q2-J5 for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jul 2013 09:01:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1FjP-0000oL-30 for help-gnu-emacs@gnu.org; Mon, 22 Jul 2013 09:00:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1FjL-00017E-Jb for help-gnu-emacs@gnu.org; Mon, 22 Jul 2013 09:00:51 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1FjL-00016x-CY for help-gnu-emacs@gnu.org; Mon, 22 Jul 2013 09:00:47 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V1FjH-0005Z8-Vx for help-gnu-emacs@gnu.org; Mon, 22 Jul 2013 15:00:43 +0200 Original-Received: from 70-59-38-124.hlrn.qwest.net ([70.59.38.124]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Jul 2013 15:00:43 +0200 Original-Received: from kevin.d.rodgers by 70-59-38-124.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Jul 2013 15:00:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 70-59-38-124.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <87fvv9ha6o.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:92317 Archived-At: On 7/20/13 3:06 AM, Thorsten Jolitz wrote: > say I want to call another program (more exactly, another Lisp program > that is not Emacs Lisp) from an Emacs Lisp program. > > My special requirement is that I don't want to start a new Emacs > subprocess, but want to communicate with an existing (running) process. > And there maybe several running instances of this program at the same > time, so I want to communicate with one existing (running) process with > a given PID. > > Now there is splendid support in Emacs for communicating with other > programs, but always based on the assumption that Emacs starts and > controls a new subprocess. > > There is chapter 37.12 "Accessing Other Processes" in the Elisp manual, > and I can do successfully > > ,------------------------- > | (process-attributes PID) > `------------------------- > > to receive a lot of information about the process I want to communicate > with. > > But what then? Where are the (e.g.) `process-send-string' or > `process-send-region' functions for external processes I could use to > communicate with my external program? > > I could run a server in the external lisp program and use a > network-connection-object to send http-requests (e.g. with the help of > emacs-request.el) via TCP - but that seems to be total overkill for my > requirements. > > I just want to use a running external process with a given PID in a > similar way I would use (a)synchronous processes created from Emacs with > `call-process' or `start-process'. How can I do that? > > Maybe there is an obvious answer to this question that I don't see. Since Emacs did not start the external process, it does not have access to its standard input stream -- unless your OS provides a way to do that (e.g. via a special /dev file). How would you communicate with the external process, from any other program? -- Kevin Rodgers Denver, Colorado, USA