fix(default): no usable configuration epg-error

Introduced in dcae28c83a, 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: dcae28c83a
This commit is contained in:
Henrik Lissner 2022-02-16 02:13:35 +01:00
parent fc868105ce
commit 26d5163ba0
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

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