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:
parent
37ac289714
commit
7c56155933
|
@ -204,6 +204,13 @@ This setting can also be overridden in the CRYPTKEY property."
|
||||||
'org-mode-hook
|
'org-mode-hook
|
||||||
(lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
|
(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)
|
(add-hook 'org-reveal-start-hook 'org-decrypt-entry)
|
||||||
|
|
||||||
(provide 'org-crypt)
|
(provide 'org-crypt)
|
||||||
|
|
Loading…
Reference in New Issue