Function: erc-compute-port

erc-compute-port is a byte-compiled function defined in erc.el.gz.

Signature

(erc-compute-port &optional PORT)

Documentation

Return a port for an IRC server.

This tries a progressively greater number of default methods until a non-nil value is found.

- PORT (the argument passed to this function)
- The erc-port option
- The erc-default-port variable

Note that between ERC 5.5 and 5.6.1, this function filtered its result through erc-normalize-port, which introduced regrettable surprises, such as unwelcome, possibly null, type conversions.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-compute-port (&optional port)
  "Return a port for an IRC server.

This tries a progressively greater number of default methods until a
non-nil value is found.

- PORT (the argument passed to this function)
- The `erc-port' option
- The `erc-default-port' variable

Note that between ERC 5.5 and 5.6.1, this function filtered its result
through `erc-normalize-port', which introduced regrettable surprises,
such as unwelcome, possibly null, type conversions."
  (or (and port (not (equal "" port)) port) erc-port erc-default-port))