Function: auth-source-netrc-parse-entries
auth-source-netrc-parse-entries is a byte-compiled function defined in
auth-source.el.gz.
Signature
(auth-source-netrc-parse-entries CHECK MAX)
Documentation
Parse up to MAX netrc entries, passed by CHECK, from the current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/auth-source.el.gz
(defun auth-source-netrc-parse-entries(check max)
"Parse up to MAX netrc entries, passed by CHECK, from the current buffer."
(let ((adder (lambda(check alist all)
(when (and
alist
(> max (length all))
(funcall check alist))
(push alist all))
all))
item item2 all alist default)
(while (setq item (auth-source-netrc-parse-one))
(setq default (equal item "default"))
;; We're starting a new machine. Save the old one.
(when (and alist
(or default
(equal item "machine")))
;; (auth-source-do-trivia
;; "auth-source-netrc-parse-entries: got entry %S" alist)
(setq all (funcall adder check alist all)
alist nil))
;; In default entries, we don't have a next token.
;; We store them as ("machine" . t)
(if default
(push (cons "machine" t) alist)
;; Not a default entry. Grab the next item.
(when (setq item2 (auth-source-netrc-parse-one))
;; Did we get a "machine" value?
(if (equal item2 "machine")
(error
"%s: Unexpected `machine' token at line %d"
"auth-source-netrc-parse-entries"
(auth-source-current-line))
(push (cons item item2) alist)))))
;; Clean up: if there's an entry left over, use it.
(when alist
(setq all (funcall adder check alist all))
;; (auth-source-do-trivia
;; "auth-source-netrc-parse-entries: got2 entry %S" alist)
)
(nreverse all)))