aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2014-11-18 14:52:45 +0900
committerDaiki Ueno2014-11-18 14:54:01 +0900
commit5c249e2a0470b1bc53d10b5f4cf303922933e280 (patch)
treee87b130fb16fea6c05337d1cc6523623a0d82a47
parent5224be2f7401bd9999b5442a94d0b2abf7f4da3b (diff)
downloademacs-5c249e2a0470b1bc53d10b5f4cf303922933e280.tar.gz
emacs-5c249e2a0470b1bc53d10b5f4cf303922933e280.zip
epg: Fix callback argument type check
* epg.el (epg-context-set-passphrase-callback) (epg-context-set-progress-callback): Check if the CALLBACK argument is a function, instead of a cons.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/epg.el12
2 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 928c89cc848..2670a66a7c7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12014-11-18 Daiki Ueno <ueno@gnu.org> 12014-11-18 Daiki Ueno <ueno@gnu.org>
2 2
3 * epg.el (epg-context-set-passphrase-callback)
4 (epg-context-set-progress-callback): Check if the CALLBACK
5 argument is a function, instead of a cons.
6
72014-11-18 Daiki Ueno <ueno@gnu.org>
8
3 * epa-file.el (epa-file-insert-file-contents) 9 * epa-file.el (epa-file-insert-file-contents)
4 (epa-file-write-region): Remove redundant check of 10 (epa-file-write-region): Remove redundant check of
5 epa-pinentry-mode. 11 epa-pinentry-mode.
diff --git a/lisp/epg.el b/lisp/epg.el
index e4d8c1e1a02..20e67850693 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -252,9 +252,9 @@ installing GnuPG 1.x _along with_ GnuPG 2.x, which does passphrase
252query by itself and Emacs can intercept them." 252query by itself and Emacs can intercept them."
253 ;; (declare (obsolete setf "25.1")) 253 ;; (declare (obsolete setf "25.1"))
254 (setf (epg-context-passphrase-callback context) 254 (setf (epg-context-passphrase-callback context)
255 (if (consp passphrase-callback) ;FIXME: functions can also be consp! 255 (if (functionp passphrase-callback)
256 passphrase-callback 256 (list passphrase-callback)
257 (list passphrase-callback)))) 257 passphrase-callback)))
258 258
259(defun epg-context-set-progress-callback (context 259(defun epg-context-set-progress-callback (context
260 progress-callback) 260 progress-callback)
@@ -268,9 +268,9 @@ description, the character to display a progress unit, the
268current amount done, the total amount to be done, and the 268current amount done, the total amount to be done, and the
269callback data (if any)." 269callback data (if any)."
270 (setf (epg-context-progress-callback context) 270 (setf (epg-context-progress-callback context)
271 (if (consp progress-callback) ;FIXME: could be a function! 271 (if (functionp progress-callback)
272 progress-callback 272 (list progress-callback)
273 (list progress-callback)))) 273 progress-callback)))
274 274
275(defun epg-context-set-signers (context signers) 275(defun epg-context-set-signers (context signers)
276 "Set the list of key-id for signing." 276 "Set the list of key-id for signing."