emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Auto org-mobile-push kills buffer


From: Jorge
Subject: [O] Auto org-mobile-push kills buffer
Date: Wed, 26 Aug 2015 11:43:33 -0300

Hi.  I use MobileOrg.  To automate org-mobile-push I have installed
the code below from
https://github.com/matburt/mobileorg-android/wiki/FAQ.  However, the
code sometimes does weird things, such as killing the current buffer
(happened twice).
Is this a known bug?  Also, in the last line, why is the lambda quoted?

;; https://github.com/matburt/mobileorg-android/wiki/FAQ
(defvar org-mobile-push-timer nil
  "Timer that `org-mobile-push-timer' used to reschedule itself, or nil.")

(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)))

(add-hook 'after-save-hook
 (lambda ()
   (when (eq major-mode 'org-mode)
     (dolist (file (org-mobile-files-alist))
      (if (string= (file-truename (expand-file-name (car file)))
  (file-truename (buffer-file-name)))
           (org-mobile-push-with-delay 30)))
     )))

;; refreshes agenda file each day
(run-at-time "00:05" 86400 '(lambda () (org-mobile-push-with-delay 1)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]