Commit 7dd37071 authored by Mike Lamb's avatar Mike Lamb Committed by Glenn Morris

pcmpl-ssh-known-hosts tiny change

* lisp/pcmpl-unix.el (pcmpl-ssh-known-hosts): Handle [host]:port syntax.

Fixes: debbugs:10533
parent 2aa43abb
2012-01-27 Mike Lamb <> (tiny change)
* pcmpl-unix.el (pcmpl-ssh-known-hosts):
Handle [host]:port syntax. (Bug#10533)
2012-01-27 Alex Harsanyi <>
* xml.el (xml-parse-tag): Fix parsing of comments (Bug#10405).
......@@ -152,13 +152,15 @@ documentation), this function returns nil."
(file-readable-p pcmpl-ssh-known-hosts-file))
(insert-file-contents-literally pcmpl-ssh-known-hosts-file)
(let (ssh-hosts-list)
(while (re-search-forward "^ *\\([-.[:alnum:]]+\\)[, ]" nil t)
(add-to-list 'ssh-hosts-list (match-string 1))
(let ((host-re "\\(?:\\([-.[:alnum:]]+\\)\\|\\[\\([-.[:alnum:]]+\\)\\]:[0-9]+\\)[, ]")
(while (re-search-forward (concat "^ *" host-re) nil t)
(add-to-list 'ssh-hosts-list (concat (match-string 1)
(match-string 2)))
(while (and (looking-back ",")
(re-search-forward "\\([-.[:alnum:]]+\\)[, ]"
(line-end-position) t))
(add-to-list 'ssh-hosts-list (match-string 1))))
(re-search-forward host-re (line-end-position) t))
(add-to-list 'ssh-hosts-list (concat (match-string 1)
(match-string 2)))))
(defun pcmpl-ssh-config-hosts ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment