diff options
Diffstat (limited to 'lisp/org/org-crypt.el')
-rw-r--r-- | lisp/org/org-crypt.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index 41813cb184b..0d2ce593d78 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/org-crypt.el @@ -55,6 +55,9 @@ ;;; Code: (require 'org-macs) +(org-assert-version) + +(require 'org-macs) (require 'org-compat) (declare-function epg-decrypt-string "epg" (context cipher)) @@ -73,7 +76,7 @@ (declare-function org-end-of-meta-data "org" (&optional full)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) -(declare-function org-flag-subtree "org" (flag)) +(declare-function org-fold-subtree "org-fold" (flag)) (declare-function org-make-tags-matcher "org" (match)) (declare-function org-previous-visible-heading "org" (arg)) (declare-function org-scan-tags "org" (action matcher todo-only &optional start-level)) @@ -196,8 +199,9 @@ See `org-crypt-disable-auto-save'." Assume `epg-context' is set." (and org-crypt-key (or (epg-list-keys epg-context - (or (org-entry-get nil "CRYPTKEY" 'selective) - org-crypt-key)) + (pcase (org-entry-get nil "CRYPTKEY" 'selective 'literal-nil) + ("nil" "") + (key (or key org-crypt-key "")))) (bound-and-true-p epa-file-encrypt-to) (progn (message "No crypt key set, using symmetric encryption.") @@ -243,7 +247,7 @@ Assume `epg-context' is set." (error (error-message-string err))))) (when folded-heading (goto-char folded-heading) - (org-flag-subtree t)) + (org-fold-subtree t)) nil))))) ;;;###autoload @@ -280,7 +284,7 @@ Assume `epg-context' is set." 'org-crypt-text encrypted-text)) (when folded-heading (goto-char folded-heading) - (org-flag-subtree t)) + (org-fold-subtree t)) nil))) (_ nil))) @@ -313,7 +317,7 @@ Assume `epg-context' is set." 'org-mode-hook (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t)))) -(add-hook 'org-reveal-start-hook 'org-decrypt-entry) +(add-hook 'org-fold-reveal-start-hook 'org-decrypt-entry) (provide 'org-crypt) |