Browse Source

Fix some bugs in MobileOrg support

Carsten Dominik 15 years ago
parent
commit
5deffac8f6
4 changed files with 21 additions and 4 deletions
  1. 4 0
      doc/ChangeLog
  2. 1 1
      doc/org.texi
  3. 5 0
      lisp/ChangeLog
  4. 11 3
      lisp/org-mobile.el

+ 4 - 0
doc/ChangeLog

@@ -1,3 +1,7 @@
+2009-09-17  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.texi (Setting up the staging area): Fix the example.
+
 2009-09-15  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.texi (MobileOrg): New section.

+ 1 - 1
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/")))

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2009-09-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* 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

+ 11 - 3
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'.