From: ueno Date: Sat, 11 Nov 2006 08:33:31 +0000 (+0000) Subject: Fixed. X-Git-Tag: epg-0_0_8~37 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f8c40ba911ce02c77e081f237c267810492f8bfa;p=elisp%2Fepg.git Fixed. --- diff --git a/ChangeLog b/ChangeLog index 6f79624..aec2184 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,8 @@ * epg.el (epg-start-sign): Don't set --armor nor --textmode if mode is set for a cleartext signature. - (epg-make-context): New slot "sig-notations". - (epg--args-from-sig-notations): New function. + (epg-make-context): New slot "signature-notations". + (epg--args-from-signature-notations): New function. (epg-start-sign): Specify --sig-notation or --sig-policy-url if desired. (epg-start-encrypt): Ditto. diff --git a/epg.el b/epg.el index 89f7949..add41e1 100644 --- a/epg.el +++ b/epg.el @@ -250,7 +250,7 @@ message." (signal 'wrong-type-argument (list 'epg-context-p context))) (aref (cdr context) 9)) -(defun epg-context-sig-notations (context) +(defun epg-context-signature-notations (context) "Return the list of notations for singning." (unless (eq (car-safe context) 'epg-context) (signal 'wrong-type-argument (list 'epg-context-p context))) @@ -343,7 +343,7 @@ This function is for internal use only." (signal 'wrong-type-argument (list 'epg-context-p context))) (aset (cdr context) 9 signers)) -(defun epg-context-set-sig-notations (context notations) +(defun epg-context-set-signature-notations (context notations) "Set the list of notations for singning." (unless (eq (car-safe context) 'epg-context) (signal 'wrong-type-argument (list 'epg-context-p context))) @@ -727,33 +727,38 @@ This function is for internal use only." (signal 'wrong-type-argument (list 'epg-key-signature-p key-signature))) (aref (cdr key-signature) 7)) -(defun epg-make-sig-notation (name value &optional human-readable critical) +(defun epg-make-signature-notation (name value &optional human-readable + critical) "Return a notation object." - (cons 'epg-sig-notation (vector name value human-readable critical))) - -(defun epg-sig-notation-name (sig-notation) - "Return the name of SIG-NOTATION." - (unless (eq (car-safe sig-notation) 'epg-sig-notation) - (signal 'wrong-type-argument (list 'epg-sig-notation-p sig-notation))) - (aref (cdr sig-notation) 0)) - -(defun epg-sig-notation-value (sig-notation) - "Return the value of SIG-NOTATION." - (unless (eq (car-safe sig-notation) 'epg-sig-notation) - (signal 'wrong-type-argument (list 'epg-sig-notation-p sig-notation))) - (aref (cdr sig-notation) 1)) - -(defun epg-sig-notation-human-readable (sig-notation) - "Return the human-readable of SIG-NOTATION." - (unless (eq (car-safe sig-notation) 'epg-sig-notation) - (signal 'wrong-type-argument (list 'epg-sig-notation-p sig-notation))) - (aref (cdr sig-notation) 2)) - -(defun epg-sig-notation-critical (sig-notation) - "Return the critical of SIG-NOTATION." - (unless (eq (car-safe sig-notation) 'epg-sig-notation) - (signal 'wrong-type-argument (list 'epg-sig-notation-p sig-notation))) - (aref (cdr sig-notation) 3)) + (cons 'epg-signature-notation (vector name value human-readable critical))) + +(defun epg-signature-notation-name (signature-notation) + "Return the name of SIGNATURE-NOTATION." + (unless (eq (car-safe signature-notation) 'epg-signature-notation) + (signal 'wrong-type-argument (list 'epg-signature-notation-p + signature-notation))) + (aref (cdr signature-notation) 0)) + +(defun epg-signature-notation-value (signature-notation) + "Return the value of SIGNATURE-NOTATION." + (unless (eq (car-safe signature-notation) 'epg-signature-notation) + (signal 'wrong-type-argument (list 'epg-signature-notation-p + signature-notation))) + (aref (cdr signature-notation) 1)) + +(defun epg-signature-notation-human-readable (signature-notation) + "Return the human-readable of SIGNATURE-NOTATION." + (unless (eq (car-safe signature-notation) 'epg-signature-notation) + (signal 'wrong-type-argument (list 'epg-signature-notation-p + signature-notation))) + (aref (cdr signature-notation) 2)) + +(defun epg-signature-notation-critical (signature-notation) + "Return the critical of SIGNATURE-NOTATION." + (unless (eq (car-safe signature-notation) 'epg-signature-notation) + (signal 'wrong-type-argument (list 'epg-signature-notation-p + signature-notation))) + (aref (cdr signature-notation) 3)) (defun epg-context-result-for (context name) "Return the result of CONTEXT associated with NAME." @@ -1534,21 +1539,22 @@ You can then use `write-region' to write new data into the file." (defun epg--clear-string (string) (fillarray string 0))) -(defun epg--args-from-sig-notations (notations) +(defun epg--args-from-signature-notations (notations) (apply #'nconc (mapcar (lambda (notation) - (if (and (epg-sig-notation-name notation) - (not (epg-sig-notation-human-readable notation))) + (if (and (epg-signature-notation-name notation) + (not (epg-signature-notation-human-readable notation))) (error "Unreadable")) - (if (epg-sig-notation-name notation) + (if (epg-signature-notation-name notation) (list "--sig-notation" - (if (epg-sig-notation-critical notation) - (concat "!" (epg-sig-notation-name notation) - "=" (epg-sig-notation-value notation)) - (concat (epg-sig-notation-name notation) - "=" (epg-sig-notation-value notation)))) - (list "--sig-policy-url" (epg-sig-notation-value notation)))) + (if (epg-signature-notation-critical notation) + (concat "!" (epg-signature-notation-name notation) + "=" (epg-signature-notation-value notation)) + (concat (epg-signature-notation-name notation) + "=" (epg-signature-notation-value notation)))) + (list "--sig-policy-url" + (epg-signature-notation-value notation)))) notations)) ;;;###autoload @@ -1752,7 +1758,8 @@ If you are unsure, use synchronous version of this function (epg-sub-key-id (car (epg-key-sub-key-list signer))))) (epg-context-signers context))) - (epg--args-from-sig-notations (epg-context-sig-notations)) + (epg--args-from-signature-notations + (epg-context-signature-notations context)) (if (epg-data-file plain) (list "--" (epg-data-file plain))))) ;; `gpgsm' does not read passphrase from stdin, so waiting is not needed. @@ -1840,8 +1847,8 @@ If you are unsure, use synchronous version of this function signer))))) (epg-context-signers context)))) (if sign - (epg--args-from-sig-notations - (epg-context-sig-notations))) + (epg--args-from-signature-notations + (epg-context-signature-notations context))) (apply #'nconc (mapcar (lambda (recipient)