From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jorge Subject: Re: Auto org-mobile-push kills buffer Date: Sat, 29 Aug 2015 11:35:50 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVhEX-0000JR-5S for Emacs-orgmode@gnu.org; Sat, 29 Aug 2015 10:35:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVhEW-0001eu-77 for Emacs-orgmode@gnu.org; Sat, 29 Aug 2015 10:35:53 -0400 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:37924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVhEW-0001eZ-2J for Emacs-orgmode@gnu.org; Sat, 29 Aug 2015 10:35:52 -0400 Received: by igbuu8 with SMTP id uu8so5566468igb.1 for ; Sat, 29 Aug 2015 07:35:51 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: Emacs-orgmode@gnu.org This has happened two more times. On Wed, Aug 26, 2015 at 11:43 AM, Jorge 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)))