Function: pcomplete-read-hosts-file

pcomplete-read-hosts-file is a byte-compiled function defined in pcomplete.el.gz.

Signature

(pcomplete-read-hosts-file FILENAME)

Documentation

Read in the hosts from FILENAME, default pcomplete-hosts-file.

Aliases

eshell-read-hosts-file (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/pcomplete.el.gz
(defun pcomplete-read-hosts-file (filename)
  "Read in the hosts from FILENAME, default `pcomplete-hosts-file'."
  (let (hosts)
    (with-temp-buffer
      (insert-file-contents (or filename pcomplete-hosts-file))
      (goto-char (point-min))
      (while (re-search-forward
              ;; "^ \t\\([^# \t\n]+\\)[ \t]+\\([^ \t\n]+\\)\\([ \t]*\\([^ \t\n]+\\)\\)?"
              "^[ \t]*\\([^# \t\n]+\\)[ \t]+\\([^ \t\n].+\\)" nil t)
        (push (cons (match-string 1)
                    (split-string (match-string 2)))
              hosts)))
    (nreverse hosts)))