]> code.delx.au - gnu-emacs/blobdiff - lisp/epg.el
defun fix for cl declarations + interactive forms
[gnu-emacs] / lisp / epg.el
index 9ca07e213b4f3f7c9127b9289441fd8ffa0aa1bd..340fc76fb8c94efe5b35793fd811610760f0460d 100644 (file)
@@ -1,5 +1,5 @@
 ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*-
-;; Copyright (C) 1999-2000, 2002-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2000, 2002-2013 Free Software Foundation, Inc.
 
 ;; Author: Daiki Ueno <ueno@unixuser.org>
 ;; Keywords: PGP, GnuPG
@@ -82,7 +82,7 @@
 (defconst epg-invalid-recipients-reason-alist
   '((0 . "No specific reason given")
     (1 . "Not Found")
-    (2 . "Ambigious specification")
+    (2 . "Ambiguous specification")
     (3 . "Wrong key usage")
     (4 . "Key revoked")
     (5 . "Key expired")
@@ -95,7 +95,7 @@
 (defconst epg-delete-problem-reason-alist
   '((1 . "No such key")
     (2 . "Must delete secret key first")
-    (3 . "Ambigious specification")))
+    (3 . "Ambiguous specification")))
 
 (defconst epg-import-ok-reason-alist
   '((0 . "Not actually changed")
@@ -356,7 +356,7 @@ query by itself and Emacs can intercept them."
 PROGRESS-CALLBACK is either a function, or a cons-cell whose
 car is a function and cdr is a callback data.
 
-The function gets five arguments: the context, the operation
+The function gets six arguments: the context, the operation
 description, the character to display a progress unit, the
 current amount done, the total amount to be done, and the
 callback data (if any)."
@@ -1779,6 +1779,7 @@ This function is for internal use only."
     (epg-context-set-result-for context 'import-status nil)))
 
 (defun epg-passphrase-callback-function (context key-id _handback)
+  (declare (obsolete epa-passphrase-callback-function "23.1"))
   (if (eq key-id 'SYM)
       (read-passwd "Passphrase for symmetric encryption: "
                   (eq (epg-context-operation context) 'encrypt))
@@ -1790,9 +1791,6 @@ This function is for internal use only."
             (format "Passphrase for %s %s: " key-id (cdr entry))
           (format "Passphrase for %s: " key-id)))))))
 
-(make-obsolete 'epg-passphrase-callback-function
-              'epa-passphrase-callback-function "23.1")
-
 (defun epg--list-keys-1 (context name mode)
   (let ((args (append (if epg-gpg-home-directory
                          (list "--homedir" epg-gpg-home-directory))
@@ -1951,7 +1949,8 @@ The returned file name (created by appending some random characters at the end
 of PREFIX, and expanding against `temporary-file-directory' if necessary),
 is guaranteed to point to a newly created empty file.
 You can then use `write-region' to write new data into the file."
-      (let (tempdir tempfile)
+      (let ((orig-modes (default-file-modes))
+           tempdir tempfile)
        (setq prefix (expand-file-name prefix
                                       (if (featurep 'xemacs)
                                           (temp-directory)
@@ -1959,6 +1958,7 @@ You can then use `write-region' to write new data into the file."
        (unwind-protect
            (let (file)
              ;; First, create a temporary directory.
+             (set-default-file-modes #o700)
              (while (condition-case ()
                         (progn
                           (setq tempdir (make-temp-name
@@ -1969,14 +1969,12 @@ You can then use `write-region' to write new data into the file."
                           (make-directory tempdir))
                       ;; let's try again.
                       (file-already-exists t)))
-             (set-file-modes tempdir 448)
              ;; Second, create a temporary file in the tempdir.
              ;; There *is* a race condition between `make-temp-name'
              ;; and `write-region', but we don't care it since we are
              ;; in a private directory now.
              (setq tempfile (make-temp-name (concat tempdir "/EMU")))
              (write-region "" nil tempfile nil 'silent)
-             (set-file-modes tempfile 384)
              ;; Finally, make a hard-link from the tempfile.
              (while (condition-case ()
                         (progn
@@ -1986,6 +1984,7 @@ You can then use `write-region' to write new data into the file."
                       ;; let's try again.
                       (file-already-exists t)))
              file)
+         (set-default-file-modes orig-modes)
          ;; Cleanup the tempfile.
          (and tempfile
               (file-exists-p tempfile)
@@ -2031,7 +2030,7 @@ CIPHER must be a file data object.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-decrypt-file' or `epg-decrypt-string' instead."
   (unless (epg-data-file cipher)
@@ -2097,7 +2096,7 @@ For a normal or a cleartext signature, SIGNED-TEXT should be nil.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-verify-file' or `epg-verify-string' instead."
   (epg-context-set-operation context 'verify)
@@ -2195,7 +2194,7 @@ Otherwise, it makes a cleartext 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-sign-file' or `epg-sign-string' instead."
   (epg-context-set-operation context 'sign)
@@ -2299,7 +2298,7 @@ If RECIPIENTS is nil, it performs symmetric encryption.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-encrypt-file' or `epg-encrypt-string' instead."
   (epg-context-set-operation context 'encrypt)
@@ -2414,7 +2413,7 @@ If RECIPIENTS is nil, it performs symmetric encryption."
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-export-keys-to-file' or `epg-export-keys-to-string' instead."
   (epg-context-set-operation context 'export-keys)
@@ -2457,7 +2456,7 @@ KEYS is a data object.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-import-keys-from-file' or `epg-import-keys-from-string' instead."
   (epg-context-set-operation context 'import-keys)
@@ -2498,7 +2497,7 @@ KEY-ID-LIST is a list of key IDs.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-receive-keys' instead."
   (epg-context-set-operation context 'receive-keys)
@@ -2526,7 +2525,7 @@ KEYS is a list of key IDs"
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-delete-keys' instead."
   (epg-context-set-operation context 'delete-keys)
@@ -2558,9 +2557,10 @@ If you are unsure, use synchronous version of this function
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-sign-keys' instead."
+  (declare (obsolete nil "23.1"))
   (epg-context-set-operation context 'sign-keys)
   (epg-context-set-result context nil)
   (epg--start context (cons (if local
@@ -2571,10 +2571,10 @@ If you are unsure, use synchronous version of this function
                              (epg-sub-key-id
                               (car (epg-key-sub-key-list key))))
                            keys))))
-(make-obsolete 'epg-start-sign-keys "do not use." "23.1")
 
 (defun epg-sign-keys (context keys &optional local)
   "Sign KEYS from the key ring."
+  (declare (obsolete nil "23.1"))
   (unwind-protect
       (progn
        (epg-start-sign-keys context keys local)
@@ -2585,7 +2585,6 @@ If you are unsure, use synchronous version of this function
                      (list "Sign keys failed"
                            (epg-errors-to-string errors))))))
     (epg-reset context)))
-(make-obsolete 'epg-sign-keys "do not use." "23.1")
 
 (defun epg-start-generate-key (context parameters)
   "Initiate a key generation.
@@ -2593,7 +2592,7 @@ PARAMETERS specifies parameters for the key.
 
 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
-`epg-reset' to clear a temporaly output file.
+`epg-reset' to clear a temporary output file.
 If you are unsure, use synchronous version of this function
 `epg-generate-key-from-file' or `epg-generate-key-from-string' instead."
   (epg-context-set-operation context 'generate-key)