Function: cider--completing-read-host

cider--completing-read-host is a byte-compiled function defined in cider.el.

Signature

(cider--completing-read-host HOSTS)

Documentation

Interactively select host from HOSTS.

Each element in HOSTS is one of: (host), (host port) or (label host port). Return a list of the form (HOST PORT), where PORT can be nil.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider.el
(defun cider--completing-read-host (hosts)
  "Interactively select host from HOSTS.
Each element in HOSTS is one of: (host), (host port) or (label host port).
Return a list of the form (HOST PORT), where PORT can be nil."
  (let* ((hosts (cider-join-into-alist hosts))
         (sel-host (completing-read "Host: " hosts nil nil nil
                                    'cider-host-history (caar hosts)))
         (host (or (cdr (assoc sel-host hosts)) (list sel-host))))
    ;; remove the label
    (if (= 3 (length host)) (cdr host) host)))