(netrc-parse): Use encrypt-file-alist to determine if
encrypt-find-model or encrypt-insert-file-contents should be used.
* encrypt.el: Clarify documentation. Load password-cache or
password, whichever one is found first, instead of autoloading.
+2007-12-19 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * netrc.el: Autoload encrypt when encrypt-file-alist is set.
+ (netrc-parse): Use encrypt-file-alist to determine if
+ encrypt-find-model or encrypt-insert-file-contents should be used.
+
+ * encrypt.el: Clarify documentation. Load password-cache or
+ password, whichever one is found first, instead of autoloading.
+
2007-12-17 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-article-browse-html-parts): Add message header and
2007-12-17 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-article-browse-html-parts): Add message header and
;;; particular aspect.
;;; Use in Gnus like this:
;;; particular aspect.
;;; Use in Gnus like this:
;;; (setq
;;; nnimap-authinfo-file "~/.authinfo.enc"
;;; nntp-authinfo-file "~/.authinfo.enc"
;;; smtpmail-auth-credentials "~/.authinfo.enc"
;;; (setq
;;; nnimap-authinfo-file "~/.authinfo.enc"
;;; nntp-authinfo-file "~/.authinfo.enc"
;;; smtpmail-auth-credentials "~/.authinfo.enc"
-;;; ;; using the AES256 cipher, feel free to use your own favorite
+;;; ;; GnuPG using the AES256 cipher, feel free to use your own favorite
;;; encrypt-file-alist (quote (("~/.authinfo.enc" (gpg "AES256"))))
;;; password-cache-expiry 600)
;;; encrypt-file-alist (quote (("~/.authinfo.enc" (gpg "AES256"))))
;;; password-cache-expiry 600)
;; autoload password
(eval-and-compile
;; autoload password
(eval-and-compile
- (autoload 'password-read "password"))
+ (if (locate-library "password-cache")
+ (require 'password-cache)
+ (require 'password)))
(defgroup encrypt '((password-cache custom-variable)
(password-cache-expiry custom-variable))
(defgroup encrypt '((password-cache custom-variable)
(password-cache-expiry custom-variable))
;;; .netrc and .authinfo rc parsing
;;;
;;; .netrc and .authinfo rc parsing
;;;
+;; use encrypt if loaded (encrypt-file-alist has to be set as well)
+(eval-and-compile
+ (autoload 'encrypt-find-model "encrypt")
+ (autoload 'encrypt-insert-file-contents "encrypt"))
(defalias 'netrc-point-at-eol
(if (fboundp 'point-at-eol)
'point-at-eol
(defalias 'netrc-point-at-eol
(if (fboundp 'point-at-eol)
'point-at-eol
(let ((tokens '("machine" "default" "login"
"password" "account" "macdef" "force"
"port"))
(let ((tokens '("machine" "default" "login"
"password" "account" "macdef" "force"
"port"))
+ (encryption-model (when (bound-and-true-p encrypt-file-alist)
+ (encrypt-find-model file)))
- (insert-file-contents file)
+ (if encryption-model
+ (encrypt-insert-file-contents file encryption-model)
+ (insert-file-contents file))
(goto-char (point-min))
;; Go through the file, line by line.
(while (not (eobp))
(goto-char (point-min))
;; Go through the file, line by line.
(while (not (eobp))