Function: netrc-credentials

netrc-credentials is an autoloaded and byte-compiled function defined in netrc.el.gz.

Signature

(netrc-credentials MACHINE &rest PORTS)

Documentation

Return a user name/password pair.

Port specifications will be prioritized in the order they are listed in the PORTS list.

Source Code

;; Defined in /usr/src/emacs/lisp/net/netrc.el.gz
;;;###autoload
(defun netrc-credentials (machine &rest ports)
  "Return a user name/password pair.
Port specifications will be prioritized in the order they are
listed in the PORTS list."
  (let ((list (netrc-parse))
	found)
    (if (not ports)
	(setq found (netrc-machine list machine))
      (while (and ports
		  (not found))
	(setq found (netrc-machine list machine (pop ports)))))
    (when found
      (list (cdr (assoc "login" found))
	    (cdr (assoc "password" found))))))