]> git.eshelyaron.com Git - emacs.git/commitdiff
epg: Fix callback argument type check
authorDaiki Ueno <ueno@gnu.org>
Tue, 18 Nov 2014 05:52:45 +0000 (14:52 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 18 Nov 2014 05:54:01 +0000 (14:54 +0900)
* epg.el (epg-context-set-passphrase-callback)
(epg-context-set-progress-callback): Check if the CALLBACK
argument is a function, instead of a cons.

lisp/ChangeLog
lisp/epg.el

index 928c89cc8483d164ba2d33d48fff8b0d14c11107..2670a66a7c72e08cc2e85a5064b4a68f77c3a66c 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-18  Daiki Ueno  <ueno@gnu.org>
+
+       * epg.el (epg-context-set-passphrase-callback)
+       (epg-context-set-progress-callback): Check if the CALLBACK
+       argument is a function, instead of a cons.
+
 2014-11-18  Daiki Ueno  <ueno@gnu.org>
 
        * epa-file.el (epa-file-insert-file-contents)
index e4d8c1e1a024d134733c86d8c3ca252de4fca21a..20e678506937d7d3c9b70cb8f9ea1be0fd1bc64b 100644 (file)
@@ -252,9 +252,9 @@ installing GnuPG 1.x _along with_ GnuPG 2.x, which does passphrase
 query by itself and Emacs can intercept them."
   ;; (declare (obsolete setf "25.1"))
   (setf (epg-context-passphrase-callback context)
-        (if (consp passphrase-callback) ;FIXME: functions can also be consp!
-            passphrase-callback
-          (list passphrase-callback))))
+        (if (functionp passphrase-callback)
+           (list passphrase-callback)
+         passphrase-callback)))
 
 (defun epg-context-set-progress-callback (context
                                          progress-callback)
@@ -268,9 +268,9 @@ description, the character to display a progress unit, the
 current amount done, the total amount to be done, and the
 callback data (if any)."
   (setf (epg-context-progress-callback context)
-        (if (consp progress-callback) ;FIXME: could be a function!
-            progress-callback
-          (list progress-callback))))
+        (if (functionp progress-callback)
+            (list progress-callback)
+          progress-callback)))
 
 (defun epg-context-set-signers (context signers)
   "Set the list of key-id for signing."