Synch to No Gnus 200506270911.
[elisp/gnus.git-] / lisp / encrypt.el
index 8393823..9337272 100644 (file)
@@ -1,5 +1,5 @@
 ;;; encrypt.el --- file encryption routines
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <tzz@lifelogs.com>
 ;; Created: 2003/01/24
 
 ;; autoload password
 (eval-and-compile
-  (autoload 'password-read "password"))
-
-(defgroup encrypt nil
-  "File encryption configuration.")
-
-(defcustom encrypt-password-cache-expiry 200
-  "Encryption password timeout.
-When set, directly sets password-cache-expiry"
-  :type 'integer
-  :group 'encrypt
-  :set (lambda (symbol value)
-        (set symbol value)
-        (setq password-cache-expiry value)))
+  (autoload 'password-read "password")
+  ;; The following section is needed since T-gnus won't load password.el
+  ;; by way of pgg.el at the compile time.
+  (autoload 'password-read-and-add "password")
+  (autoload 'password-cache-remove "password")
+  (defvar password-cache-expiry))
+
+(defgroup encrypt '((password-cache custom-variable)
+                   (password-cache-expiry custom-variable))
+  "File encryption configuration."
+  :group 'applications)
 
 (defcustom encrypt-file-alist nil
   "List of file names or regexes matched with encryptions.
@@ -94,6 +92,7 @@ Format example:
 (defvar encrypt-temp-prefix "encrypt"
   "Prefix for temporary filenames")
 
+;;;###autoload
 (defun encrypt-find-model (filename)
   "Given a filename, find a encrypt-file-alist entry"
   (dolist (entry encrypt-file-alist)
@@ -103,6 +102,7 @@ Format example:
                (string-match match filename))
        (return model)))))
 
+;;;###autoload
 (defun encrypt-insert-file-contents (file &optional model)
   "Decrypt FILE into the current buffer."
   (interactive "fFile to insert: ")
@@ -218,7 +218,7 @@ Format example:
        (progn
          (setq new-list (reverse (split-string bs)))
          (dolist (x new-list)
-           (setq x (string-to-int x))
+           (setq x (string-to-number x))
            (insert (format "%c" (logxor x passphrase-sum))))))
       (buffer-substring-no-properties (point-min) (point-max)))))
 
@@ -274,5 +274,3 @@ Format example:
 
 (provide 'encrypt)
 ;;; encrypt.el ends here
-
-;; arch-tag: d907e4f1-71b5-42b1-a180-fc7b84ff0648