diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-08 09:27:43 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-08 09:27:43 +0200 |
commit | f1960677de1c6a1fbdf924019fcdebec6a728884 (patch) | |
tree | d7fcd9b375e19a9192da96491f7dd5d01dfac426 | |
parent | d9e4469c1c7be23c35398629f82bd2c34767742c (diff) | |
download | org-mode-f1960677de1c6a1fbdf924019fcdebec6a728884.tar.gz |
Fix some issues related to MobileOrg encryption
* lisp/org-mobile.el (org-mobile-copy-agenda-files): Encrypt the empty file.
(org-mobile-write-agenda-for-mobile): Use the right name, even if the
file get encrypted.
(org-mobile-move-capture): Only delete tempfile if it does exist.
-rw-r--r-- | lisp/org-mobile.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7cb7b9a..5b91ed4 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -476,7 +476,10 @@ agenda view showing the flagged items." (and (= (point-min) (point-max)) (insert "\n")) (save-buffer) (push (cons org-mobile-capture-file (md5 (buffer-string))) - org-mobile-checksum-files)) + org-mobile-checksum-files) + (when org-mobile-use-encryption + (write-file org-mobile-encryption-tempfile) + (org-mobile-encrypt-and-move org-mobile-encryption-tempfile file))) (kill-buffer buf))) (defun org-mobile-write-checksums () @@ -627,7 +630,7 @@ The table of checksums is written to the file mobile-checksums." (insert " :PROPERTIES:\n :ORIGINAL_ID: " id "\n :END:\n"))))) (beginning-of-line 2)) - (push (cons (file-name-nondirectory file) (md5 (buffer-string))) + (push (cons "agendas.org" (md5 (buffer-string))) org-mobile-checksum-files)) (message "Agenda written to Org file %s" file))) @@ -692,7 +695,8 @@ If nothing new has been added, return nil." (capture-buffer (if (not org-mobile-use-encryption) (find-file-noselect capture-file) - (delete-file org-mobile-encryption-tempfile) + (if (file-exists-p org-mobile-encryption-tempfile) + (delete-file org-mobile-encryption-tempfile)) (setq encfile (concat org-mobile-encryption-tempfile "_enc")) (copy-file capture-file encfile) (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile) |