(epa-popup-info-window): Turn on by default.
authorueno <ueno>
Sun, 12 Nov 2006 05:44:26 +0000 (05:44 +0000)
committerueno <ueno>
Sun, 12 Nov 2006 05:44:26 +0000 (05:44 +0000)
(epa-display-info): Split selected window instead of pop-to-buffer.

ChangeLog
epa.el

index c49221e..5cfcd28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-11-12  Daiki Ueno  <ueno@unixuser.org>
 
+       * epa.el (epa-popup-info-window): Turn on by default.
+       (epa-display-info): Split selected window instead of pop-to-buffer.
+
+2006-11-12  Daiki Ueno  <ueno@unixuser.org>
+
        * epa.el (epa-display-info): Generalized; renamed from
        epa-display-verify-result.
        (epa-decrypt-file): Use it.
diff --git a/epa.el b/epa.el
index 948cf8f..bff4769 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -42,7 +42,7 @@
   :type 'boolean
   :group 'epa)
 
-(defcustom epa-popup-info-window nil
+(defcustom epa-popup-info-window t
   "If non-nil, status information from epa commands is displayed on
 the separate window."
   :type 'boolean
@@ -516,7 +516,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
 
 (defun epa-display-info (info)
   (if epa-popup-info-window
-      (progn
+      (save-window-excursion
        (unless epa-info-buffer
          (setq epa-info-buffer (generate-new-buffer "*Info*")))
        (save-excursion
@@ -525,11 +525,16 @@ If SECRET is non-nil, list secret keys instead of public keys."
                buffer-read-only)
            (erase-buffer)
            (insert info))
-         (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)))
+         (epa-info-mode)
+         (goto-char (point-min)))
+       (if (> (window-height)
+              epa-info-window-height)
+           (set-window-buffer (split-window nil (- (window-height)
+                                                   epa-info-window-height))
+                              epa-info-buffer)
+         (pop-to-buffer epa-info-buffer)
+         (if (> (window-height) epa-info-window-height)
+             (shrink-window (- (window-height) epa-info-window-height)))))
     (message "%s" info)))
 
 (defun epa-display-verify-result (verify-result)
@@ -832,7 +837,9 @@ Don't use this command in Lisp programs!"
        (message "Importing %s...failed" (file-name-nondirectory file))))
     (if (epg-context-result-for context 'import)
        (epa-display-info (epg-import-result-to-string
-                          (epg-context-result-for context 'import))))))
+                          (epg-context-result-for context 'import))))
+    (if (eq major-mode 'epa-keys-mode)
+       (apply #'epa-list-keys epa-list-keys-arguments))))
 
 ;;;###autoload
 (defun epa-export-keys (keys file)