From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: Re: Some thoughts on MobileOrg and its development .... Date: Wed, 10 Sep 2014 21:39:14 +0200 Message-ID: <87iokv4659.fsf@gmail.com> References: <87a97e1mp3.fsf@gmail.com> <87fvh6rte3.fsf@cern.ch> <8761hvs7ce.fsf@cern.ch> <87r40jqkx7.fsf@ericabrahamsen.net> <87bnrni467.fsf@yale.edu> <87bnri9sbq.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRnjk-0000MF-Ld for emacs-orgmode@gnu.org; Wed, 10 Sep 2014 15:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRnjf-0007cl-9k for emacs-orgmode@gnu.org; Wed, 10 Sep 2014 15:39:28 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:47291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRnje-0007Yv-TF for emacs-orgmode@gnu.org; Wed, 10 Sep 2014 15:39:23 -0400 Received: by mail-wi0-f172.google.com with SMTP id q5so3659969wiv.17 for ; Wed, 10 Sep 2014 12:39:21 -0700 (PDT) In-Reply-To: <87bnri9sbq.fsf@konixwork.incubateur.ens-lyon.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xebar Saram , "Jorge A. Alfaro-Murillo" Cc: org mode --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Samuel Loury writes: > I have been using the XML-RPC trac plugin=C2=B3 for a while now and I mad= e we > wonder if we could reproduce this in the scope of mobile org. With an > RPC interface, one would be free to create their own interface easily > (at least python xml-rpc library is really easy to manipulate) and an > official interface could emerge from that. I have made a some research on the net and found epc=C2=B9. This library appears to do exactly what I am looking for: a remote procedure call mechanism in emacs. For what I have tried so far, it looks very promising. To install the python side, just run: =2D-8<---------------cut here---------------start------------->8--- pip install epc =2D-8<---------------cut here---------------end--------------->8--- To install the emacs server part, it is a bit trickier since elpa ships only the client part. It was not so hard though. I installed deferred=C2= =B2, ctable=C2=B3 and epc=E2=81=B4. Then I could launch the emacs rpc server. For the time being, I only tried exporting the org agenda files. And it was really easy. The server code (in emacs) looks like: =2D-8<---------------cut here---------------start------------->8--- (require 'cl) (require 'epcs) (defvar pyepc-epcs (epcs:server-start (lambda (mngr) (lexical-let ((mngr mngr)) (epc:define-method mngr 'org-agenda-files 'org-agenda-files) ) ) 9998 ) ) =2D-8<---------------cut here---------------end--------------->8--- The client code (in python) looks like: =2D-8<---------------cut here---------------start------------->8--- From=20epc.client import EPCClient client =3D EPCClient(("localhost", 9998), log_traceback=3DTrue) print str(client.methods_sync()) print str(client.call_sync('org-agenda-files', [])) client.close() =2D-8<---------------cut here---------------end--------------->8--- In conclusion, the communication between emacs and python is very easy. The difficult part now, is to re-factorise the emacs org-mode code that creates the agenda so that it may provide a data structure representing the information. I have only had a quick look, but it does not look straight. I think it is not much work to get a workable emacs on android=E2=81=B5 and= I honestly don't know on iPhone. Once it is done, it would be hopefully easy to configure emacs to run the epcs code and use anything python based to communicate with it. I will probably use sl4a=E2=81=B6 since it is totally awesome. The aspect I like about the design I propose is that the core (emacs + epcs) is loosely coupled with the interface. This way, anyone would be free to provide their one. What do you think about this project. Do you think it could work? I think I will eventually start it anyway (just to see). Off course, since I am also a busy person, it would probably slow, but I honestly think it would be worth it. Anyone would like to contribute? Thanks for reading. =C2=B9 http://python-epc.readthedocs.org/en/latest/ =C2=B2 https://github.com/kiwanami/emacs-deferred.git =C2=B3 https://github.com/kiwanami/emacs-ctable.git =E2=81=B4 https://github.com/kiwanami/emacs-epc.git =E2=81=B5 http://article.gmane.org/gmane.emacs.orgmode/77698 =E2=81=B6 https://code.google.com/p/android-scripting/ =2D- Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUEKjjAAoJEHXSPO10ORBq9i8H+QEKlaf6loEYiwso3g0ybxVj xZBR4m0MiCjOzMVqwV7xqi22Kp6B+sC2LxK9XS7fBo+P9xEUg+xT0xCT84/SWUNR M7jCBIpAKgBIk4wkHWD+GYlrahSAyJp6uxRUjbEpiFHkOxqnuMuD65BY1iGW+COz fq8mD0/1MIBNM2QAyXnr5XV6aBZ72vUjwshDE2tw6/meXPCO5/GiGZ9gRyC/D42/ LIqWj9hJibGnS3mEfIlTGLZGAzycx3IGEHcBwWwinpqtU5ivUX24IydSadT0bRpm jKUHEEZ6pTOeTuvn9rBwgJGoKZ3QP06pcuH2fFbXqx29E60J7I4vW91y2XI2jRw= =c5qb -----END PGP SIGNATURE----- --=-=-=--