Skip to content

Commit

Permalink
fix(default): no usable configuration epg-error
Browse files Browse the repository at this point in the history
Introduced in dcae28c, 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: dcae28c
  • Loading branch information
hlissner committed Feb 16, 2022
1 parent fc86810 commit 26d5163
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/config/default/config.el
Expand Up @@ -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).
Expand Down

0 comments on commit 26d5163

Please sign in to comment.