From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Look for data serialisation format to implement communication between Emacs and external program. Date: Tue, 08 Jan 2013 10:44:54 +0100 Message-ID: <874nisuhyh.fsf@zigzag.favinet> References: <87ehhyc7g1.fsf@gavenkoa.example.com> <87k3rqudz6.fsf@zigzag.favinet> <871udxt8u2.fsf@gavenkoa.example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1357638231 15782 80.91.229.3 (8 Jan 2013 09:43:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Jan 2013 09:43:51 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Oleksandr Gavenko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 08 10:44:08 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 1TsVj3-0004uo-Fc for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Jan 2013 10:44:05 +0100 Original-Received: from localhost ([::1]:58695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsVin-0005Yn-V2 for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Jan 2013 04:43:49 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsVih-0005YU-Qi for help-gnu-emacs@gnu.org; Tue, 08 Jan 2013 04:43:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsVig-0007Km-W6 for help-gnu-emacs@gnu.org; Tue, 08 Jan 2013 04:43:43 -0500 Original-Received: from smtp209.alice.it ([82.57.200.105]:53563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsVig-0007KX-Lp for help-gnu-emacs@gnu.org; Tue, 08 Jan 2013 04:43:42 -0500 Original-Received: from zigzag.favinet (79.51.73.7) by smtp209.alice.it (8.6.058.01) id 50DE278001753535; Tue, 8 Jan 2013 10:43:32 +0100 Original-Received: from ttn by zigzag.favinet with local (Exim 4.72) (envelope-from ) id 1TsVjz-0004YU-8y; Tue, 08 Jan 2013 10:45:03 +0100 In-Reply-To: <871udxt8u2.fsf@gavenkoa.example.com> (Oleksandr Gavenko's message of "Mon, 07 Jan 2013 15:35:01 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.105 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:88518 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () Oleksandr Gavenko () Mon, 07 Jan 2013 15:35:01 +0200 But as input come from external process I need manually check for input end because parsing of incomplete input take error "args-out-of-range". I don't know how to resolve this issue. Also I don't see have can I split data into packets with "bindat" (Emacs send request and Python send response in a loop without dropping connection while returned data is valid). As solution - make 10 attempt with 1 sec delay and then report error - incomplete or invalid packet... See =E2=80=98accept-process-output=E2=80=99: (info "(elisp) Accepting Outpu= t") and =E2=80=98condition-case=E2=80=99: (info "(elisp) Handling Errors") I expect to find a way to get data validation for free (like XSD/RNC for XML). It depends on what you mean by "valid data" and "for free", i suppose. =2D-=20 Thien-Thi Nguyen ..................................... GPG key: 4C807502 . NB: ttn at glug dot org is not me . . (and has not been since 2007 or so) . . ACCEPT NO SUBSTITUTES . ........... please send technical questions to mailing lists ........... --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAlDr6pkACgkQZwMiJEyAdQLmOQCg4DDU0YxfhGCMJ6piGb7xGpHO 6EYAoJCu5mi+Q4eReYGUVsVY3SXu4h1d =iFNX -----END PGP SIGNATURE----- --=-=-=--