From 5deffac8f6f3e38df4e0e6fa50da05bbba52e16c Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 17 Sep 2009 13:46:25 +0100 Subject: [PATCH] Fix some bugs in MobileOrg support --- doc/ChangeLog | 4 ++++ doc/org.texi | 2 +- lisp/ChangeLog | 5 +++++ lisp/org-mobile.el | 14 +++++++++++--- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index ff1db9ff8..291f38f11 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-09-17 Carsten Dominik + + * org.texi (Setting up the staging area): Fix the example. + 2009-09-15 Carsten Dominik * org.texi (MobileOrg): New section. diff --git a/doc/org.texi b/doc/org.texi index f8d5cdc83..9edd9b8ba 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -11682,7 +11682,7 @@ staged in @file{~/stage}, and Org-mode hooks take care of moving files to and from the WebDAV directory using @file{scp}. @example -(setq org-mobile-directory "~/MobileOrg/stage/") +(setq org-mobile-directory "~/stage/") (add-hook 'org-mobile-post-push-hook (lambda () (shell-command "scp ~/stage/* user@@webdavhost:mobile/"))) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b73beee6d..289682cf9 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2009-09-17 Carsten Dominik + * org-mobile.el (org-mobile-create-index-file): Fix link to + capture file. + (org-mobile-copy-agenda-files): Create the capture file if it does + not exist. + * org-clock.el (org-clock-clocktable-default-properties): New option. (org-clock-report): Use diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index a625b55bc..365bc6b4b 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -184,16 +184,24 @@ agenda view showing the flagged items." (file-name-sans-extension (file-name-nondirectory file)))))) (insert (format "* [[file:%s][Captured before last sync]]\n" - (file-name-sans-extension org-mobile-capture-file)))))) + org-mobile-capture-file))))) (defun org-mobile-copy-agenda-files () "Copy all agenda files to the stage or WebDAV directory." - (let ((files (org-agenda-files t)) file) + (let ((files (org-agenda-files t)) file buf) (while (setq file (pop files)) (if (file-exists-p file) (copy-file file (expand-file-name (file-name-nondirectory file) org-mobile-directory) - 'ok-if-exists))))) + 'ok-if-exists))) + (setq file (expand-file-name org-mobile-capture-file + org-mobile-directory)) + (unless (file-exists-p file) + (save-excursion + (setq buf (find-file file)) + (insert "\n") + (save-buffer) + (kill-buffer buf))))) (defun org-mobile-write-checksums () "Create checksums for all files in `org-mobile-directory'. -- 2.11.4.GIT