* mml2015.el (mml2015-epg-passphrase-callback): Type cast KEY-ID to a
authorDaiki Ueno <ueno@unixuser.org>
Mon, 10 Mar 2008 08:59:56 +0000 (08:59 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Mon, 10 Mar 2008 08:59:56 +0000 (08:59 +0000)
string for caching if it is 'PIN.

lisp/ChangeLog
lisp/mml2015.el

index af30ba4..3984c8e 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-10  Daiki Ueno  <ueno@unixuser.org>
+
+       * mml2015.el (mml2015-epg-passphrase-callback): Type cast KEY-ID to a
+       string for caching if it is 'PIN.
+
 2008-03-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * lpath.el: Consider the case without Emacs/W3.
index 8add5e5..eb09b71 100644 (file)
@@ -999,7 +999,11 @@ Whether the passphrase is cached at all is controlled by
 (defun mml2015-epg-passphrase-callback (context key-id ignore)
   (if (eq key-id 'SYM)
       (epg-passphrase-callback-function context key-id nil)
-    (let* (entry
+    (let* ((password-cache-key-id
+           (if (eq key-id 'PIN)
+               "PIN"
+              key-id))
+          entry
           (passphrase
            (password-read
             (if (eq key-id 'PIN)
@@ -1007,14 +1011,12 @@ Whether the passphrase is cached at all is controlled by
               (if (setq entry (assoc key-id epg-user-id-alist))
                   (format "Passphrase for %s %s: " key-id (cdr entry))
                 (format "Passphrase for %s: " key-id)))
-            (if (eq key-id 'PIN)
-                "PIN"
-              key-id))))
+            password-cache-key-id)))
       (when passphrase
        (let ((password-cache-expiry mml2015-passphrase-cache-expiry))
-         (password-cache-add key-id passphrase))
+         (password-cache-add password-cache-key-id passphrase))
        (setq mml2015-epg-secret-key-id-list
-             (cons key-id mml2015-epg-secret-key-id-list))
+             (cons password-cache-key-id mml2015-epg-secret-key-id-list))
        (copy-sequence passphrase)))))
 
 (defun mml2015-epg-find-usable-key (keys usage)