浏览代码

org-crypt-key-for-heading: Handle CRYPTKEY nil value

* lisp/org-crypt.el (org-crypt-key-for-heading): Do not fallback to
`org-crypt-key' when heading explicitly sets CRYPTKEY property.

Reported-by: Ignacio Casso <ignaciocasso@hotmail.com>
Link: https://orgmode.org/list/PAXPR06MB7760DA356C7C27045BEB64F6C6449@PAXPR06MB7760.eurprd06.prod.outlook.com
Ihor Radchenko 2 年之前
父节点
当前提交
d331f52cac
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lisp/org-crypt.el

+ 3 - 2
lisp/org-crypt.el

@@ -199,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.")