EDIT: Now I can see the error only happens if I include certain code to do an automatic push, adopted from https://gist.github.com/3111823. It seems that this block of code wants to use org-mobile-files-alist while it hasn't been initialized, because 'org
is set to have an async loading by default. No matter whether I put the code in init
or config
when I require 'org
, it doesn't seem to recognize the variable. Another person seems to be encountering the same error, using the auto-push code below, as seen on github.
Unfortunately if I put the code after (package-initialize)
it doesn't seem to run at all(i.e. no automatic push no matter what).
The code to do automatic push:
;; https://gist.github.com/3111823 ASYNC org mobile push...
(require 'gnus-async)
;; Define a timer variable
(defvar org-mobile-push-timer nil
"Timer that `org-mobile-push-timer' used to reschedule itself, or nil.")
;; Push to mobile when the idle timer runs out
(defun org-mobile-push-with-delay (secs)
(when org-mobile-push-timer
(cancel-timer org-mobile-push-timer))
(setq org-mobile-push-timer
(run-with-idle-timer
(* 1 secs) nil 'org-mobile-push)))
;; After saving files, start an idle timer after which we are going to push
(add-hook 'after-save-hook
(lambda ()
(if (or (eq major-mode 'org-mode) (eq major-mode 'org-agenda-mode))
(dolist (file (org-mobile-files-alist))
(if (string= (expand-file-name (car file)) (buffer-file-name))
(org-mobile-push-with-delay 25)))
)))
The code to initialize org mode asynchronously:
(require 'package)
(setq package-enable-at-startup nil)
(package-initialize)
(require 'org)
(require 'ox)
(require 'ox-beamer)
(require 'ox-latex)
(setq org-export-async-debug nil)
I'm new to Emacs and I'm actually using a starter kit called spacemacs
. So I'm not sure how to fix this problem even after two hours' of trying...
I'm seeing the error Symbol's function definition is void: org-mobile-files-alist
when performing certain operations. Strangely, the error doesn't occur again after I execute org-mobile-push
or org-mobile-pull
at least once. The nuisance is that it doesn't seem to only influence org mobile
itself, but also interferes with other functionalities such as archiving. Now whenever I run C-c C-x C-a
I'll get this error and the entry will not be removed from its original .org
file, although it indeed does get archived into the .org_archive
file. Thus if I try to archive multiple times, the entry gets repeated in the .org_archive
file but it still remains in the original file. It seems that the process of removing the entry and then saving the file gets interrupted by this error.
An example:
Copied: Subtree(s) with 262 characters
Saving file /Users/JX/Dropbox/orgmode/Personal.org_archive...
Wrote /Users/JX/Dropbox/orgmode/Personal.org_archive
let: Symbol's function definition is void: org-mobile-files-alist
I already set my org-mobile-files
variable. However it seems that for some reasons it doesn't get picked up until I execute org-mobile-push
or org-mobile-pull
manually.
org-mobile-directory "/Users/JX/Dropbox/MobileOrg"
org-mobile-files (quote (org-agenda-files))