emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Auto org-mobile-push kills buffer
@ 2015-08-26 14:43 Jorge
  0 siblings, 0 replies; 2+ messages in thread
From: Jorge @ 2015-08-26 14:43 UTC (permalink / raw)
  To: Emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Auto org-mobile-push kills buffer
@ 2015-08-29 14:35 Jorge
  0 siblings, 0 replies; 2+ messages in thread
From: Jorge @ 2015-08-29 14:35 UTC (permalink / raw)
  Cc: Emacs-orgmode

This has happened two more times.

On Wed, Aug 26, 2015 at 11:43 AM, Jorge <jorge13515@gmail.com> wrote:
> 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)))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-29 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-29 14:35 Auto org-mobile-push kills buffer Jorge
  -- strict thread matches above, loose matches on Subject: below --
2015-08-26 14:43 Jorge

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