From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Dowe Subject: Re: org-mobile-pull not syncing back changes Date: Wed, 30 Apr 2014 10:30:51 +0100 Message-ID: References: <87oazkuxbx.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1e9fc8ab68504f83f35ec Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfQrE-000266-4P for emacs-orgmode@gnu.org; Wed, 30 Apr 2014 05:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfQrB-0007z2-2G for emacs-orgmode@gnu.org; Wed, 30 Apr 2014 05:31:16 -0400 Received: from mail-ob0-x235.google.com ([2607:f8b0:4003:c01::235]:58474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfQrA-0007yu-RI for emacs-orgmode@gnu.org; Wed, 30 Apr 2014 05:31:12 -0400 Received: by mail-ob0-f181.google.com with SMTP id gq1so1619471obb.26 for ; Wed, 30 Apr 2014 02:31:11 -0700 (PDT) In-Reply-To: <87oazkuxbx.fsf@bzg.ath.cx> 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 --001a11c1e9fc8ab68504f83f35ec Content-Type: text/plain; charset=ISO-8859-1 On 29 April 2014 13:36, Bastien wrote: > If you haven't already, perhaps you can fill an issue here: > https://github.com/MobileOrg/mobileorg/issues > Hi Bastien, Thanks for the suggestion. I've been digging around and found it was actually some code in my .emacs file causing this not to work (although it used to previously). The code was to automatically push/pull orgmode updates. I have since commented out the section that seemed to conflict, although I'm not sure why at the moment. As you'll see, I haz copy and paste... :-) I'm no elisp guru, although now that I have a little problem, it's good motivation to learn. ;; automatic org-mobile-push --------------------------------- ;; add hooks for org-mobile-push/pull ;; from: http://stackoverflow.com/questions/8432108/how-to-automatically-do-org-mobile-push-org-mobile-pull-in-emacs (add-hook 'after-init-hook 'org-mobile-pull) ;; but don't necessarily re-enable this, unless desired (last setting was: disabled) (add-hook 'kill-emacs-hook 'org-mobile-push) ;;; --- this section stopped org-mobile-pull picking up index.org changes and ;;; --- also stopped mobileorg.org from being emptied after items copied from it ;; in case I'm "idle" :) ;(defvar my-org-mobile-sync-timer nil) ;(defvar my-org-mobile-sync-secs (* 60 20)) ;(defun my-org-mobile-sync-pull-and-push () ; (org-mobile-pull) ; (org-mobile-push) ; (when (fboundp 'sauron-add-event) ; (sauron-add-event 'my 3 "Called org-mobile-pull and org-mobile-push"))) ;(defun my-org-mobile-sync-start () ; "Start automated `org-mobile-push'" ; (interactive) ; (setq my-org-mobile-sync-timer ; (run-with-idle-timer my-org-mobile-sync-secs t ; 'my-org-mobile-sync-pull-and-push))) ;(defun my-org-mobile-sync-stop () ; "Stop automated `org-mobile-push'" ; (interactive) ; (cancel-timer my-org-mobile-sync-timer)) ;; (my-org-mobile-sync-start) ; ;; add after saving an org file ; (add-hook ; 'org-mode-hook ; (lambda nil ; (add-hook 'after-save-hook ; (lambda nil (org-mobile-push)) ; nil 'local))) ;Only in the current buffer ;;; --- end troublesome section --- ;; end automatic org-mobile-push --------------------------------- Best wishes, -- Steve --001a11c1e9fc8ab68504f83f35ec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= On 29 April 2014 13:36, Bastien <bzg@gnu.org> wrote:
If you haven't al= ready, perhaps you can fill an issue here:
=A0 https://github.com/MobileOrg/mobileorg/issues

Hi Bastien,

Thanks for the suggestion.

I've been digging around and found it was actually= some code in my .emacs file causing this not to work (although it used to = previously).

The code wa= s to automatically push/pull orgmode updates. I have since commented out th= e section that seemed to conflict, although I'm not sure why at the mom= ent.

As you'= ll see, I haz copy and paste... :-) =A0I'm no elisp guru, although now = that I have a little problem, it's good motivation to learn.

;; automati= c org-mobile-push ---------------------------------

;; add hooks for org-mobile-p= ush/pull

(add-hook &= #39;after-init-hook 'org-mobile-pull)
<= br>
;; but don't necessarily re-enable = this, unless desired (last setting was: disabled)
(add-hook 'kill-emacs-hook 'org-mobile-p= ush)=A0

;;; --- this section stopped org-mobile-pull picking up index.org changes and=A0
;;; --- also stopped mobileorg.org from being emptied after items copied from it
=
;; in case I'm "idle" :)
=
;(defvar my-org-mobile-sync-timer nil)
;(de= fvar my-org-mobile-sync-secs (* 60 20))
;(defun my-org-mobile-sync-pull-and-push = ()
; =A0(org-mobile-pull)
; =A0(org-mobile-push)
; =A0(when (f= boundp 'sauron-add-event)
; =A0 =A0(sau= ron-add-event 'my 3 "Called org-mobile-pull and org-mobile-push&qu= ot;)))

;(defun my-= org-mobile-sync-start ()
; =A0"Start a= utomated `org-mobile-push'"
; =A0(= interactive)
; =A0(setq my-org-mobile-sync-timer
; =A0 =A0 =A0 =A0(run-with-idle-timer my-org-mobile-syn= c-secs t
; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 'my-org-mobile-sync-pull-and-push)))

;(defun my-= org-mobile-sync-stop ()
; =A0"Stop aut= omated `org-mobile-push'"
; =A0(in= teractive)
; =A0(cancel-timer my-org-mobile-sync-timer))

;; (my-o= rg-mobile-sync-start)

; ;; add after saving an org file
; (add-ho= ok
; =A0'org-mode-hook
; =A0(lambda nil
; =A0 =A0= (add-hook 'after-save-hook
; =A0 =A0 =A0 =A0 =A0 =A0 =A0(lambda nil (org-mo= bile-push))
; =A0 =A0 =A0 =A0 =A0 =A0 =A0ni= l 'local))) ;Only in the current buffer=A0

;;; --- end troublesome section ---
;; end automatic org-mobile-push --------= -------------------------

Best wishes,
-- =
=A0 Steve
--001a11c1e9fc8ab68504f83f35ec--