:type 'boolean
:group 'epa)
-(defcustom epa-popup-info-window t
+(defcustom epa-popup-info-window nil
"If non-nil, status information from epa commands is displayed on
the separate window."
:type 'boolean
(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)))
(define-key keymap "q" 'epa-exit-buffer)
keymap))
+(defvar epa-key-mode-map
+ (let ((keymap (make-sparse-keymap)))
+ (define-key keymap "q" 'bury-buffer)
+ keymap))
+
+(defvar epa-info-mode-map
+ (let ((keymap (make-sparse-keymap)))
+ (define-key keymap "q" 'delete-window)
+ keymap))
+
(defvar epa-exit-buffer-function #'bury-buffer)
(define-widget 'epa-key 'push-button
(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 buffer)
- (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))
- (with-output-to-temp-buffer "*Info*"
- (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)
(make-local-variable 'epa-exit-buffer-function)
(run-hooks 'epa-keys-mode-hook))
-(defvar epa-key-mode-map
- (let ((keymap (make-sparse-keymap)))
- (define-key keymap "q" 'bury-buffer)
- keymap))
-
(defun epa-key-mode ()
"Major mode for `epa-show-key'."
(kill-all-local-variables)
(interactive)
(funcall epa-exit-buffer-function))
+(defun epa-display-verify-result (verify-result)
+ (if epa-popup-info-window
+ (progn
+ (unless epa-info-buffer
+ (setq epa-info-buffer (generate-new-buffer "*Info*")))
+ (save-excursion
+ (set-buffer epa-info-buffer)
+ (let ((inhibit-read-only t)
+ buffer-read-only)
+ (erase-buffer)
+ (insert (epg-verify-result-to-string verify-result)))
+ (epa-info-mode))
+ (pop-to-buffer epa-info-buffer)
+ (if (> (window-height) epa-info-window-height)
+ (shrink-window (- (window-height) epa-info-window-height)))
+ (goto-char (point-min)))
+ (message "%s" (epg-verify-result-to-string verify-result))))
+
+(defun epa-info-mode ()
+ "Major mode for `epa-info-buffer'."
+ (kill-all-local-variables)
+ (buffer-disable-undo)
+ (setq major-mode 'epa-info-mode
+ mode-name "Info"
+ truncate-lines t
+ buffer-read-only t)
+ (use-local-map epa-info-mode-map)
+ (run-hooks 'epa-info-mode-hook))
+
;;;###autoload
(defun epa-decrypt-file (file)
"Decrypt FILE."