org-crypt.el: add a hook to make sure entries are encrypted before auto-saving.

* org-crypt.el (auto-save-default): make sure entries are
encrypted before auto-saving.
This commit is contained in:
Bastien Guerry 2011-03-06 10:41:12 +01:00
parent 37ac289714
commit 7c56155933
1 changed files with 7 additions and 0 deletions

View File

@ -204,6 +204,13 @@ This setting can also be overridden in the CRYPTKEY property."
'org-mode-hook
(lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
;; When `auto-save-default' is non-nil, make sure entries are
;; encrypted before auto-saving
(when auto-save-default
(add-hook
'org-mode-hook
(lambda () (add-hook 'auto-save-hook 'org-encrypt-entries nil t))))
(add-hook 'org-reveal-start-hook 'org-decrypt-entry)
(provide 'org-crypt)