:type 'boolean
:group 'epa)
+(defcustom epa-popup-info-window t
+ "If non-nil, status information from epa commands is displayed on
+the separate window."
+ :type 'boolean
+ :group 'epa)
+
+(defcustom epa-info-window-height 5
+ "Number of lines used to display status information."
+ :type 'integer
+ :group 'epa)
+
(defgroup epa-faces nil
"Faces for epa-mode."
:group 'epa)
(defvar epa-key-buffer-alist nil)
(defvar epa-key nil)
(defvar epa-list-keys-arguments nil)
+(defvar epa-info-buffer nil)
(defvar epa-keys-mode-map
(let ((keymap (make-sparse-keymap)))
(epg-sub-key-id (car (epg-key-sub-key-list
(widget-get widget :value))))))
+(defun epa--temp-buffer-show-function (buffer)
+ (save-selected-window
+ (let ((window (or (get-buffer-window epa-buffer-name)
+ (progn
+ (select-window (get-largest-window))
+ (split-window-vertically)))))
+ (set-window-buffer window buffer)
+ (if window
+ (select-window window))
+ (unless (pos-visible-in-window-p (point-max))
+ (enlarge-window (- epa-info-window-height (window-height))))
+ (let ((height (window-height)))
+ (if (> height epa-info-window-height)
+ (shrink-window (- height epa-info-window-height)))
+ (set-window-start window (point-min))))))
+
+(defun epa-display-verify-result (verify-result)
+ (if epa-popup-info-window
+ (let ((temp-buffer-show-function #'epa--temp-buffer-show-function))
+ (unless epa-info-buffer
+ (setq epa-info-buffer (generate-new-buffer "*Info*"))
+ (with-current-buffer epa-info-buffer
+ (setq buffer-read-only t)))
+ (with-output-to-temp-buffer epa-info-buffer
+ (save-excursion
+ (set-buffer standard-output)
+ (insert (epg-verify-result-to-string verify-result)))))
+ (message "%s" (epg-verify-result-to-string verify-result))))
+
(defun epa-keys-mode ()
"Major mode for `epa-list-keys'."
(kill-all-local-variables)
(epg-decrypt-file context file plain)
(message "Decrypting %s...done" (file-name-nondirectory file))
(if (epg-context-result-for context 'verify)
- (message "%s"
- (epg-verify-result-to-string
- (epg-context-result-for context 'verify))))))
+ (epa-display-verify-result (epg-context-result-for context 'verify)))))
;;;###autoload
(defun epa-verify-file (file)
(message "Verifying %s..." (file-name-nondirectory file))
(epg-verify-file context file plain)
(message "Verifying %s...done" (file-name-nondirectory file))
- (message "%s"
- (epg-verify-result-to-string
- (epg-context-result-for context 'verify)))))
+ (if (epg-context-result-for context 'verify)
+ (epa-display-verify-result (epg-context-result-for context 'verify)))))
;;;###autoload
(defun epa-sign-file (file signers mode)
(goto-char start)
(insert (decode-coding-string plain coding-system-for-read))
(if (epg-context-result-for context 'verify)
- (message "%s"
- (epg-verify-result-to-string
- (epg-context-result-for context 'verify)))))))
+ (epa-display-verify-result (epg-context-result-for context 'verify))))))
;;;###autoload
(defun epa-decrypt-armor-in-region (start end)
(encode-coding-string
(buffer-substring start end)
coding-system-for-write))
- (message "%s"
- (epg-verify-result-to-string
- (epg-context-result-for context 'verify)))))
+ (if (epg-context-result-for context 'verify)
+ (epa-display-verify-result (epg-context-result-for context 'verify)))))
;;;###autoload
(defun epa-verify-armor-in-region (start end)