Dear all,

First of all, thanks for maintaining the awesome org-mode. My name is
Benoît Coste. I have recently forked
<https://github.com/wizmer/mobileorg-android> the Android version of
MobileOrg to take back the development and I am facing a problem when
syncing new files created from the mobile side.

I want people to be able to create new org files from the mobile side and
keep them synced with Emacs. If my understanding is correct this is
currently not possible because it is Emacs who is in charge of creating the
list of synced files through index.org and checksums.dat. One start of hack
I have been doing is to append the newly created file in these too files
via the mobile side.
*Eg: the user has created the file test.org <http://test.org/>. Then the
line "* [[file:test.org <http://test.org/>][test.org <http://test.org/>]]"
will be appended to index.org <http://index.org/> and "0  test.org
<http://test.org/>" to checksums.dat by the mobile app.*
The hack only half-works. It works for pulling but not push. Emacs get the
list of files to pull by scanning the index.org file so it will pull
(org-mobile-pull) the new file. However for pushing (org-mobile-push) Emacs
refers to its own internal variable org-agenda-files and won't push the new
version of the new file.
One simple solution I have been thinking about was that when Emacs performs
org-mobile-pull, if it sees files not belonging to org-agenda-files, it
would then prompt the user to add them to the list.

To be a bit more abstract I would say this is just a quick fix that would
patch only the surface of a bigger problem. Conceptually I find that the
real root of the problem is there are two lists keeping the same list of
synced files: org-agenda-files controls pushed files and index.org controls
pulled files. Moreover the variable org-agenda-files is unreachable from
the mobile side (it is normally stored in Emacs init.el). To my taste, it
seems that org-agenda-files is not necessary for MobileOrg and I think it
should not be used. The list of files to be synced should only be in the
staging area (Dropbox or whatever) and every application willing to sync
(Emacs included) should refer to it when doing the syncing. The only useful
usage of org-agenda-files I see would be in the case of an empty staging
area. Then Emacs could use org-agenda-file to initialize the list of synced
files.

These are just suggestions, I'd be glad to help if there is any changes to
be done in the lisp code (even if I am pretty noob at it!). Maybe I missed
something, maybe there is already a way to add files from the mobile side.
Please tell me your thoughts.

Cheers,
Benoît

Reply via email to