Quellcode durchsuchen

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 vor 2 Jahren
Ursprung
Commit
d331f52cac
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  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.")