Ver código fonte

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.
Bastien Guerry 14 anos atrás
pai
commit
7c56155933
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      lisp/org-crypt.el

+ 7 - 0
lisp/org-crypt.el

@@ -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)