emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Loury <konubinix@gmail.com>
To: Xebar Saram <zeltakc@gmail.com>,
	"Jorge A. Alfaro-Murillo" <jorge.alfaro-murillo@yale.edu>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: Some thoughts on MobileOrg and its development ....
Date: Wed, 10 Sep 2014 21:39:14 +0200	[thread overview]
Message-ID: <87iokv4659.fsf@gmail.com> (raw)
In-Reply-To: <87bnri9sbq.fsf@konixwork.incubateur.ens-lyon.fr>

[-- Attachment #1: Type: text/plain, Size: 3376 bytes --]

Samuel Loury <konubinix@gmail.com> writes:

> I have been using the XML-RPC trac plugin³ for a while now and I made 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¹. 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:
--8<---------------cut here---------------start------------->8---
pip install epc
--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²,
ctable³ and epc⁴. 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:
--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
   )
  )
--8<---------------cut here---------------end--------------->8---

The client code (in python) looks like:
--8<---------------cut here---------------start------------->8---
From epc.client import EPCClient
client = EPCClient(("localhost", 9998), log_traceback=True)
print str(client.methods_sync())
print str(client.call_sync('org-agenda-files', []))
client.close()
--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⁵ 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⁶ 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.

¹ http://python-epc.readthedocs.org/en/latest/
² https://github.com/kiwanami/emacs-deferred.git
³ https://github.com/kiwanami/emacs-ctable.githttps://github.com/kiwanami/emacs-epc.githttp://article.gmane.org/gmane.emacs.orgmode/77698https://code.google.com/p/android-scripting/
--
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

      reply	other threads:[~2014-09-10 19:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09  0:56 Some thoughts on MobileOrg and its development Alexis
2014-08-09  4:13 ` Xebar Saram
2014-08-09  4:22 ` David Masterson
2014-08-13  1:07   ` Ashton Kemerling
2014-08-13  1:47     ` David Wagle
2014-08-13  2:23       ` Ashton Kemerling
2014-08-13  2:45         ` Alexis
2014-08-13  4:04           ` Ashton Kemerling
2014-08-13  8:10           ` Jacek Generowicz
2014-08-13 22:23             ` Carlos Sosa
2014-08-14  0:54               ` Alexis
2014-08-13  2:59       ` Alexis
2014-08-09  7:53 ` Jacek Generowicz
2014-08-14  1:47   ` Sean Escriva
2014-08-14  2:10     ` Ashton Kemerling
2014-08-14 10:17     ` Jacek Generowicz
2014-08-14 12:17       ` Henning Weiss
2014-08-14 13:07         ` Eric Abrahamsen
2014-08-14 13:36           ` Jorge A. Alfaro-Murillo
2014-08-14 15:29             ` Xebar Saram
2014-08-18  7:20               ` Samuel Loury
2014-09-10 19:39                 ` Samuel Loury [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iokv4659.fsf@gmail.com \
    --to=konubinix@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jorge.alfaro-murillo@yale.edu \
    --cc=zeltakc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).