From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jorge Subject: Auto org-mobile-push kills buffer Date: Wed, 26 Aug 2015 11:43:33 -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]:35825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUbvL-0005SH-6m for Emacs-orgmode@gnu.org; Wed, 26 Aug 2015 10:43:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUbvK-0007Pd-7j for Emacs-orgmode@gnu.org; Wed, 26 Aug 2015 10:43:35 -0400 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:33417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUbvK-0007PG-3H for Emacs-orgmode@gnu.org; Wed, 26 Aug 2015 10:43:34 -0400 Received: by iods203 with SMTP id s203so21176802iod.0 for ; Wed, 26 Aug 2015 07:43:33 -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 To: Emacs-orgmode@gnu.org 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)))