summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tag-emacs/emacs.d/init.org24
1 files changed, 10 insertions, 14 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 7bc91d7..eb432cf 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1630,7 +1630,7 @@ to have my =ledger= setup in an org file with some graph processing
 with R or something.
 
 #+BEGIN_SRC emacs-lisp
-(use-package org-babel
+(use-package ob-core
   :defer t
   :ensure nil
   :config (org-babel-do-load-languages
@@ -1686,19 +1686,15 @@ I can use this to keep a journal.  I should use it.
               (run-at-time "00:05" 86400 '(lambda () (org-mobile-push-with-delay 1))) ;; refreshes agenda file each day
               (org-mobile-pull) ;; run org-mobile-pull at startup
 
-              (defun install-monitor (file secs)
-                (run-with-timer
-                 0 secs
-                 (lambda (f p)
-                   (unless (< p (second (time-since (elt (file-attributes f) 5))))
-                     (org-mobile-pull)))
-                 file secs))
-
-              (install-monitor (file-truename
-                                (concat
-                                 (file-name-as-directory org-mobile-directory)
-                                 org-mobile-capture-file))
-                               5)))))
+              (defvar org-mobile-watcher nil)
+              (let ((org-file (expand-file-name
+                               (concat
+                                (file-name-as-directory org-mobile-directory)
+                                org-mobile-capture-file))))
+                (defun ap/org-mobile-pull ()
+                  (org-mobile-pull))
+                (setq org-mobile-watcher
+                      (file-notify-add-watch org-file '(change) #'ap/org-mobile-pull)))))))
 #+END_SRC
 
 * Programming