From 26d5163ba0c3022a4f1c2fb0b714e5cbc577e8f8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 16 Feb 2022 02:13:35 +0100 Subject: [PATCH] fix(default): no usable configuration epg-error Introduced in dcae28c83ad4, because ignore-errors was being used for the wrong epg-* function. Why this happens: epg-make-context throws this error if you don't have a GnuPG environment set up. Fix: #6114 Amend: dcae28c83ad4 --- modules/config/default/config.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 1b7caff5a..4f6997131 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -40,13 +40,13 @@ epa-file-encrypt-to (or (default-value 'epa-file-encrypt-to) (unless (string-empty-p user-full-name) - (cl-loop with context = (epg-make-context) - for key in (ignore-errors (epg-list-keys context user-full-name 'public)) - for subkey = (car (epg-key-sub-key-list key)) - if (not (memq 'disabled (epg-sub-key-capability subkey))) - if (< (or (epg-sub-key-expiration-time subkey) 0) - (time-to-seconds)) - collect (epg-sub-key-fingerprint subkey))) + (when-let (context (ignore-errors (epg-make-context))) + (cl-loop for key in (epg-list-keys context user-full-name 'public) + for subkey = (car (epg-key-sub-key-list key)) + if (not (memq 'disabled (epg-sub-key-capability subkey))) + if (< (or (epg-sub-key-expiration-time subkey) 0) + (time-to-seconds)) + collect (epg-sub-key-fingerprint subkey)))) user-mail-address)) ;; And suppress prompts if epa-file-encrypt-to has a default value (without ;; overwriting file-local values).