From 644dd2f05059401116caf6c6e3574a2ac763e667 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 4 Dec 2021 05:39:25 +0100 Subject: [PATCH] Make the error message in epa-display-error more helpful * lisp/epa.el (epa-display-error): Output a more helpful error message when reading a keyring file (bug#12923). --- lisp/epa.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/epa.el b/lisp/epa.el index e4b89e984d2..93c85bfd37c 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -607,7 +607,11 @@ If SECRET is non-nil, list secret keys instead of public keys." (_ "Error while executing \"%s\":\n\n")) (epg-context-program context)) "\n\n" - (epg-context-error-output context))) + (epg-context-error-output context) + (if (string-search "Unexpected error" + (epg-context-error-output context)) + "\n(File possibly not an encrypted file, but is perhaps a key ring file?)\n" + ""))) (epa-info-mode) (goto-char (point-min))) (display-buffer buffer))))) -- 2.39.2