Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs org-mobile-pull error #285

Closed
alitoiu opened this issue Feb 13, 2022 · 1 comment
Closed

Emacs org-mobile-pull error #285

alitoiu opened this issue Feb 13, 2022 · 1 comment

Comments

@alitoiu
Copy link

alitoiu commented Feb 13, 2022

Hi, I'm trying to sync .org files on Mac and iPhone through MobileOrg. Things working file until running the org-mobile-pull command to try to pull the files that were sent from iPhone to my staging folder (defined in org-mobile-directory) back into the original file (named 220212.org).

I M-x org-mobile-pull, and get the following error: Wrong type argument: stringp, nil

Contents of mobileorg.org (file that contains the updates that were performed on the phone) prior to running org-mobile-pull:

 * F(edit:todo) [[olp:220212.org:s/stretch neck right][stretch neck right]]
 ** Old value
 TODO
 ** New value
 DONE
 ** End of edit

After running org-mobile-pull and seeing the error: empty

I'm new to debugging lisp code or emacs, but I tried setting to true "debug-on-error" and "debug-on-entry" for org-mobile-pull in emacs. Having a bit of trouble figuring out exactly where in the function that is but it seems to be in the first few commands. Might try to master the debugger and debug further.

My .init.el contains org-directory, org-mobile-inbox-for-pull, org-mobile-directory,
org-mobile-files, org-mobile-force-id-on-agenda-items all set, in my opinion, appropriately.

Does anybody know what is causing this? As a result of this error, the changes in mobileorg.org are not synced back into the original 220212.org file.

Edit: formatting
Edit2: I should note that org-mobile-push seems to successfully populate the staging folder. I can then sync those files to the app. From the app, I can then sync the files back into the staging folder. Issue only occurs with the org-mobile-pull command from emacs. If this is more an issues tracker for the iPhone app side of things (which seems to be working), then where can I ask this more emacs-related question?

@alitoiu
Copy link
Author

alitoiu commented Feb 14, 2022

Seem to have figured out the problem. Since I'm new to the org-mobile API, I didn't (and probably still don't) fully get what's happening. Fundamentally, I confused the inbox file with the mobileorg.org file. Originally, I pointed the org-mobile-inbox-for-pull to mobileorg.org which seems to have led to an error. I then realized that org-mobile.el already knows how to find mobileorg.org inside the org-mobile-directory, and that the inbox file was a separate concept, ostensibly to save "captured notes" into. Could have read the instructions on the MobileOrg website and the emacs org-mobile page a bit more carefully.

That said, in my defense, there are lots of new concepts, some of which to me, at first glance, seem a bit counter-intuitive like:

  • why the API is called org-mobile and the app MobileOrg (as in, why is the order switched). Are they both official?
  • why is mobileorg.org named the same as the app, but different from the API, even though it's a de facto API diff file? I didn't expect that - that said... it is in the docs.
  • what are "captured notes?" I guess it just means notes... the word "captured" threw me off a little
  • had to spend some time wrapping my head around the staging folder. Originally expected a more seamless situation with fewer commands. Instead of an org-mobile-push, to sync button on app, to changing content on app, to sync button on app, to org-mobile-pull, I was expecting something more automatic. That said, I now like the control and security that this offers.

Anyway, specifically, changed ~/.emacs.d/init.el from

(setq org-directory "[redacted]/repo/typed/")
(setq org-mobile-inbox-for-pull "[redacted]/repo/typed/mobile/mobileorg.org")
(setq org-mobile-directory "[redacted]/repo/typed/mobile")
(setq org-mobile-files (quote ("[redacted]/repo/typed/220212.org")))

to

(setq org-directory "[redacted]/repo/typed/")
(setq org-mobile-inbox-for-pull "[redacted]/repo/typed/inbox-for-pull.org")
(setq org-mobile-directory "[redacted]/repo/typed/mobile")
(setq org-mobile-files (quote ("[redacted]/repo/typed/220212.org")))

Seems to work well with a bit of testing. Still experimenting to see if I want to use MobileOrg extensively, but I am quite optimistic I'll get some use from it. Thanks.

edit: typo

@alitoiu alitoiu closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant