From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Rose Newsgroups: gmane.emacs.devel Subject: Re: Emacs RPC Date: Tue, 26 Apr 2011 14:13:07 +0200 Message-ID: <87r58pjjn0.fsf@gmx.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1303820061 17234 80.91.229.12 (26 Apr 2011 12:14:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2011 12:14:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 26 14:14:17 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEh9i-00072H-46 for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2011 14:14:14 +0200 Original-Received: from localhost ([::1]:38984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEh9h-0000Jr-DZ for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2011 08:14:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEh9c-0000Ja-Kt for emacs-devel@gnu.org; Tue, 26 Apr 2011 08:14:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEh9X-0001EU-UD for emacs-devel@gnu.org; Tue, 26 Apr 2011 08:14:08 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:49050) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QEh9X-0001EJ-Ee for emacs-devel@gnu.org; Tue, 26 Apr 2011 08:14:03 -0400 Original-Received: (qmail invoked by alias); 26 Apr 2011 12:13:59 -0000 Original-Received: from pD95DA2E9.dip0.t-ipconnect.de (EHLO beteigeuze.gmx.de) [217.93.162.233] by mail.gmx.net (mp002) with SMTP; 26 Apr 2011 14:13:59 +0200 X-Authenticated: #8529601 X-Provags-ID: V01U2FsdGVkX18HVqkP0rMHptxZJhdnpZ/Ek3M3lLoY1t+4Yphv4U ehEx9JToHA6drp In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sat, 23 Apr 2011 20:54:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138780 Archived-At: Lars Magne Ingebrigtsen writes: > I'm running a lot of Emacs-based servers here and there, and I > communicate with them via "emacsclient --eval". But it just occurred to > me that it would be much more elegant to have an `emacs-client-rpc' > function, so that I wouldn't have to parse the output from emacsclient > in a shell. > > I've peeked through the info files and I couldn't find anything. And it > looks like it would be a simple enough thing to add to server.el. > Anybody mind if I add a function like, er, > > (server-eval-at HOST COMMAND) > > to server.el? There is org-protocol (still uses emacsclient though). Don't know if that's sufficient for your use case. See: http://orgmode.org/manual/Protocols.html#Protocols http://orgmode.org/worg/org-contrib/org-protocol.html http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.html http://www.youtube.com/watch?v=h7Z2PiAcgh8 http://www.youtube.com/watch?v=G2xjwxEj-c8 A custom handler is a function you may call through emacsclient. It is triggered by an advice around `server-visit-files'. It's used widely already, but I'd be glad to rewrite it to not use emacsclient anymore. Sebastian -- Nachdem ich festgestellt hatte, dass ich Fehler machen kann, ist mir klar geworden, dass eine Ordnung ist in dem, was ich tue. (Ornette Coleman)