;;; netrc.el --- .netrc parsing functionality
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2013 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
+;;
;; Modularized by Ted Zlatanov <tzz@lifelogs.com>
;; when it was part of Gnus.
;;; .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."
:group 'comm)
+(defcustom netrc-file "~/.authinfo"
+ "File where user credentials are stored."
+ :version "24.1"
+ :type 'file
+ :group 'netrc)
+
(defvar netrc-services-file "/etc/services"
"The name of the services file.")
-(defun netrc-parse (file)
+(defvar netrc-cache nil)
+
+(defun netrc-parse (&optional file)
(interactive "fFile to Parse: ")
"Parse FILE and return a list of all entries in the file."
- (when (file-exists-p file)
- (with-temp-buffer
- (let ((tokens '("machine" "default" "login"