From e9bbc5f2af35c9c303a20adfa3c805eb13db767f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 23 Aug 2023 23:18:05 +0300 Subject: fix(tazjin/emacs): suppress incredibly ennoying EPA error buffer When entering an incorrect GPG key password, I don't want my whole buffer layout ruined. A small error message in the modeline is enough. Change-Id: I7318d685e74fa4e110a9bff30d0de9f7f18b2be4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9149 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/emacs/config/functions.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el index 4ac4580176..08c4179ba2 100644 --- a/users/tazjin/emacs/config/functions.el +++ b/users/tazjin/emacs/config/functions.el @@ -114,7 +114,9 @@ the GPG agent correctly." nil ;; predicate t ;; require-match )) - (password (auth-source-pass-get 'secret entry))) + (password (or (let ((epa-suppress-error-buffer t)) + (auth-source-pass-get 'secret entry)) + (error "failed to decrypt '%s', wrong password?" entry)))) (password-store-clear) (kill-new password) (setq password-store-kill-ring-pointer kill-ring-yank-pointer) -- cgit 1.4.1