From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: How to communicate with a running external process with given PID? Date: Sat, 20 Jul 2013 11:06:55 +0200 Message-ID: <87fvv9ha6o.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374311241 21650 80.91.229.3 (20 Jul 2013 09:07:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 09:07:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 20 11:07:22 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 1V0T8K-0007td-1X for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 11:07:20 +0200 Original-Received: from localhost ([::1]:35962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0T8J-0000li-Ic for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 05:07:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0T89-0000lR-NO for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 05:07:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0T88-0001H7-S3 for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 05:07:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0T88-0001H3-L6 for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 05:07:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V0T87-0007pA-9j for help-gnu-emacs@gnu.org; Sat, 20 Jul 2013 11:07:07 +0200 Original-Received: from g231110206.adsl.alicedsl.de ([92.231.110.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Jul 2013 11:07:07 +0200 Original-Received: from tjolitz by g231110206.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 20 Jul 2013 11:07:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231110206.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:e8cJ+NbZ6yGyMW1BuElE041+GoY= 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:92267 Archived-At: Hi List, 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. Would be nice. -- cheers, Thorsten