emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/netrc.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/net/netrc.el,v
Date: Fri, 28 Dec 2007 22:26:32 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/12/28 22:26:32

Index: lisp/net/netrc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/netrc.el,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- lisp/net/netrc.el   2 Dec 2007 18:57:17 -0000       1.10
+++ lisp/net/netrc.el   28 Dec 2007 22:26:29 -0000      1.11
@@ -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))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]