summaryrefslogtreecommitdiff
path: root/lisp/net/netrc.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-12-28 22:26:31 +0000
committerMiles Bader <miles@gnu.org>2007-12-28 22:26:31 +0000
commit870356897e927f380841268667a92b40fb9e6782 (patch)
treeba253641e797b1d4b35bdf41bb140508dafb5440 /lisp/net/netrc.el
parentb17f53abc28496125965f36147b76ea5f6a2b4fb (diff)
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-967
Diffstat (limited to 'lisp/net/netrc.el')
-rw-r--r--lisp/net/netrc.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el
index da9182e7cd..67c8dd43b8 100644
--- a/lisp/net/netrc.el
+++ b/lisp/net/netrc.el
@@ -35,10 +35,22 @@
;;; .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
'line-end-position))
+(eval-when-compile
+ (defvar encrypt-file-alist)
+ ;; This is unnecessary in the compiled version as it is a macro.
+ (if (fboundp 'bound-and-true-p)
+ (defalias 'netrc-bound-and-true-p 'bound-and-true-p)
+ (defmacro netrc-bound-and-true-p (var)
+ "Return the value of symbol VAR if it is bound, else nil."
+ `(and (boundp (quote ,var)) ,var))))
(defgroup netrc nil
"Netrc configuration."
@@ -55,8 +67,12 @@
(let ((tokens '("machine" "default" "login"
"password" "account" "macdef" "force"
"port"))
+ (encryption-model (when (netrc-bound-and-true-p encrypt-file-alist)
+ (encrypt-find-model file)))
alist elem result pair)
- (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))