diff options
| author | Daiki Ueno | 2014-11-18 14:52:45 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2014-11-18 14:54:01 +0900 |
| commit | 5c249e2a0470b1bc53d10b5f4cf303922933e280 (patch) | |
| tree | e87b130fb16fea6c05337d1cc6523623a0d82a47 | |
| parent | 5224be2f7401bd9999b5442a94d0b2abf7f4da3b (diff) | |
| download | emacs-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/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/epg.el | 12 |
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 @@ | |||
| 1 | 2014-11-18 Daiki Ueno <ueno@gnu.org> | 1 | 2014-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 | |||
| 7 | 2014-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 | |||
| 252 | query by itself and Emacs can intercept them." | 252 | query 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 | |||
| 268 | current amount done, the total amount to be done, and the | 268 | current amount done, the total amount to be done, and the |
| 269 | callback data (if any)." | 269 | callback 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." |