diff options
author | Robert Pluim <rpluim@gmail.com> | 2019-11-17 21:21:48 +0100 |
---|---|---|
committer | Robert Pluim <rpluim@gmail.com> | 2019-11-25 16:00:09 +0100 |
commit | 2d12d4d2d467f5df81e232707ad9191264b7c2b0 (patch) | |
tree | cebd1af000cff9ef162f2d976f0bfd632471d2f0 /lisp/epa.el | |
parent | 5a3e96b17c2a948ac952295962dc6e281ec5cad5 (diff) | |
download | emacs-2d12d4d2d467f5df81e232707ad9191264b7c2b0.tar.gz emacs-2d12d4d2d467f5df81e232707ad9191264b7c2b0.tar.bz2 emacs-2d12d4d2d467f5df81e232707ad9191264b7c2b0.zip |
Handle auth-source-search failures in open-network-stream
If the user cancels the gpg decryption pop-up, auth-source-search
fails *and* epa pops up an error buffer. Fix epa to allow suppressing
that, and ignore errors returned from auth-source-search.
* lisp/epa.el (epa-suppress-error-buffer): New defvar. Bind non-nil
to stop epa popping up an error buffer.
* lisp/net/network-stream.el: require epa when byte-compiling.
(network-stream-certificate): ignore errors when calling
auth-source-search, and suppress the epa error buffer.
Diffstat (limited to 'lisp/epa.el')
-rw-r--r-- | lisp/epa.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/epa.el b/lisp/epa.el index a2be9a3dbd2..13708d046d6 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -179,6 +179,7 @@ You should bind this variable with `let', but do not set it globally.") (defvar epa-list-keys-arguments nil) (defvar epa-info-buffer nil) (defvar epa-error-buffer nil) +(defvar epa-suppress-error-buffer nil) (defvar epa-last-coding-system-specified nil) (defvar epa-key-list-mode-map @@ -578,7 +579,8 @@ If SECRET is non-nil, list secret keys instead of public keys." (message "%s" info))) (defun epa-display-error (context) - (unless (equal (epg-context-error-output context) "") + (unless (or (equal (epg-context-error-output context) "") + epa-suppress-error-buffer) (let ((buffer (get-buffer-create "*Error*"))) (save-selected-window (unless (and epa-error-buffer (buffer-live-p epa-error-buffer)) |