emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Benoît Coste" <ben.coste@gmail.com>
To: emacs-orgmode@gnu.org
Subject: MobileOrg: creating new org file from the mobile side
Date: Fri, 13 May 2016 16:46:02 +0000	[thread overview]
Message-ID: <CANJrASxzRh0J6EaukP7=jLUofoD4DS3dJxEcdMSWrs9VB8G09A@mail.gmail.com> (raw)

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

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

[-- Attachment #2: Type: text/html, Size: 5334 bytes --]

                 reply	other threads:[~2016-05-13 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CANJrASxzRh0J6EaukP7=jLUofoD4DS3dJxEcdMSWrs9VB8G09A@mail.gmail.com' \
    --to=ben.coste@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).