summaryrefslogtreecommitdiff
path: root/lisp/epa-file.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-11-05 18:38:37 +0900
committerDaiki Ueno <ueno@gnu.org>2014-11-05 18:38:37 +0900
commit5e28461482115baee4d1f28f514a322a50774b75 (patch)
treef8ad9ff505c42b017e960887578a27a3c0cdd462 /lisp/epa-file.el
parentb6e66a5cc78e353ff9ae6cdd0807eefcf55b4934 (diff)
downloademacs-5e28461482115baee4d1f28f514a322a50774b75.tar.gz
emacs-5e28461482115baee4d1f28f514a322a50774b75.tar.bz2
emacs-5e28461482115baee4d1f28f514a322a50774b75.zip
epg: Collect output lines sent to stderr
* epg.el (epg-context): Add new slot ERROR-OUTPUT. (epg-error-output): New buffer-local variable. (epg--start): Initialize epg-error-output. (epg--process-filter): Record output lines sent to stderr, in epg-error-output. (epg-wait-for-completion): Copy epg-error-output to ERROR-OUTPUT slot of context. * epa-file.el (epa-file-insert-file-contents): On error, display output sent to stderr. (epa-file-write-region): Likewise.
Diffstat (limited to 'lisp/epa-file.el')
-rw-r--r--lisp/epa-file.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index 20d34f82223..6f3bb188190 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -162,6 +162,11 @@ encryption is used."
(add-hook 'find-file-not-found-functions
'epa-file--find-file-not-found-function
nil t))
+ (if (epg-context-error-output context)
+ (epa-display-info
+ (concat (format "Error while executing \"%s\":\n\n"
+ epg-gpg-program)
+ (epg-context-error-output context))))
(signal 'file-error
(cons "Opening input file" (cdr error)))))
(set-buffer buf) ;In case timer/filter changed/killed it (bug#16029)!
@@ -257,6 +262,11 @@ If no one is selected, symmetric encryption will be performed. "
(error
(if (setq entry (assoc file epa-file-passphrase-alist))
(setcdr entry nil))
+ (if (epg-context-error-output context)
+ (epa-display-info
+ (concat (format "Error while executing \"%s\":\n\n"
+ epg-gpg-program)
+ (epg-context-error-output context))))
(signal 'file-error (cons "Opening output file" (cdr error)))))
(epa-file-run-real-handler
#'write-region