* org-agenda.el (org-agenda-restore-windows-after-quit): Fix typo in docstring.
[bpt/emacs.git] / lisp / epa.el
index 18c2ff3..4f4d625 100644 (file)
@@ -1,5 +1,5 @@
 ;;; epa.el --- the EasyPG Assistant
-;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
@@ -269,7 +269,8 @@ You should bind this variable with `let', but do not set it globally.")
   :help-echo 'epa--key-widget-help-echo)
 
 (defun epa--key-widget-action (widget &optional event)
-  (epa--show-key (widget-get widget :value)))
+  (save-selected-window
+    (epa--show-key (widget-get widget :value))))
 
 (defun epa--key-widget-value-create (widget)
   (let* ((key (widget-get widget :value))
@@ -327,7 +328,7 @@ You should bind this variable with `let', but do not set it globally.")
   (make-local-variable 'epa-exit-buffer-function)
   (make-local-variable 'revert-buffer-function)
   (setq revert-buffer-function 'epa--key-list-revert-buffer)
-  (run-hooks 'epa-key-list-mode-hook))
+  (run-mode-hooks 'epa-key-list-mode-hook))
 
 (defun epa-key-mode ()
   "Major mode for a key description."
@@ -344,7 +345,7 @@ You should bind this variable with `let', but do not set it globally.")
   ;; if buffer-file-name is not set.
   (font-lock-set-defaults)
   (make-local-variable 'epa-exit-buffer-function)
-  (run-hooks 'epa-key-mode-hook))
+  (run-mode-hooks 'epa-key-mode-hook))
 
 (defun epa-info-mode ()
   "Major mode for `epa-info-buffer'."
@@ -355,7 +356,7 @@ You should bind this variable with `let', but do not set it globally.")
        truncate-lines t
        buffer-read-only t)
   (use-local-map epa-info-mode-map)
-  (run-hooks 'epa-info-mode-hook))
+  (run-mode-hooks 'epa-info-mode-hook))
 
 (defun epa-mark-key (&optional arg)
   "Mark a key on the current line.
@@ -585,7 +586,11 @@ If SECRET is non-nil, list secret keys instead of public keys."
                                      (epg-sub-key-creation-time (car pointer)))
                (error "????-??-??"))
              (if (epg-sub-key-expiration-time (car pointer))
-                 (format "\n\tExpires: %s"
+                 (format (if (time-less-p (current-time)
+                                          (epg-sub-key-expiration-time
+                                           (car pointer)))
+                             "\n\tExpires: %s"
+                           "\n\tExpired: %s")
                          (condition-case nil
                              (format-time-string "%Y-%m-%d"
                                                  (epg-sub-key-expiration-time
@@ -630,7 +635,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
 
 (defun epa-display-verify-result (verify-result)
   (epa-display-info (epg-verify-result-to-string verify-result)))
-(make-obsolete 'epa-display-verify-result 'epa-display-info)
+(make-obsolete 'epa-display-verify-result 'epa-display-info "23.1")
 
 (defun epa-passphrase-callback-function (context key-id handback)
   (if (eq key-id 'SYM)
@@ -720,7 +725,8 @@ d - Create a detached signature
 ? - Show this help
 "))))
            (t
-            (setq type 'normal))))))
+            (setq type 'normal))))
+    type))
 
 ;;;###autoload
 (defun epa-sign-file (file signers mode)
@@ -824,7 +830,8 @@ For example:
       (setq plain (epa--decode-coding-string
                   plain
                   (or coding-system-for-read
-                      (get-text-property start 'epa-coding-system-used))))
+                      (get-text-property start 'epa-coding-system-used)
+                      'undecided)))
       (if (y-or-n-p "Replace the original text? ")
          (let ((inhibit-read-only t)
                buffer-read-only)
@@ -913,7 +920,8 @@ For example:
     (setq plain (epa--decode-coding-string
                 plain
                 (or coding-system-for-read
-                    (get-text-property start 'epa-coding-system-used))))
+                    (get-text-property start 'epa-coding-system-used)
+                    'undecided)))
     (if (y-or-n-p "Replace the original text? ")
        (let ((inhibit-read-only t)
              buffer-read-only)