From 0d6a73036eef75068f8bcae5dc9b3c133761dcbd Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 1 May 2006 12:46:15 +0000 Subject: [PATCH] * epg.el (epg-start-sign): Fixed rule of the MODE argument. --- ChangeLog | 1 + epg.el | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19adc5a..da7ba4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ (epg-status-SIG_CREATED): Set epg-new-signature object. (epg-new-signature-to-string): New function. (epg-make-signature): Added slots for signature class and version. + (epg-start-sign): Fixed rule of the MODE argument. 2006-04-30 Daiki Ueno diff --git a/epg.el b/epg.el index 6e17c05..d886f4e 100644 --- a/epg.el +++ b/epg.el @@ -1515,9 +1515,9 @@ For a normal or a clear text signature, SIGNED-TEXT should be nil." "Initiate a sign operation on PLAIN. PLAIN is a data object. -If optional 3rd argument MODE is 'clear, it makes a clear text signature. -If MODE is t or 'detached, it makes a detached signature. -Otherwise, it makes a normal signature. +If optional 3rd argument MODE is t or 'detached, it makes a detached signature. +If it is nil or 'normal, it makes a normal signature. +Otherwise, it makes a clear text signature. If you use this function, you will need to wait for the completion of `epg-gpg-program' by using `epg-wait-for-completion' and call @@ -1526,11 +1526,11 @@ If you are unsure, use synchronous version of this function `epg-sign-file' or `epg-sign-string' instead." (epg-context-set-result context nil) (epg-start context - (append (list (if (eq mode 'clear) - "--clearsign" - (if (or (eq mode t) (eq mode 'detached)) - "--detach-sign" - "--sign"))) + (append (list (if (or (eq mode t) (eq mode 'detached)) + "--detach-sign" + (if (or (null mode) (eq mode 'normal)) + "--sign" + "--clearsign"))) (apply #'nconc (mapcar (lambda (signer) @@ -1554,9 +1554,9 @@ If you are unsure, use synchronous version of this function (defun epg-sign-file (context plain signature &optional mode) "Sign a file PLAIN and store the result to a file SIGNATURE. If SIGNATURE is nil, it returns the result as a string. -If optional 3rd argument MODE is 'clear, it makes a clear text signature. -If MODE is t or 'detached, it makes a detached signature. -Otherwise, it makes a normal signature." +If optional 3rd argument MODE is t or 'detached, it makes a detached signature. +If it is nil or 'normal, it makes a normal signature. +Otherwise, it makes a clear text signature." (unwind-protect (progn (if signature @@ -1579,9 +1579,9 @@ Otherwise, it makes a normal signature." ;;;###autoload (defun epg-sign-string (context plain &optional mode) "Sign a string PLAIN and return the output as string. -If optional 3rd argument MODE is 'clear, it makes a clear text signature. -If MODE is t or 'detached, it makes a detached signature. -Otherwise, it makes a normal signature." +If optional 3rd argument MODE is t or 'detached, it makes a detached signature. +If it is nil or 'normal, it makes a normal signature. +Otherwise, it makes a clear text signature." (unwind-protect (progn (epg-context-set-output-file context -- 1.7.10.4